"os"
)
-// If fallocate is not supported on this platform, return this error.
-// Note this is the same error returned by filesystems that don't support
-// fallocate, and that is intentional. The error is ignored where needed, and
-// OutBuf writes to heap memory.
-const fallocateNotSupportedErr = "operation not supported"
+// If fallocate is not supported on this platform, return this error. The error
+// is ignored where needed, and OutBuf writes to heap memory.
+var errNoFallocate = errors.New("operation not supported")
+
const outbufMode = 0775
// OutBuf is a buffered file writer.
// Some file systems do not support fallocate. We ignore that error as linking
// can still take place, but you might SIGBUS when you write to the mmapped
// area.
- if err.Error() != fallocateNotSupportedErr {
+ if err != syscall.ENOTSUP && err != syscall.EPERM && err != errNoFallocate {
return err
}
}