summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
98c9af5)
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).
struct str_mlist *sl_modlist;
};
struct str_mlist *sl_modlist;
};
-int ioctl (int, int, ...);
+int isastream(int);
+int ioctl(int, int, ...);
--- /dev/null
+#include <stropts.h>
+#include <fcntl.h>
+
+int isastream(int fd)
+{
+ return fcntl(fd, F_GETFD) < 0 ? -1 : 0;
+}