summaryrefslogtreecommitdiff
path: root/nt/inc/sys
Commit message (Collapse)AuthorAgeFilesLines
* Fix the MinGW build as followup to recent "nofollow" changesEli Zaretskii2020-03-081-0/+5
| | | | | | | | | | | | | | | | | | | | * src/w32.c (fdutimens): Call utimensat instead of utime. (set_file_times): Function deleted. (convert_from_timespec): Renamed from convert_from_time_t and modified to accept 'struct timespec' argument instead of 'time_t'. (utimensat): Renamed from utime and modified to accept 'struct timespec [2]' argument and an additional argument FLAG. Emulate Posix 'utimensat'. Call 'convert_from_timespec'. (w32_copy_file): Call 'utimensat' instead of 'set_file_times'. * src/fileio.c (Fcopy_file) [WINDOWSNT]: Make the error message be identical to that on Posix platforms. * nt/inc/sys/stat.h (utimensat): Provide prototype. * nt/mingw-cfg.site (ac_cv_func_futimens) (gl_cv_func_futimens_works, ac_cv_func_utimensat) (gl_cv_func_utimensat_works): Override Gnulib tests. * nt/gnulib-cfg.mk (OMIT_GNULIB_MODULE_futimens) (OMIT_GNULIB_MODULE_utimensat): Disable these Gnulib modules.
* Update copyright year to 2020Paul Eggert2020-01-014-4/+4
| | | | Run "TZ=UTC0 admin/update-copyright $(git ls-files)".
* Extend network-interface-list to return IPv6 and network infoRobert Pluim2019-11-261-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | Bug#38218 * src/process.c (Fnetwork_interface_list): Extend argument list to allow requesting full network info and/or IPv4/IPv6 info. (network_interface_list) [HAVE_GETIFADDRS]: Use getifaddrs to retrieve interface IP addresses. * src/process.h: Update prototype of network_interface_list. * src/w32.c (g_b_init_get_adapters_addresses): New init flag. (globals_of_w32): Initialize it. (GetAdaptersAddresses_Proc): New function typedef. (get_adapters_addresses): New wrapper function. (init_winsock): Load htonl and ntohl. (sys_htonl, sys_ntohl): New wrapper functions. (network_interface_list): Implement in terms of get_adapters_addresses. * nt/inc/sys/socket.h: Add sys_htonl and sys_ntohl prototypes. * etc/NEWS: Announce IPv4/IPv6 changes in network-interface-list. * doc/lispref/processes.texi (Misc Network): Document updated arglist and return values for network-interface-list.
* Update copyright year to 2019Paul Eggert2019-01-014-4/+4
| | | | Run 'TZ=UTC0 admin/update-copyright $(git ls-files)'.
* ; Fix last change: only MinGW runtime 5.0.2 and later needs that.Eli Zaretskii2018-07-281-1/+1
|
* Fix compilation with mingw.org's MinGW 5.x headersEli Zaretskii2018-07-281-0/+5
|
* Update copyright year to 2018Paul Eggert2018-01-014-4/+4
| | | | Run admin/update-copyright.
* Prefer HTTPS to HTTP for gnu.orgPaul Eggert2017-09-294-4/+4
| | | | | This catches some URLs I missed in my previous scan, or perhaps were added after the scan.
* Remove unneeded stuff from nt/inc/sys/time.hEli Zaretskii2017-05-151-23/+1
| | | | | | | | * nt/inc/sys/time.h (_TIMEVAL_DEFINED, struct timevat, timerisset) (timercmp, timerclear): Don't define. Instead, include the system header sys/time.h, and add only the interval timers stuff. This avoids compiler warnings about 'gettimeofday's prototype, and also avoids redefinition of macros from system headers.
* Remove gettimeofday from w32 sourcesEli Zaretskii2017-05-141-19/+0
| | | | | | * lib-src/ntlib.c (gettimeofday): * nt/inc/sys/time.h (gettimeofday, struct timezone): Remove unused function 'gettimeofday' and all of its supporting code.
* Fix the MS-Windows buildEli Zaretskii2017-05-141-1/+1
| | | | | * nt/inc/sys/time.h (gettimeofday): * src/w32.c (gettimeofday): Adjust signature to match Gnulib.
* Update copyright year to 2017 in masterPaul Eggert2017-01-011-1/+1
| | | | | | Run admin/update-copyright in the master branch. This fixes files that were not already fixed in the emacs-25 branch before it was merged here.
* Merge from origin/emacs-25Paul Eggert2017-01-013-3/+3
|\ | | | | | | | | 2e2a806 Fix copyright years by hand 5badc81 Update copyright year to 2017
| * Update copyright year to 2017Paul Eggert2016-12-313-3/+3
| | | | | | | | Run admin/update-copyright.
| * Fix compilation with MinGW runtime 3.22.2 and w32api 3.18.2Eli Zaretskii2016-10-061-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * nt/inc/ms-w32.h (_WIN32_WINNT) [!MINGW_W64]: Undefine before defining to avoid redefinition warnings. * nt/inc/sys/stat.h (_SYS_STAT_H, _INC_STAT_H): Define, to avoid inclusion of sys/stat.h from the system headers, which could then lead to compilation errors due to redefinition of 'struct stat' etc. This is needed because latest versions of MinGW runtime include sys/stat.h from wchar.h. * src/image.c (__MINGW_MAJOR_VERSION) [WINDOWSNT]: Temporarily redefine to 4 to avoid conflict between 2 definitions of MemoryBarrier. (Bug#24613) Do not merge to master!
* | Merge branch 'concurrency'Eli Zaretskii2016-12-041-0/+1
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts (resolved): configure.ac src/Makefile.in src/alloc.c src/bytecode.c src/emacs.c src/eval.c src/lisp.h src/process.c src/regex.c src/regex.h
| * | Fix the MS-Windows buildEli Zaretskii2015-11-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/thread.h [WINDOWSNT]: Include sys/socket.h. * src/sysselect.h: Don't define fd_set and FD_* macros for MS-Windows here. * src/w32.h: Define them here. * src/process.h (sys_select): Declare prototype. * src/sysdep.c: * src/process.c: * src/filelock.c: * src/emacs.c: * src/callproc.c: Move inclusion of sys/select.h after lisp.h. * nt/inc/socket.h: Include w32.h instead of sysselect.h
| * | merge from trunkKen Raeburn2015-11-014-3/+41
| |\ \
| * | | Fix MS-Windows build.Eli Zaretskii2013-08-261-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | src/callproc.c: src/emacs.c: src/filelock.c: src/process.c: src/sysdep.c: src/w32.c: Reshuffle Windows-specific headers to avoid errors with redefinition of fd_set etc. src/process.c: Don't use num_pending_connects when NON_BLOCKING_CONNECT is not defined. src/sysselect.h: Move definitions of FD_* macros and of SELECT_TYPE here from w32.h. src/w32proc.c (sys_select): Adjust the argument types to what thread.h expects. nt/inc/sys/socket.h: Include stdint.h. Include sysselect.h instead of w32.h.
* | | | Implement getrlimit and setrlimit for MS-WindowsEli Zaretskii2016-11-191-0/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/w32heap.c (getrlimit, setrlimit): New functions. Include w32.h. * src/emacs.c (main): Use 'rlim_t', not 'long', for values that should be compatible with 'struct rlimit' members. * nt/inc/sys/resource.h: New header file. * nt/mingw-cfg.site (ac_cv_func_getrlimit, ac_cv_func_setrlimit): Set to "yes".
* | | | Fix compilation with MinGW runtime 3.22.2 and w32api 3.18.2Eli Zaretskii2016-10-061-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * nt/inc/ms-w32.h (_WIN32_WINNT) [!MINGW_W64]: Undefine before defining to avoid redefinition warnings. * nt/inc/sys/stat.h (_SYS_STAT_H, _INC_STAT_H): Define, to avoid inclusion of sys/stat.h from the system headers, which could then lead to compilation errors due to redefinition of 'struct stat' etc. This is needed because latest versions of MinGW runtime include sys/stat.h from wchar.h. * src/image.c (__MINGW_MAJOR_VERSION) [WINDOWSNT]: Temporarily redefine to 4 to avoid conflict between 2 definitions of MemoryBarrier. (Bug#24613)
* | | | Merge from origin/emacs-25John Wiegley2016-03-113-6/+6
|\ \ \ \ | | |_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | facb5e2 Update Emacs manual section related to character folding 4efea8e ; * etc/DEBUG: Fix a typo. (Bug#22984) f8df21b Update admin/notes/unicode 950be68 Add symref-filepattern entries for c?perl-mode 8b8a6ad Don't use XRANDR 1.3 extensions if the server doesn't support them. 985dacf ; NEWS update for the last change in etags 741a6f8 Sync with gnulib 7352c6c Rework C source files to avoid ^( a589e9a By default, etags produces unqualified Perl tag names 72c7438 Indent methods with keyword names correctly 28532a9 Propertize character literals and special global variables differently a7d6f39 ; Fix last change in NEWS 83b2a20 Change how /etc/NEWS presents character folding b417c5a Revert "Revert "Backport: * lisp/isearch.el: Turn char-folding off by default"" 711ca36 Properly handle lambda as read function (bug 22961) 1b9d616 Propertize operator symbol names with symbol syntax class 9b16bc2 Stop recognizing :#{} as symbol in ruby-mode 366ec77 Allow using the left shift operator without spaces on both sides 02bf7cc Properly handle unquoting in wdired (bug 22938) 16cf469 ; Spelling fix and tighten up comment f50bc04 Allow splat operator before percent literal 991c801 Don't apply the return value of goto-char as syntax class 6e63b3e Guard against nested percent literals 066f3bc Recognize iuwu-mod after an escaped newline 6f7a57c Fix symbolic mode string conversion for s and t 50b9826 Update 'ucs-names' database 993b2fb Improve doc string of 'shell-command' b71c717 Make the code in movemail_strftime more general cc057e4 Speed up redisplay of binary files with long series of nulls e51b27e Remove the highlighting support for quoting 'like this' inside Lisp docstrings b1abce1 Restore leading space in movemail pop output 98b8d44 Fix bidi-paragraph-direction in Rmail view buffer dc9d837 Don't misindent computed property generator methods 7923112 Fix mbox files produced by movemail on MS-Windows c45a1ca doc string file descriptor exhaustion fix 265141b Fix Bug#22814
| * | | Rework C source files to avoid ^(Paul Eggert2016-03-103-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Work around Bug#22884 by rewording comments and strings to avoid ‘(’ at the start of a line unless it starts a function. This change is a short-term hack; in the longer run we plan to fix cc-mode’s performance for C files that have ‘(’ at the start of a line in a comment or string.
* | | | Implement getaddrinfo fallback for MS-WindowsEli Zaretskii2016-03-051-0/+5
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | See http://lists.gnu.org/archive/html/emacs-devel/2016-02/msg01602.html for more details. * nt/mingw-cfg.site (ac_cv_func_getaddrinfo) (ac_cv_func_gai_strerror): Set to "yes", as the configure script's test program is not smart enough to auto-detect these. * nt/inc/sys/socket.h (getaddrinfo, freeaddrinfo): Redirect to sys_getaddrinfo and sys_freeaddrinfo. Provide prototypes for sys_getaddrinfo and sys_freeaddrinfo. * src/w32.c (init_winsock): Try loading getaddrinfo and freeaddrinfo from ws2_32.dll. (sys_getaddrinfo, sys_freeaddrinfo): New functions. * lib-src/pop.c [WINDOWSNT]: Include winsock2.h, not winsock.h, and also ws2tcpip.h. (getaddrinfo, freeaddrinfo) [WINDOWSNT]: Redirect to sys_getaddrinfo and sys_freeaddrinfo, respectively. (load_ws2, sys_getaddrinfo, sys_freeaddrinfo) [WINDOWSNT]: New functions.
* | | Update copyright year to 2016Paul Eggert2016-01-013-3/+3
| |/ |/| | | | | Run admin/update-copyright.
* | Update copyright year to 2015Paul Eggert2015-01-013-3/+3
| | | | | | | | Run admin/update-copyright.
* | Use mmap(2) emulation for buffer text on MS-Windows.Fabrice Popineau2014-05-271-0/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | src/Makefile.in (C_HEAP_SWITCH): Get the predefined heap size from configure. (ADDSECTION, MINGW_TEMACS_POST_LINK): Remove, no longer used. src/lisp.h (NONPOINTER_BITS): Modify the condition to define to zero for MinGW, since it no longer uses gmalloc. src/buffer.c: Do not define mmap allocations functions for Windows. Remove mmap_find which is unused. Remove mmap_set_vars which does nothing useful. [WINDOWSNT]: Include w32heap.h. (init_buffer): Always allocate new memory for buffers. src/emacs.c: Remove mmap_set_vars calls. src/image.c (free_image): Undef free for Windows because it is redirected to our private version. src/unexw32.c (COPY_PROC_CHUNK): Use %p format for 64bits compatibility. (copy_executable_and_dump_data): Remove dumping the heap section. (unexec): Restore using_dynamic_heap after dumping. src/w32heap.c (dumped_data_commit, malloc_after_dump) (malloc_before_dump, realloc_after_dump, realloc_before_dump) (free_after_dump, free_before_dump, mmap_alloc, mmap_realloc) (mmap_free): New functions. src/w32heap.h: Declare dumped_data and mmap_* function prototypes. nt/inc/ms-w32.h: Switch to the system heap allocation scheme instead of GNU malloc and ralloc. nt/inc/sys/mman.h: New file. nt/INSTALL: Update for the new build requirements. etc/NEWS: Mention build changes on MS-Windows. configure.ac (C_HEAP_SWITCH) define for different values of dumped heap size depending on 32/64bits arch on Windows. Don't check for pthreads.h on MinGW32/64, it gets in the way. Use mmap(2) for buffers and system malloc for MinGW32/64.
* | Fix MS-Windows build with MinGW runtime 4.x.Claudio Bley2014-01-111-0/+7
| | | | | | | | | | nt/inc/sys/stat.h (_WSTAT_DEFINED): Define, to avoid compilation failures when wchar.h is included.
* | Update copyright year to 2014 by running admin/update-copyright.Paul Eggert2014-01-013-3/+3
|/
* MS-Windows followup for 2013-07-07T18:00:14Z!eggert@cs.ucla.edu.Eli Zaretskii2013-07-071-0/+4
| | | | | | | | | | | nt/inc/sys/socket.h (F_SETFD, O_CLOEXEC, F_DUPFD_CLOEXEC) (FD_CLOEXEC): New macros. src/w32.c (sys_dup): Declare prototype. src/filelock.c: src/emacs.c: src/callproc.c [WINDOWSNT]: Include sys/socket.h.
* Attempt to resolve gettimeofday compilation errors with MinGW64.Eli Zaretskii2013-06-031-2/+0
| | | | | | | src/w32.c (gettimeofday): Make the signature identical to prototype in nt/inc/sys/time.h. nt/inc/sys/time.h (struct timeval): Remove the _W64 guards.
* Fix compilation error on MinGW64 due to nt/inc/sys/time.h.Eli Zaretskii2013-06-011-0/+1
| | | | | nt/inc/sys/time.h [!_TIMEZONE_DEFINED]: Define _TIMEZONE_DEFINED to avoid multiple definition errors on MinGW64.
* Fix compile errors in nt/inc/sys/time.h when using nt/configure.bat.Eli Zaretskii2013-05-311-3/+8
| | | | | | | | nt/inc/sys/time.h (gettimeofday): Use '__restrict' instead of 'restrict', which is a C99 extension. See http://lists.gnu.org/archive/html/emacs-devel/2013-05/msg00588.html and the following discussion for the problem this caused in the old nt/configure.bat build.
* Fixed misc compilation warnings and errors. Dumping errors out.Eli Zaretskii2013-04-011-0/+33
|
* Fixed compilation problems in lib/.Eli Zaretskii2013-03-301-0/+3
|
* Use 'restrict' in gettimeofday arguments, and make ms-w32.h compatible.Eli Zaretskii2013-03-281-2/+3
|
* Fix the gettimeofday_timezone test.Eli Zaretskii2013-03-281-1/+3
|
* Merge from trunk and resolve conflicts.Eli Zaretskii2013-03-285-8/+45
|\
| * Fix more MinGW64 incompatibilities.Eli Zaretskii2013-03-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Reported by ׃scar Fuentes in http://lists.gnu.org/archive/html/emacs-devel/2013-03/msg00733.html nt/inc/ms-w32.h (_WIN32_WINNT) [!_W64]: Don't define for MinGW64. nt/inc/sys/stat.h (chmod): Remove _CRTIMP from prototype. src/w32.c (_PROCESS_MEMORY_COUNTERS_EX) [_WIN32_WINNT < 0x0500]: Define only for _WIN32_WINNT less than 0x0500.
| * Fix more incompatibilities between MinGW.org and MinGW64 headersEli Zaretskii2013-03-262-8/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reported by ׃scar Fuentes in http://lists.gnu.org/archive/html/emacs-devel/2013-03/msg00699.html and in http://lists.gnu.org/archive/html/emacs-devel/2013-03/msg00707.html. nt/inc/ms-w32.h (USE_NO_MINGW_SETJMP_TWO_ARGS) [_W64]: Define to 1. For MinGW64, include sys/types.h and time.h. nt/inc/sys/time.h (struct timeval) [!_W64]: Guard definition with _W64. (struct timezone) [!_TIMEZONE_DEFINED]: Guard definition with _TIMEZONE_DEFINED. nt/addpm.c (_WIN32_IE) [_W64]: For MinGW64, don't define to 0x400. nt/inc/sys/stat.h: Remove _CRTIMP from prototypes of fstat, stat, lstat, and fstatat. lib-src/ntlib.c (struct timespec) [!_TIMEZONE_DEFINED]: Define the struct only if _TIMEZONE_DEFINED is not defined. src/w32term.c (WCRANGE, GLYPHSET): Don't define if _W64 is defined. src/w32.c (REPARSE_DATA_BUFFER): Guard with MAXIMUM_REPARSE_DATA_BUFFER_SIZE being defined.
| * Fix incompatibilities between MinGW.org and MinGW64 headersEli Zaretskii2013-03-251-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problems were reported by ׃scar Fuentes in http://lists.gnu.org/archive/html/emacs-devel/2013-03/msg00611.html. nt/inc/ms-w32.h (struct timespec): Don't define if _TIMESPEC_DEFINED is already defined. (sigset_t) [!_POSIX]: Typedef for MinGW64. (_WIN32_WINNT, WIN32_LEAN_AND_MEAN): Move definitions before including the first system header, to avoid redefinition if some system header defines a default value. nt/inc/sys/time.h (struct itimerval): Don't define if _TIMESPEC_DEFINED is already defined.
| * Use fdopendir, fstatat and readlinkat, for efficiency.Paul Eggert2013-01-311-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On my host, this speeds up directory-files-and-attributes by a factor of 3, when applied to Emacs's src directory. These functions are standardized by POSIX and are common these days; fall back on a (slower) gnulib implementation if the host is too old to supply them. * .bzrignore: Add lib/dirent.h. * lib/Makefile.am (libgnu_a_SOURCES): Add openat-die.c, save-cwd.c. * lib/careadlinkat.c, lib/careadlinkat.h: Merge from gnulib, incorporating: 2013-01-29 careadlinkat: do not provide careadlinkatcwd. * lib/gnulib.mk, m4/gnulib-comp.m4: Regenerate. * lib/dirent.in.h, lib/fdopendir.c, lib/fstatat.c, lib/openat-priv.h: * lib/openat-proc.c, lib/openat.h, m4/dirent_h.m4, m4/fdopendir.m4: * m4/fstatat.m4: New files, from gnulib. * lib/openat-die.c, lib/save-cwd.c, lib/save-cwd.h: New files. These last three are specific to Emacs and are not copied from gnulib. They are simpler than the gnulib versions and are tuned for Emacs. * admin/merge-gnulib (GNULIB_MODULES): Add fdopendir, fstatat, readlinkat. (GNULIB_TOOL_FLAGS): Do not avoid at-internal, openat-h. Avoid dup, open, opendir. * nt/inc/sys/stat.h (fstatat): * nt/inc/unistd.h (readlinkat): New decls. * src/conf_post.h (GNULIB_SUPPORT_ONLY_AT_FDCWD): Remove. * src/dired.c: Include <fcntl.h>. (open_directory): New function, which uses open and fdopendir rather than opendir. DOS_NT platforms still use opendir, though. (directory_files_internal, file_name_completion): Use it. (file_attributes): New function, with most of the old Ffile_attributes. (directory_files_internal, Ffile_attributes): Use it. (file_attributes, file_name_completion_stat): First arg is now fd, not dir name. All uses changed. Use fstatat rather than lstat + stat. (file_attributes): Use emacs_readlinkat rather than Ffile_symlink_p. * src/fileio.c: Include <allocator.h>, <careadlinkat.h>. (emacs_readlinkat): New function, with much of the old Ffile_symlink_p, but with an fd argument for speed. It uses readlinkat rather than careadlinkatcwd, so that it need not assume the working directory. (Ffile_symlink_p): Use it. * src/filelock.c (current_lock_owner): Use emacs_readlinkat rather than emacs_readlink. * src/lisp.h (emacs_readlinkat): New decl. (READLINK_BUFSIZE, emacs_readlink): Remove. * src/sysdep.c: Do not include <allocator.h>, <careadlinkat.h>. (emacs_norealloc_allocator, emacs_readlink): Remove. This stuff is moved to fileio.c. * src/w32.c (fstatat, readlinkat): New functions. (careadlinkat): Don't check that fd == AT_FDCWD. (careadlinkatcwd): Remove; no longer needed. Fixes: debbugs:13539
| * Update copyright dates to 2013.Paul Eggert2013-01-021-1/+1
| |
| * Merge from emacs-24; up to 2012-12-06T01:39:03Z!monnier@iro.umontreal.caPaul Eggert2013-01-022-2/+2
| |\
| | * Update copyright notices for 2013.Paul Eggert2013-01-012-2/+2
| | |
| | * Revert recent change for Bug#8855.Paul Eggert2012-11-241-33/+0
| | | | | | | | | | | | | | | | | | | | | | | | As reported by Harald Hanche-Olsen in <http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00445.html> the change introduces a further bug, of creating lots of zombie processes in some cases. Further work is needed to come up with a better fix for Bug#8855.
| | * Fix a race condition with glib (Bug#8855).Paul Eggert2012-11-231-0/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a backport from the trunk, consisting of: 2012-11-17 Eli Zaretskii <eliz@gnu.org> * nt/inc/sys/wait.h: New file, with prototype of waitpid and definitions of macros it needs. * nt/inc/ms-w32.h (wait): Don't define, 'wait' is not used anymore. (sys_wait): Remove prototype. * nt/config.nt (HAVE_SYS_WAIT_H): Define to 1. * src/w32proc.c (create_child): Don't clip the PID of the child process to fit into an Emacs integer, as this is no longer a restriction. (waitpid): Rename from sys_wait. Emulate a Posix 'waitpid' by reaping only the process specified by PID argument, if that is positive. Use PID instead of dead_child to know which process to reap. Wait for the child to die only if WNOHANG is not in OPTIONS. (sys_select): Don't set dead_child. * src/sysdep.c (wait_for_termination_1): Remove the WINDOWSNT portion, as it is no longer needed. * src/process.c (waitpid, WUNTRACED) [!WNOHANG]: Remove definitions, no longer needed. (record_child_status_change): Remove the setting of record_at_most_one_child for the !WNOHANG case. 2012-11-03 Paul Eggert <eggert@cs.ucla.edu> Fix a race condition that causes Emacs to mess up glib (Bug#8855). This is a backport from the trunk. The symptom is a diagnostic "GLib-WARNING **: In call to g_spawn_sync(), exit status of a child process was requested but SIGCHLD action was set to SIG_IGN and ECHILD was received by waitpid(), so exit status can't be returned." The diagnostic is partly wrong, as the SIGCHLD action is not set to SIG_IGN. The real bug is a race condition between Emacs and glib: Emacs does a waitpid (-1, ...) and reaps glib's subprocess by mistake, so that glib can't find it. Work around the bug by invoking waitpid only on subprocesses that Emacs itself creates. * src/process.c (create_process, record_child_status_change): Don't use special value -1 in pid field, as the caller now must know the pid rather than having the callee infer it. The inference was sometimes incorrect anyway, due to another race. (create_process): Set new 'alive' member if child is created. (process_status_retrieved): New function. (record_child_status_change): Use it. Accept negative 1st argument, which means to wait for the processes that Emacs already knows about. Move special-case code for DOS_NT (which lacks WNOHANG) here, from caller. Keep track of processes that have already been waited for, by testing and clearing new 'alive' member. (CAN_HANDLE_MULTIPLE_CHILDREN): Remove, as record_child_status_change now does this internally. (handle_child_signal): Let record_child_status_change do all the work, since we do not want to reap all exited child processes, only the child processes that Emacs itself created. * src/process.h (Lisp_Process): New boolean member 'alive'.
| * | Fix the MS-Windows build.Eli Zaretskii2012-12-241-0/+1
| | | | | | | | | | | | | | | | | | nt/inc/sys/stat.h (S_ISMPX): Define to zero, to accommodate changes in lib/filemode.c that broke the MS-Windows build. Suggested by Andy Moreton <andrewjmoreton@gmail.com>.
| * | Support Posix ACL APIs on MS-Windows.Eli Zaretskii2012-12-171-0/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | src/w32.c: Include sddl.h and sys/acl.h. (SDDL_REVISION_1): Define if not already defined. (g_b_init_get_security_descriptor_dacl) (g_b_init_convert_sd_to_sddl, g_b_init_convert_sddl_to_sd) (g_b_init_is_valid_security_descriptor) (g_b_init_set_file_security): New static flags. (globals_of_w32): Initialize them to zero. (SetFileSecurity_Name): New string constant. (SetFileSecurity_Proc, GetSecurityDescriptorDacl_Proc) (ConvertStringSecurityDescriptorToSecurityDescriptor_Proc) (ConvertSecurityDescriptorToStringSecurityDescriptor_Proc) (IsValidSecurityDescriptor_Proc): New typedefs. (get_file_security, get_security_descriptor_owner) (get_security_descriptor_group): Set errno to ENOTSUP. (set_file_security, get_security_descriptor_dacl) (is_valid_security_descriptor, convert_sd_to_sddl) (convert_sddl_to_sd, acl_valid, acl_to_text, acl_from_text) (acl_free, acl_get_file, acl_set_file): New functions. src/fileio.c (Fcopy_file) [WINDOWSNT]: Support copying ACLs. nt/inc/sys/acl.h: New file. nt/inc/ms-w32.h (ENOTSUP): Define if undefined. nt/config.nt (HAVE_POSIX_ACL): Define. doc/lispref/files.texi (File Attributes, Changing Files): Update to include MS-Windows support for ACLs.
| * | Speed up most calls to 'stat' and 'lstat' on MS-Windows.Eli Zaretskii2012-12-141-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | src/w32.c (stat_worker): If w32_stat_get_owner_group is zero, do not try to get accurate owner and group information from NT file security APIs. This is to make most callers of 'stat' and 'lstat', which don't need that information, much faster. src/dired.c (Ffile_attributes) [WINDOWSNT]: Set w32_stat_get_owner_group to a non-zero value, to request accurate owner and group information from 'lstat'. nt/inc/sys/stat.h: Declare w32_stat_get_owner_group.