mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-16 18:53:29 +00:00
src/os: implement os.File.Fd() method
This commits adds a OS-specific `Fd()` function for `file_anyos.go` and `file_other.go`, which returns a uintptr to the underlying file descriptor.
This commit is contained in:
@@ -118,6 +118,10 @@ func (f unixFileHandle) Close() error {
|
||||
return handleSyscallError(syscall.Close(syscallFd(f)))
|
||||
}
|
||||
|
||||
func (f unixFileHandle) Fd() uintptr {
|
||||
return uintptr(f)
|
||||
}
|
||||
|
||||
// Chmod changes the mode of the named file to mode.
|
||||
// If the file is a symbolic link, it changes the mode of the link's target.
|
||||
// If there is an error, it will be of type *PathError.
|
||||
|
||||
Reference in New Issue
Block a user