1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-02-15 04:32:24 +00:00

sfio/sfpkrd.c: re-allow compiling on ancient systems (re: 9ba2c2e0)

This commit is contained in:
Martijn Dekker 2020-10-01 04:16:33 +02:00
parent 76d71889e2
commit be22f3759e

View file

@ -21,20 +21,18 @@
***********************************************************************/
#include "sfhdr.h"
/* The following are only needed on Solaris/Illumos, as it doesn't support POSIX recv(2) with MSG_PEEK.
* On at least macOS and Linux, sfpkrd() runs significantly faster if we disable these. */
#if !__sun
/*
* The preferred method is POSIX recv(2) with MSG_PEEK, which is detected as 'socket_peek'.
* On Solaris/Illumos (__sun), _stream_peek and _lib_select are needed, as _socket_peek doesn't work correctly.
* On at least macOS and Linux, sfpkrd() runs significantly faster if we disable these.
*/
#if _socket_peek && !__sun
#undef _stream_peek
#undef _lib_select
#endif
/* Non-SunOS systems require POSIX recv(2) with MSG_PEEK, which is detected as 'socket_peek'. */
#if !_socket_peek && !__sun
#if __APPLE__
#if __APPLE__ && !_socket_peek
#error The socket_peek feature is required. (Hey Apple, revert your src__lib__libast__features__lib.diff patch; it caused multiple regressions, and the hanging bug it fixed is now fixed correctly. See <https://github.com/ksh93/ksh/issues/118>.)
#else
#error The socket_peek feature is required.
#endif
#endif
/* Read/Peek a record from an unseekable device