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: IsPermission returns false when reading a write-only file descriptor. #15629
Given any file descriptor correctly opened with a write-only access level, reading from it correctly returns the errno
The context provided by
Regarding the case "fd is not a valid file descriptor", it could be excluded by also checking that the file descriptor is valid with something like
You need a special device node to reproduce this. My exact case is a tty, but go playground's stdout is a pipe, so here is the exact same error I get with a correctly opened TTY device in write-only mode:
@minux the open flag plays a role twice: at open time and at read/write time.