Line data Source code
1 : // Copyright 2020 The LevelDB-Go and Pebble Authors. All rights reserved. Use 2 : // of this source code is governed by a BSD-style license that can be found in 3 : // the LICENSE file. 4 : 5 : //go:build darwin || dragonfly || freebsd || linux || openbsd || netbsd 6 : // +build darwin dragonfly freebsd linux openbsd netbsd 7 : 8 : package vfs 9 : 10 : import ( 11 : "github.com/cockroachdb/errors" 12 : "golang.org/x/sys/unix" 13 : ) 14 : 15 : var errNotEmpty = unix.ENOTEMPTY 16 : 17 : // IsNoSpaceError returns true if the given error indicates that the disk is 18 : // out of space. 19 0 : func IsNoSpaceError(err error) bool { 20 0 : return errors.Is(err, unix.ENOSPC) 21 0 : }