From 106e75f7121b009c069733dcb8a70fe5e4380ab0 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Sun, 6 May 2012 09:03:19 -0400 Subject: 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). --- src/misc/isastream.c | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 src/misc/isastream.c (limited to 'src/misc/isastream.c') 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 +#include + +int isastream(int fd) +{ + return fcntl(fd, F_GETFD) < 0 ? -1 : 0; +} -- cgit v1.2.1