1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-06 06:20:55 -08:00

[!WINDOWSNT]: Include <fcntl.h> if available.

(set_tcp_socket): Prefer O_NONBLOCK, then O_NDELAY, then FIONBIO to set the
socket in non-blocking mode.
This commit is contained in:
Juanma Barranquero 2006-10-31 13:52:32 +00:00
parent d4fa60c883
commit 95d0feaa4a
2 changed files with 17 additions and 0 deletions

View file

@ -38,6 +38,9 @@ Boston, MA 02110-1301, USA. */
# define INITIALIZE() (initialize_sockets ())
typedef unsigned long IOCTL_BOOL_ARG;
#else
#ifdef HAVE_FCNTL_H
# include <fcntl.h>
#endif
# include <netinet/in.h>
# include <sys/ioctl.h>
# define INVALID_SOCKET -1
@ -486,7 +489,15 @@ set_tcp_socket ()
return INVALID_SOCKET;
}
#ifdef O_NONBLOCK
IOCTL (s, O_NONBLOCK, &c_arg);
#else
#ifdef O_NDELAY
IOCTL (s, O_NDELAY, &c_arg);
#else
IOCTL (s, FIONBIO, &c_arg);
#endif
#endif
setsockopt (s, SOL_SOCKET, SO_LINGER, (char *) &l_arg, sizeof l_arg);
/*