mirror of https://git.musl-libc.org/git/musl
Browse Source
apparently some packages see stropts.h and want to be able to use this. the implementation checks that the file descriptor is valid by using fcntl/F_GETFD so it can report an error if not (as specified).rs-1.0
2 changed files with 9 additions and 1 deletions
@ -0,0 +1,7 @@ |
|||
#include <stropts.h> |
|||
#include <fcntl.h> |
|||
|
|||
int isastream(int fd) |
|||
{ |
|||
return fcntl(fd, F_GETFD) < 0 ? -1 : 0; |
|||
} |
|||
Loading…
Reference in new issue