diff options
author | Rich Felker <dalias@aerifal.cx> | 2012-05-06 09:03:19 -0400 |
---|---|---|
committer | Rich Felker <dalias@aerifal.cx> | 2012-05-06 09:03:19 -0400 |
commit | 106e75f7121b009c069733dcb8a70fe5e4380ab0 (patch) | |
tree | 0dad01735b2dd4e08e8b87acfbd34c029e0f30a2 /src/misc | |
parent | 98c9af500125df41fdb46d7e384b00982d72493a (diff) | |
download | musl-106e75f7121b009c069733dcb8a70fe5e4380ab0.tar.gz musl-106e75f7121b009c069733dcb8a70fe5e4380ab0.tar.bz2 musl-106e75f7121b009c069733dcb8a70fe5e4380ab0.tar.xz musl-106e75f7121b009c069733dcb8a70fe5e4380ab0.zip |
add isastream (obsolete STREAMS junk)
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).
Diffstat (limited to 'src/misc')
-rw-r--r-- | src/misc/isastream.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/misc/isastream.c b/src/misc/isastream.c new file mode 100644 index 00000000..4dafdb08 --- /dev/null +++ b/src/misc/isastream.c @@ -0,0 +1,7 @@ +#include <stropts.h> +#include <fcntl.h> + +int isastream(int fd) +{ + return fcntl(fd, F_GETFD) < 0 ? -1 : 0; +} |