Commit cb685274 authored by Han-Wen Nienhuys's avatar Han-Wen Nienhuys Committed by Han-Wen Nienhuys

fs: add a note about using os.File.Fd()

Change-Id: I19d52f14f63f1481b2b1aa9dcd46c91fe4e1ad99
parent 625c7706
...@@ -17,7 +17,9 @@ import ( ...@@ -17,7 +17,9 @@ import (
) )
// NewLoopbackFile creates a FileHandle out of a file descriptor. All // NewLoopbackFile creates a FileHandle out of a file descriptor. All
// operations are implemented. // operations are implemented. When using the Fd from a *os.File, call
// syscall.Dup() on the fd, to avoid os.File's finalizer from closing
// the file descriptor.
func NewLoopbackFile(fd int) FileHandle { func NewLoopbackFile(fd int) FileHandle {
return &loopbackFile{fd: fd} return &loopbackFile{fd: fd}
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment