aboutsummaryrefslogtreecommitdiffstats
path: root/nt
diff options
context:
space:
mode:
authorPaul Eggert2012-11-17 14:12:47 -0800
committerPaul Eggert2012-11-17 14:12:47 -0800
commit49cdacdad393e2b9282a19a963030dfbe1a738ab (patch)
tree40b11ac721a6a64102dae1a4f227fbc4d1eff0bc /nt
parent310e60d9454fe2d7e6920cf51f20d438e57f7b28 (diff)
downloademacs-49cdacdad393e2b9282a19a963030dfbe1a738ab.tar.gz
emacs-49cdacdad393e2b9282a19a963030dfbe1a738ab.zip
Assume POSIX 1003.1-1988 or later for fcntl.h.
* admin/CPP-DEFINES (O_RDONLY, O_RDWR, HAVE_FCNTL_H): Remove. * admin/merge-gnulib (GNULIB_MODULES): Add fcntl-h. * configure.ac: Do not check for fcntl.h. * lib/gnulib.mk: Regenerate. * lib-src/movemail.c, lib-src/update-game-score.c: Assume <fcntl.h> exists. * nt/inc/sys/socket.h (O_NONBLOCK): Rename from O_NDELAY, since the POSIX name for this flag is O_NONBLOCK. All uses changed. * nt/inc/unistd.h (O_RDWR, O_NOCTTY): New macros. Like AT_FDCWD etc. these really should be moved to a replacement <fcntl.h> if and when that gets implemented. In the meantime, include <fcntl.h> to make sure we don't override its definitions. * src/callproc.c (relocate_fd): Assume F_DUPFD. * src/emacs.c, src/term.c (O_RDWR): Remove. * src/keyboard.c (tty_read_avail_input): Use O_NONBLOCK rather than O_NDELAY, since O_NONBLOCK is the standard name for this flag. * src/nsterm.m: Assume <fcntl.h> exists. * src/process.c (NON_BLOCKING_CONNECT, allocate_pty, create_process) (create_pty, Fmake_network_process, server_accept_connection) (wait_reading_process_output, init_process_emacs): Assume O_NONBLOCK. (wait_reading_process_output): Put in a special case for WINDOWSNT to mimick the older behavior where it had O_NDELAY but not O_NONBLOCK. It's not clear this is needed, but it's a more-conservative change. (create_process): Assume FD_CLOEXEC. (create_process, create_pty): Assume O_NOCTTY. * src/sysdep.c (init_sys_modes, reset_sys_modes): Assume F_SETFL. (reset_sys_modes): Use O_NONBLOCK rather than O_NDELAY. Omit if not DOS_NT, since F_GETFL is not defined there. (serial_open): Assume O_NONBLOCK and O_NOCTTY. * src/term.c: Include <fcntl.h>, for flags like O_NOCTTY. (O_NOCTTY): Remove. (init_tty): Assume O_IGNORE_CTTY is defined to 0 on platforms that lack it, since gnulib guarantees this. * src/w32.c (fcntl): Test for O_NONBLOCK rather than O_NDELAY. Fixes: debbugs:12881
Diffstat (limited to 'nt')
-rw-r--r--nt/ChangeLog10
-rw-r--r--nt/inc/sys/socket.h2
-rw-r--r--nt/inc/unistd.h13
3 files changed, 24 insertions, 1 deletions
diff --git a/nt/ChangeLog b/nt/ChangeLog
index b24acae8be5..910ef2170c6 100644
--- a/nt/ChangeLog
+++ b/nt/ChangeLog
@@ -1,3 +1,13 @@
12012-11-17 Paul Eggert <eggert@cs.ucla.edu>
2
3 Assume POSIX 1003.1-1988 or later for fcntl.h (Bug#12881).
4 * inc/sys/socket.h (O_NONBLOCK): Rename from O_NDELAY, since the
5 POSIX name for this flag is O_NONBLOCK. All uses changed.
6 * inc/unistd.h (O_RDWR, O_NOCTTY): New macros. Like AT_FDCWD etc.
7 these really should be moved to a replacement <fcntl.h> if and
8 when that gets implemented. In the meantime, include <fcntl.h>
9 to make sure we don't override its definitions.
10
12012-11-17 Eli Zaretskii <eliz@gnu.org> 112012-11-17 Eli Zaretskii <eliz@gnu.org>
2 12
3 * inc/sys/wait.h: New file, with prototype of waitpid and 13 * inc/sys/wait.h: New file, with prototype of waitpid and
diff --git a/nt/inc/sys/socket.h b/nt/inc/sys/socket.h
index 70225a9c82f..95fee4c4659 100644
--- a/nt/inc/sys/socket.h
+++ b/nt/inc/sys/socket.h
@@ -119,7 +119,7 @@ int sys_sendto (int s, const char * buf, int len, int flags,
119 an fcntl function, for setting sockets to non-blocking mode. */ 119 an fcntl function, for setting sockets to non-blocking mode. */
120int fcntl (int s, int cmd, int options); 120int fcntl (int s, int cmd, int options);
121#define F_SETFL 4 121#define F_SETFL 4
122#define O_NDELAY 04000 122#define O_NONBLOCK 04000
123 123
124/* we are providing a real h_errno variable */ 124/* we are providing a real h_errno variable */
125#undef h_errno 125#undef h_errno
diff --git a/nt/inc/unistd.h b/nt/inc/unistd.h
index b0f3092cafb..0173fdbb943 100644
--- a/nt/inc/unistd.h
+++ b/nt/inc/unistd.h
@@ -26,4 +26,17 @@ extern int faccessat (int, char const *, int, int);
26#define AT_EACCESS 4 26#define AT_EACCESS 4
27#define AT_SYMLINK_NOFOLLOW 4096 27#define AT_SYMLINK_NOFOLLOW 4096
28 28
29/* Here are some more fcntl.h macros that default to gnulib-compatible
30 values. Include <fcntl.h> first, to make sure we don't override
31 its values if any. FIXME: If we know <fcntl.h> does not define
32 O_NOCTTY and O_RDWR, this can be replaced with a simple "#define
33 O_NOCTTY 0" and "#define O_RDWR 2". */
34#include <fcntl.h>
35#ifndef O_NOCTTY
36#define O_NOCTTY 0
37#endif
38#ifndef O_RDWR
39#define O_RDWR 2
40#endif
41
29#endif /* _UNISTD_H */ 42#endif /* _UNISTD_H */