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:
ZauberNerd
2022-03-04 15:44:55 +00:00
committed by Ron Evans
parent 4a98db4c86
commit 486b99961d
3 changed files with 19 additions and 1 deletions
+4
View File
@@ -71,6 +71,10 @@ func (f stdioFileHandle) Seek(offset int64, whence int) (int64, error) {
return -1, ErrUnsupported
}
func (f stdioFileHandle) Fd() uintptr {
return uintptr(f)
}
//go:linkname putchar runtime.putchar
func putchar(c byte)