Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
os: document that NewFile can return nil for invalid fd #20023
Noting in the doc that
Moving this to
It has always behaved this way (return nil for fd < 0, back to 2008), but it does seem weird that fd=-1 is handled differently from fd=1e9. Perhaps we should return a non-nil *File that returns an appropriate error from future operations (whatever happens when you use the fd later).