May 21, 2008

stropts.h: No such file or directory

If during compilation your compiler complains about missing "stropts.h", don't wary. Most probably you are running on MacOS X 10.3 or FreeBSD 6.0 or NetBSD 3.0 or OpenBSD 3.8 or Cygwin or mingw or BeOS... or Fedora 9 (probably all modern Linux'es).

Simply to say, your system doesn't support STREAMS.

Linux espesially:
Linux doesn't support STREAMS (many years ago it was available as a third party module, but it hasn't worked for years). stropts.h is part of a POSIX XSR option, which Linux now, matching reality, says it is not supported.
and here we have the POSIX recommended check:

#include <unistd.h>
#if defined _XOPEN_STREAMS && _XOPEN_STREAMS == -1
/* XSR option is not available, headers, data types etc. may not be available. */
#endif
Hope it helps.