os: Use a uintptr for NewFile

This appears to have been how it is upstream for about 10 years. Using
an interface breaks if a file descriptor number is passed directly to
`NewFile`, e.g., `NewFile(3, "fuzz_in")` as used in Go 1.18 fuzzing
code.
This commit is contained in:
Elliott Sales de Andrade
2022-02-06 18:23:29 -05:00
committed by Ayke
parent bf23839931
commit a680bfbb7a
5 changed files with 19 additions and 25 deletions
+1 -1
View File
@@ -28,7 +28,7 @@ type mountPoint struct {
// WARNING: this interface is not finalized and may change in a future version.
type Filesystem interface {
// OpenFile opens the named file.
OpenFile(name string, flag int, perm FileMode) (FileHandle, error)
OpenFile(name string, flag int, perm FileMode) (uintptr, error)
// Mkdir creates a new directoy with the specified permission (before
// umask). Some filesystems may not support directories or permissions.