1. 23 Aug, 2020 1 commit
    • Paul Eggert's avatar
      Simplify by using Gnulib sigdescr_np module · df589d36
      Paul Eggert authored
      Inspired by a straightforward patch by Bruno Haible.
      * admin/merge-gnulib (GNULIB_MODULES): Add sigdescr_np.
      * configure.ac: Do not check for sys_siglist or __sys_siglist.
      * lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
      * lib/sigdescr_np.c, m4/sigdescr_np.m4: New files, copied from Gnulib.
      * src/sysdep.c (sys_siglist, sys_siglist_entries): Remove.
      (init_signals): Do not initialize sys_siglist.
      (safe_strsignal): Use sigdescr_np instead of sys_siglist.
      df589d36
  2. 01 Jan, 2020 1 commit
    • Paul Eggert's avatar
      Assume C99-style ‘long long’ · 12d004d6
      Paul Eggert authored
      Now that Gnulib assumes ‘long long’, it is a good time to clean
      out old cruft porting to pre-C99 compilers that lack it.
      * src/data.c (ULL_WIDTH, ULL_MAX): Remove.
      All uses replaced by ULLONG_WIDTH, ULLONG_MAX.
      (bits_word_to_host_endian): Assume ‘unsigned long long’.
      By the way, the old code had a performance typo: it used
      HAVE_UNSIGNED_LONG_LONG where it should have used
      HAVE_UNSIGNED_LONG_LONG_INT.
      * src/sysdep.c (ULLONG_MAX): Remove, as lib/limits.h does this now.
      (time_from_jiffies) [GNU_LINUX]: Assume ‘long long’.
      12d004d6
  3. 02 Feb, 2019 1 commit
    • Paul Eggert's avatar
      Update from Gnulib · adc31c6b
      Paul Eggert authored
      This incorporates:
      2019-02-02 dtoastr, ftoastr, ldtoastr: port to c-strtod changes
      2019-02-01 c-strtod, c-strtold: use the bug fixes
      2019-01-30 strtold: New module
      * doc/misc/texinfo.tex, lib/ftoastr.c, lib/regexec.c, lib/stdlib.in.h:
      * m4/stdlib_h.m4:
      Copy from Gnulib.
      * lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
      * m4/c-strtod.m4: Remove.
      adc31c6b
  4. 26 Nov, 2018 1 commit
    • Paul Eggert's avatar
      emacsclient: assume HAVE_INET_SOCKETS · ed3ae3fc
      Paul Eggert authored
      * configure.ac (HAVE_INET_SOCKETS): Remove.
      * lib-src/emacsclient.c: Simplify by assuming HAVE_SOCKETS and
      HAVE_INET_SOCKETS, which are always true nowadays, except perhaps
      for MS-DOS and if so this program shouldn’t be built there anyway.
      Don’t bother including sys/types.h, as it’s not needed on modern
      systems (and syswait.h does it for us anyway).
      (main): Simplify by assuming SIGSTOP (which is always defined
      if SIGCONT is), and by assuming HAVE_SOCKETS && HAVE_INET_SOCKETS.
      ed3ae3fc
  5. 13 Nov, 2017 1 commit
    • Paul Eggert's avatar
      Simplify by removing HAVE_STRUCT_ATTRIBUTE_ALIGNED · d1495609
      Paul Eggert authored
      * configure.ac (HAVE_STRUCT_ATTRIBUTE_ALIGNED): Remove.  No longer
      needed, since we no longer rely on __attribute__ ((aligned (8))).
      All uses removed.
      * src/emacs-module.c (HAVE_STRUCT_ATTRIBUTE_ALIGNED): Remove.
      (lisp_to_value): Simplify now that we no longer need to worry
      whether HAVE_STRUCT_ATTRIBUTE_ALIGNED is false.
      d1495609
  6. 03 Nov, 2017 1 commit
    • Paul Eggert's avatar
      Simplify by assuming !_MSC_VER. · 5b4ff53a
      Paul Eggert authored
      Emacs has not been portable to MSVC for some time (Bug#29040#57).
      * admin/CPP-DEFINES (_MSC_VER): Remove.
      * src/lisp.h (ENUM_BF, DEFUN):
      * src/regex.c (re_char):
      Simplify by assuming _MSC_VER is not defined.
      * src/regex.c (const_re_char): Remove.
      All uses replaced by re_char.
      5b4ff53a
  7. 12 Aug, 2017 1 commit
    • Paul Eggert's avatar
      Improve make-temp-file performance on local files · a6ad98ad
      Paul Eggert authored
      For the motivation behind this patch, please see Bug#28023 and:
      http://emacshorrors.com/posts/make-temp-name.html
      Although, given the recent changes to Tramp, the related security
      problem in make-temp-file is already fixed, make-temp-file still has
      several unnecessary system calls.  In the typical case on GNU/Linux,
      this patch replaces 8 syscalls (symlink, open, close, readlinkat, uname,
      getpid, unlink, umask) by 2 (open, close).
      * admin/merge-gnulib (GNULIB_MODULES): Add tempname, now
      that Emacs is using it directly.
      * configure.ac (AUTO_DEPEND): Remove AC_SYS_LONG_FILE_NAMES;
      no longer needed.
      * lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
      * lisp/files.el (files--make-magic-temp-file): Rename from
      make-temp-file.
      (make-temp-file): Use make-temp-file-internal for
      non-magic file names.
      * src/fileio.c: Include tempname.h.
      (make_temp_name_tbl, make_temp_name_count)
      (make_temp_name_count_initialized_p, make_temp_name): Remove.
      (Fmake_temp_file_internal): New function.
      (Fmake_temp_name): Use it.
      * src/filelock.c (get_boot_time): Use Fmake_temp_file_internal
      instead of make_temp_name.
      a6ad98ad
  8. 07 Mar, 2017 1 commit
    • Paul Eggert's avatar
      Define copysign on all platforms · 14af3395
      Paul Eggert authored
      * configure.ac (copysign): Remove test.
      * src/floatfns.c (signbit): New macro, if not already defined.
      (Fcopysign): Use it instead of copysign.
      (Fcopysign, syms_of_floatfns): Define the function on all platforms.
      14af3395
  9. 06 Nov, 2016 1 commit
    • Paul Eggert's avatar
      Modernize usage of 'macOS' in doc and comments · dc152c54
      Paul Eggert authored
      Apple changed the spelling of its operating system again, to "macOS",
      effective with macOS 10.12 Sierra (2016-09-20).  Change Emacs
      documentation and comments to match this.  Stick with older OS
      spellings ("OS X", "Mac OS X") when talking about older releases where
      the older names are more correct.
      dc152c54
  10. 15 Jul, 2016 1 commit
    • Paul Eggert's avatar
      Port to glibc 2.24 (pre-release) + ppc64 · e95b0231
      Paul Eggert authored
      Inspired by a suggestion by Florian Weimer in:
      https://sourceware.org/ml/libc-alpha/2016-07/msg00425.html
      * configure.ac (HAVE_PERSONALITY_ADDR_NO_RANDOMIZE):
      Rename from HAVE_PERSONALITY_LINUX32, and check for
      ADDR_NO_RANDOMIZE (the crucial thing) instead of for LINUX32.
      All uses changed.
      * src/emacs.c (main) [HAVE_PERSONALITY_ADDR_NO_RANDOMIZE]:
      Use ADDR_NO_RANDOMIZE from personality.h rather than inventing the
      flag ourselves.  Just set that flag, rather than also setting the
      persona.  When doing it, avoid functions like putenv that may
      allocate memory.
      e95b0231
  11. 10 Jun, 2016 1 commit
    • Paul Eggert's avatar
      Prefer getsockopt to getpeername on non-MS-Windows · 07b77b8e
      Paul Eggert authored
      * admin/CPP-DEFINES: Remove HAVE_GETPEERNAME.
      * configure.ac: Don’t check for getpeername.
      * src/process.c (wait_reading_process_output) [!WINDOWSNT]:
      Use getsockopt even if not GNU/Linux, as the platforms where
      getsockopt used to hang are no doubt long dead.
      07b77b8e
  12. 08 Mar, 2016 1 commit
    • Paul Eggert's avatar
      Assume getaddrinfo in C code · 59c7a5d7
      Paul Eggert authored
      * admin/CPP-DEFINES, configure.ac: Remove HAVE_GETADDRINFO, HAVE_H_ERRNO.
      All uses removed.
      * doc/lispref/processes.texi (Network, Network Processes), etc/NEWS:
      Say that port numbers can be integer strings.
      * lib-src/pop.c (h_errno) [!WINDOWSNT && !HAVE_H_ERRNO]: Remove decl.
      (socket_connection): Assume HAVE_GETADDRINFO.
      * lisp/mpc.el (mpc--proc-connect):
      * lisp/net/network-stream.el (open-network-stream):
      It’s now OK to use integer strings as port numbers.
      * src/process.c (conv_numerical_to_lisp) [!HAVE_GETADDRINFO]: Remove.
      (Fmake_network_process): Assume HAVE_GETADDRINFO.
      59c7a5d7
  13. 07 Mar, 2016 1 commit
    • Paul Eggert's avatar
      Remove support for IRIX · 6bc8689c
      Paul Eggert authored
      The IRIX port wasn’t really working anyway, and the code was
      getting in the way of other changes (e.g., getaddrinfo fixes).
      IRIX’s supplier dropped support for IRIX in 2013.
      * admin/CPP-DEFINES:
      * configure.ac (opsys):
      * doc/lispref/os.texi (System Environment):
      * etc/MACHINES, etc/PROBLEMS:
      * lisp/find-dired.el (find-grep-options):
      * lisp/lpr.el (lpr-lp-system):
      * lisp/ls-lisp.el (ls-lisp-emulation):
      * lisp/mail/rmail.el (rmail-spool-directory):
      * lisp/net/net-utils.el (ping-program-options):
      * lisp/progmodes/gud.el (gud-irix-p, gud-dbx-use-stopformat-p):
      * lisp/progmodes/ps-mode.el (ps-mode-print-function):
      * src/conf_post.h [IRIX6_5]:
      * src/emacs.c (Vsystem_type):
      * src/filelock.c (get_boot_time_1):
      * src/process.c (process_send_signal):
      * src/unexelf.c (unexec):
      Omit IRIX-specific code and/or documentation.
      * configure.ac (NON_GCC_TEST_OPTIONS, IRIX6_5, PREFER_VSUSP):
      Remove.  All uses removed.
      * etc/NEWS: Document the change.
      6bc8689c
  14. 29 Feb, 2016 1 commit
    • Paul Eggert's avatar
      Stop calling res_init · 93bf7d52
      Paul Eggert authored
      Emacs shouldn’t need to call res_init any more, now that nscd or
      equivalent is everywhere.  On modern systems, calling res_init
      simply slows Emacs down.  On ancient systems lacking nscd Emacs
      will still work well enough with this change; it’s just that it
      won’t respond to changes in /etc/resolv.conf.
      * configure.ac (HAVE_RES_INIT): Remove.  Worry about -lresolv only
      when configured --with-hesiod.  Hesiod is still used; see, e.g.:
      https://soylentnews.org/meta/article.pl?sid=15/07/13/0255214
      * src/Makefile.in (LIBRESOLV): Remove.  All uses removed.
      93bf7d52
  15. 27 Mar, 2015 1 commit
  16. 17 Nov, 2014 1 commit
    • Oscar Fuentes's avatar
      Define MINGW_W64 and use it instead of _W64 · 81e0cca7
      Oscar Fuentes authored
      ... for detecting MinGW-w64. _W64 is not specific of MinGW-w64, it is
      defined for compatibility with MS VC++.
      
      	* nt/inc/ms-w32.h: Define MINGW_W64.
      
      	* admin/CPP-DEFINES: Mention MINGW_W64.
      
      	* nt/addpm.c: Use it.
      
      	* nt/addsection.c: Use it.
      
      	* nt/preprep.c: Use it.
      
      	* src/w32.c: Use MINGW_W64 instead of _W64
      
      	* src/w32term.c: Likewise.
      81e0cca7
  17. 12 Oct, 2014 1 commit
    • Paul Eggert's avatar
      Fix putenv race conditions with undefined behavior. · 4c4c5b91
      Paul Eggert authored
      Do all putenv calls before Emacs creates any threads.
      Use a safer way to modify the TZ environment variable in the
      presence of multiple threads.  For further thread-safety,
      prefer localtime_r and gmtime_r to localtime and gmtime,
      and prefer struct tm's tm_gmtoff (if available) to calling
      both localtime_r and gmtime_r.
      * configure.ac (LOCALTIME_CACHE): Remove.
      We needn't worry about SunOS 4 any more; Sun dropped support in 2003.
      All uses of LOCALTIME_CACHE removed.  This simplifies the fix.
      (tzalloc): Add check for this function.
      * admin/merge-gnulib (GNULIB_MODULES): Add time_r, since Emacs now
      calls localtime_r and gmtime_r directly.
      * src/dbusbind.c (Fdbus__init_bus): Move xputenv call from here ...
      (init_dbusbind): ... to this new function.
      * src/emacs.c (main) [HAVE_DBUS]: Call it before creating threads.
      * src/xterm.c (x_term_init): Move xputenv call from here ...
      (init_xterm): ... to this new function.
      * src/emacs.c (main) [USE_GTK]: Call it before creating threads.
      * src/editfns.c (HAVE_TM_GMTOFF): Default to false.
      (dump_tz_string): New constant.
      (init_editfns): Use it.  This centralizes the dump_tz stuff.
      Call set_time_zone_rule here, so that its xputenv is done
      before Emacs goes multithreaded.
      (mktime_z) [!HAVE_TZALLOC]: New function, which is typically
      thread-safe enough for Emacs.
      (format_time_string, Fdecode_time, Fcurrent_time_string)
      (Fcurrent_time_zone):
      Prefer localtime_r and gmtime_r, which are more thread-safe, to
      localtime and gmtime.  Remove now-unnecessary calls to block_input.
      (tm_gmtoff): New static function.
      (Fdecode_time, Fcurrent_time_zone): Use it.
      (Fencode_time): Use mktime_z, for better thread-safety.
      (set_time_zone_rule): Now static.  Rewrite to be mostly thread-safe,
      i.e., not quite thread-safe but good enough for Emacs typical usage.
      Do not reclaim storage that is in the environment; let it leak.
      Always call tzset, since localtime_r does not.
      * src/emacs.c (dump_tz, Fdump_emacs) [HAVE_TZSET]: Remove dump_tz stuff.
      This is now done in init_editfns.
      * src/systime.h (mktime_z, timezone_t, tzalloc, tzfree) [!HAVE_TZALLOC]:
      New macros and declarations, for platforms lacking tzalloc & friends.
      
      Fixes: debbugs:8705
      4c4c5b91
  18. 16 Apr, 2014 1 commit
    • Paul Eggert's avatar
      Remove DATA_SEG_BITS. · 5403b2d3
      Paul Eggert authored
      The DATA_SEG_BITS hack was needed for older 32 bit platforms.
      As a result of this change, Emacs won't work on IRIX 6.5 with IRIX
      cc, but that platform is so old that SGI itself stopped supporting
      it in December 2013.  If you still need Emacs on IRIX, please
      either compile with GCC and port the undumping code, or run
      './configure --with-wide-int'.
      * configure.ac (DATA_SEG_BITS): Remove.  All uses removed.
      * src/alloc.c (gdb_make_enums_visible): Update to match lisp.h.
      * src/lisp.h (GCTYPEBITS): Move definition up, and switch to the
      DEFINE_GDB_SYMBOL_START way to define it.
      (NONPOINTER_BITS): New macro.
      (EMACS_INT): Use it.
      [!USE_LSB_TAG && !WIDE_EMACS_INT]: Fail, and suggest reporting
      the problem and/or configuring --with-wide-int.
      (USE_LSB_TAG): Simplify, based on above changes.
      (gdb_DATA_SEG_BITS): Remove.  All uses removed.
      * src/vm-limit.c (exceeds_lisp_ptr): Remove.  All uses removed.
      5403b2d3
  19. 14 Apr, 2014 1 commit
    • Paul Eggert's avatar
      Clean up configure-time library handling a bit. · 93ca4887
      Paul Eggert authored
      This patch was inspired by emacs-24 2014-04-09T13:37:49Z!sdl.web@gmail.com, which fixed
      a bug due to sloppy library handling in 'configure'.
      * configure.ac (LIB_MATH, LIB_PTHREAD, LIBXMU):
      Use AC_SEARCH_LIBS instead of AC_CHECK_LIB as per Autoconf manual.
      (LIB_MATH, LIB_PTHREAD, HAVE_X11, IMAGEMAGICK_LIBS, GTK_LIBS)
      (DBUS_LIBS, LIBXMU, XFT_LIBS, LIBXSM, LIBXML2_LIBS, LIBS_MAIL)
      (with_kerberos):
      Don't let the library choice infect $LIBS.
      (dnet_ntoa, cma_open): Remove obsolete tests.
      (emacs_pthread_function): Probe for pthread_kill, not pthread_self,
      as that's a bit more selective on GNU/Linux.
      (LIBXEXT): Remove.
      (touchlock): Test for existence when $LIBS_MAIL is in use.
      (AC_CHECK_FUNCS): Use only $LIB_MATH in addition to $LIBS
      when testing for typical functions like accept4, lrand48.
      (random, rint): Remove obsolete HP-UX 9 A.09.05 test.
      93ca4887
  20. 26 Mar, 2014 1 commit
    • Glenn Morris's avatar
      Remove the build-time option CLASH_DETECTION · 11ee65af
      Glenn Morris authored
      Every platform supports it, and the runtime option `create-lockfiles'
      replaces it.
      
      * configure.ac (CLASH_DETECTION): Remove option.
      
      * lisp/files.el (lock-buffer, unlock-buffer, file-locked-p):
      Remove fallback aliases, since they are always defined now.
      
      * src/buffer.c (Frestore_buffer_modified_p, Fkill_buffer):
      * src/emacs.c (shut_down_emacs):
      * src/fileio.c (Finsert_file_contents, write_region):
      * src/filelock.c (top-level, syms_of_filelock):
      * src/insdel.c (prepare_to_modify_buffer_1):
      CLASH_DETECTION is always defined now.
      
      * admin/CPP-DEFINES: Remove CLASH_DETECTION.
      11ee65af
  21. 02 Jul, 2013 1 commit
    • Paul Eggert's avatar
      Remove some unused macros from 'configure'. · 57f8c490
      Paul Eggert authored
      * configure.ac (HAVE_SOUNDCARD_H, HAVE_LINUX_VERSION_H, HAVE_SPEED_T)
      (HAVE_GNUTLS_CALLBACK_CERTIFICATE_VERIFY)
      (HAVE_GNUTLS_CERTIFICATE_SET_VERIFY_FUNCTION, HAVE_UTIMES)
      (HAVE_LIBHESIOD, HAVE_LIBRESOLV, HAVE_LIBCOM_ERR, HAVE_LIBCRYPTO)
      (HAVE_LIBK5CRYPTO, HAVE_LIBKRB5, HAVE_LIBDES425, HAVE_LIBDES)
      (HAVE_LIBKRB4, HAVE_LIBKRB, HAVE_DES_H, HAVE_KERBEROSIV_DES_H)
      (HAVE_DEV_PTMX, DEVICE_SEP, USG5):
      Remove these macros, as they are not used.
      (sys_siglist): Remove macro; src/sysdep.c now does this.
      * src/sysdep.c (sys_siglist) [HAVE_DECL___SYS_SIGLIST]:
      Define to __sys_siglist.
      57f8c490
  22. 27 Mar, 2013 1 commit
  23. 13 Mar, 2013 1 commit
    • Paul Eggert's avatar
      File synchronization fixes. · 47d7532e
      Paul Eggert authored
      * admin/CPP-DEFINES (BSD_SYSTEM, HAVE_FSYNC): Remove.
      * admin/merge-gnulib (GNULIB_MODULES): Add fsync, fdatasync.
      * configure.ac (BSD_SYSTEM, BSD_SYSTEM_AHB): Remove; no longer needed.
      (fsync): Remove check; now done by gnulib.
      * lib/fdatasync.c, lib/fsync.c, m4/fdatasync.m4, m4/fsync.m4:
      New files, from gnulib.
      * lib/gnulib.mk, m4/gnulib-comp.m4: Regenerate.
      * lib-src/Makefile.in (LIB_FDATASYNC): New macro.
      (emacsclient${EXEEXT}): Use it.
      * lib-src/emacsclient.c (main): Use fdatasync, not fsync, since we don't
      care about metadata.  Keep trying if interrupted.
      * lib-src/movemail.c (main, popmail): Don't worry about BSD_SYSTEM, since
      fsync is available everywhere (or there is a substitute).  Don't
      report an error if fsync returns EINVAL.
      * nt/inc/ms-w32.h (fdatasync): New macro, suggested by Eli Zaretskii.
      * src/Makefile.in (LIB_FDATASYNC): New macro.
      (LIBES): Use it.
      * src/conf_post.h (BSD_SYSTEM, BSD_SYSTEM_AHB): Remove; no longer needed.
      * src/fileio.c (Fwrite_region, write_region_inhibit_fsync):
      Don't worry about HAVE_FSYNC, since a substitute fsync is
      available if the system lacks one.
      (Fwrite_regin): Retry fsync if interrupted.
      
      Fixes: debbugs:13944
      47d7532e
  24. 25 Feb, 2013 1 commit
    • Paul Eggert's avatar
      Simplify data_start configuration. · 1ddc2bd6
      Paul Eggert authored
      This is a followon simplification to the fix for Bug#13650.
      * admin/CPP-DEFINES (DATA_START, ORDINARY_LINK): Remove.
      * configure.ac (CRT_DIR, LIB_STANDARD, START_FILES, DATA_START)
      (LD_FIRSTFLAG, ORDINARY_LINK, LIB_GCC): Remove.
      (AC_CHECK_HEADERS_ONCE): Remove sys/resource.h, as it's
      not always needed.
      (HAVE_DATA_START): New macro.
      * etc/PROBLEMS (LIBS_SYSTEM, LIBS_MACHINE, LIBS_STANDARD): Remove.
      Remove legacy-systems section, as this stuff is no longer
      applicable with current linking strategies.
      * src/Makefile.in (LD_FIRSTFLAG, LIB_GCC, CRT_DIR, LIB_STANDARD)
      (START_FILES): Remove.  All uses removed.
      (otherobj): Remove $(VMLIMIT_OBJ), as it's now first.
      (ALLOBJS): Move here from autodeps.mk, and with VMLIMITS_OBJ first.
      (buildobj.h): Use it.
      ($(ALLOBJS)): Depend on globals.h.
      (temacs$(EXEEXT)): Use $(ALLOBJS).
      * src/autodeps.mk (ALLOBJS): Move to Makefile.in.
      * src/deps.mk (vm-limit.o):
      * src/makefile.w32-in ($(BLD)/vm-limit.$(O)):
      Do not depend on mem-limits.h.
      * src/emacs.c (__do_global_ctors, __do_global_ctors_aux)
      (__do_global_dtors, __CTOR_LIST__, __DTOR_LIST__)
      [__GNUC__ && !ORDINARY_LINK]: Remove.
      * src/mem-limits.h, src/pre-crt0.c: Remove.
      * src/unexaix.c, src/unexcoff.c: Don't include mem-limits.h.
      * src/unexcoff.c (etext): New decl.
      (make_hdr): Use it instead of start_of_data.
      * src/vm-limit.c: Move most of mem-limits.h's contents here.
      (data_start): New decl.  It's OK if this is approximate,
      so simplify-away some unnecessary exactness.
      (POINTER): Remove; all uses removed.
      (data_space_start): Now char *, to avoid casts.
      (exceeds_lisp_ptr): New function, replacing the old
      EXCEEDS_LISP_PTR macro.  All uses changed.
      (check_memory_limits): Simplify and remove casts.
      (start_of_data) [!CANNOT_DUMP || !SYSTEM_MALLOC]: Remove.
      (memory_warnings): Use data_start instead of start_of_data.
      
      Fixes: debbugs:13783
      1ddc2bd6
  25. 14 Dec, 2012 1 commit
    • Paul Eggert's avatar
      Fix permissions bugs with setgid directories etc. · 97976f9f
      Paul Eggert authored
      * configure.ac (BSD4_2): Remove; no longer needed.
      * admin/CPP-DEFINES (BSD4_2): Remove.
      * doc/lispintro/emacs-lisp-intro.texi (Files List):
      directory-files-and-attributes now outputs t for attribute that's
      now a placeholder.
      * doc/lispref/files.texi (Testing Accessibility): Document GROUP arg
      of file-ownership-preserved-p.
      (File Attributes): Document that 9th element is now
      just a placeholder.
      * doc/lispref/os.texi (User Identification): Document new functions group-gid,
      group-real-gid.
      * etc/NEWS: Document changes to file-attributes,
      file-ownership-preserved-p.
      Mention new functions group-gid, group-real-gid.
      * lisp/files.el (backup-buffer): Don't rely on 9th output of
      file-attributes, as it's now a placeholder.  Instead, use the new
      optional arg of file-ownership-preserved-p.
      (file-ownership-preserved-p): New optional arg GROUP.
      Fix mishandling of setuid directories that would cause this
      function to return t when it should have returned nil.
      Document what happens if the file does not exist, and when
      it's not known whether the ownership will be preserved.
      * lisp/net/tramp-sh.el (tramp-sh-handle-file-ownership-preserved-p):
      Likewise.
      (tramp-get-local-gid): Use group-gid for integer, as that's
      faster and more reliable.
      * src/dired.c (Ffile_attributes): Return t as the 9th attribute,
      to mark it as a placeholder.  The old value was often wrong.
      The only user of this attribute has been changed to use
      file-ownership-preserved-p instead, with its new group arg.
      * src/editfns.c (Fgroup_gid, Fgroup_real_gid): New functions.
      
      Fixes: debbugs:13125
      97976f9f
  26. 08 Dec, 2012 2 commits
    • Paul Eggert's avatar
      Simplify get_lim_data. · 7be78020
      Paul Eggert authored
      * admin/CPP-DEFINES (ULIMIT_BREAK_VALUE): Remove.
      * configure.ac (ULIMIT_BREAK_VALUE): Remove.
      * src/vm-limit.c (get_lim_data): Combine RLIMIT_AS and RLIMIT_DATA methods.
      Remove USG and vlimit methods; no longer used these days.
      Add #error catchall just in case.
      7be78020
    • Paul Eggert's avatar
      Assume POSIX 1003.1-1988 or later for signal.h. · d983a10b
      Paul Eggert authored
      Exceptions: do not assume SIGCONT, SIGSTOP, SIGTSTP, SIGTTIN,
      SIGTTOU, SIGUSR1, SIGUSR2, as Microsoft platforms lack these.
      * admin/CPP-DEFINES (SIGALRM, SIGCHLD, SIGHUP, SIGKILL, SIGPIPE, SIGQUIT):
      Remove.
      (SIGTRAP): Remove this one too, as config.h no longer defines it.
      * admin/merge-gnulib (GNULIB_MODULES): Add sig2str.
      * configure.ac (PTY_OPEN, PTY_TTY_NAME_SPRINTF):
      Use SIGCHLD rather than SIGCLD.
      * lib/sig2str.c, lib/sig2str.h, m4/sig2str.m4: New files, from gnulib.
      * lib/gnulib.mk, m4/gnulib-comp.m4: Regenerate.
      * lib/makefile.w32-in (GNULIBOBJS): Add $(BUILD)/sig2str.$(O).
      * src/process.c [subprocesses]: Include <c-ctype.h>, <sig2str.h>.
      (deleted_pid_list, Fdelete_process, create_process)
      (record_child_status_change, handle_child_signal, deliver_child_signal)
      (init_process_emacs, syms_of_process):
      Assume SIGCHLD is defined.
      (parse_signal): Remove.  All uses removed.
      (abbr_to_signal): New static function.
      (Fsignal_process): Use it to convert signal names to ints.
      * src/sysdep.c (sys_suspend) [!DOS_NT]: Use kill (0, ...) rather than
      kill (getpgrp (), ...).
      (emacs_sigaction_init): Assume SIGCHLD is defined.
      (init_signals): Assume SIGALRM, SIGCHLD, SIGHUP, SIGKILL,
      SIGPIPE, and SIGQUIT are defined.  Do not worry about SIGCLD any more.
      * src/syssignal.h (EMACS_KILLPG): Remove.
      All uses replaced by 'kill' with a negative pid.
      (SIGCHLD): Remove definition, as we now assume SIGCHLD.
      * src/w32proc.c (sys_kill): Support negative pids compatibly with POSIX.
      
      Fixes: debbugs:13026
      d983a10b
  27. 24 Nov, 2012 1 commit
  28. 23 Nov, 2012 1 commit
    • Paul Eggert's avatar
      Assume POSIX 1003.1-1988 or later for dirent.h. · 95ef7787
      Paul Eggert authored
      * admin/CPP-DEFINES (HAVE_CLOSEDIR, HAVE_DIRENT_H): Remove.
      * admin/notes/copyright: Adjust to src/ndir.h -> nt/inc/dirent.h renaming.
      * configure.ac: Do not check for dirent.h or closdir.
      * nt/inc/dirent.h: Rename from ../src/ndir.h, with these changes:
      (struct dirent): Rename from struct direct.  All uses changed.
      * nt/inc/sys/dir.h: Remove.
      * src/dired.c: Assume HAVE_DIRENT_H.
      (NAMLEN): Remove, replacing with ...
      (dirent_namelen): New function.  All uses changed.  Use the GNU macro
      _D_EXACT_NAMELEN if available, as it's faster than strlen.
      (DIRENTRY): Remove, replacing all uses with 'struct dirent'.
      (DIRENTRY_NONEMPTY): Remove.  All callers now assume it's nonzero.
      * src/makefile.w32-in (DIR_H): Remove.  All uses replaced with
      $(NT_INC)/dirent.h.
      ($(BLD)/w32.$(O)): Do not depend on $(SRC)/ndir.h.
      * src/ndir.h: Rename to ../nt/inc/dirent.h.
      * src/sysdep.h (closedir) [!HAVE_CLOSEDIR]: Remove.
      Do not include <dirent.h>; no longer needed.
      * src/w32.c: Include <dirent.h> rather than "ndir.h".
      
      Fixes: debbugs:12958
      95ef7787
  29. 21 Nov, 2012 1 commit
    • Paul Eggert's avatar
      Assume POSIX 1003.1-1988 or later for unistd.h. · 9239d970
      Paul Eggert authored
      * admin/CPP-DEFINES (BROKEN_GETWD, HAVE_GETCWD, HAVE_GETWD, HAVE_SIZE_T)
      (HAVE_UNISTD_H): Remove.
      * configure.ac: Do not check for getcwd or getwd.
      * lib-src/emacsclient.c (getcwd): Remove decl.
      (get_current_dir_name): Assume getcwd exists.
      * lib-src/etags.c (HAVE_GETCWD): Remove.
      (getcwd): Remove decl.
      (NO_LONG_OPTIONS): Remove this.  All uses removed.
      Emacs always has GNU getopt.
      (etags_getcwd): Assume getcwd exists.
      * lib-src/movemail.c (F_OK, X_OK, W_OK, R_OK): Remove.
      * nt/config.nt (HAVE_GETCWD): Remove.
      * src/alloc.c: Assume unistd.h exists.
      * src/fileio.c (Fexpand_file_name) [DOS_NT]: Use getcwd, not getwd.
      * src/sysdep.c (get_current_dir_name): Assume getcwd exists.
      (getwd) [USG]: Remove; no longer needed.
      (sys_subshell) [DOS_NT]: Use getcwd, not getwd.
      * src/w32.c (getcwd): Rename from getwd, and switch to getcwd's API.
      * src/w32.h (getcwd): Remove decl.
      
      Fixes: debbugs:12945
      9239d970
  30. 17 Nov, 2012 1 commit
    • Paul Eggert's avatar
      Assume POSIX 1003.1-1988 or later for fcntl.h. · 49cdacda
      Paul Eggert authored
      * 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
      49cdacda
  31. 16 Nov, 2012 1 commit
    • Paul Eggert's avatar
      Remove no-longer-used pty_max_bytes variable. · 3d082a26
      Paul Eggert authored
      * configure.ac (fpathconf): Remove unnecessary check.
      * admin/CPP-DEFINES (HAVE_FPATHCONF): Remove.
      * src/process.c (pty_max_bytes): Remove; unused.
      (send_process): Do not set it.
      3d082a26
  32. 05 Nov, 2012 2 commits
    • Paul Eggert's avatar
      Assume at least POSIX.1-1988 for getpgrp, setpgid, setsid. · dd0333b6
      Paul Eggert authored
      This removes code that has been obsolete since around 1990.
      * admin/CPP-DEFINES (HAVE_SETPGID, HAVE_SETSID, SETPGRP_RELEASES_CTTY):
      Remove; obsolete.
      * configure.ac (setpgid, setsid): Assume their existence.
      (AC_FUNC_GETPGRP, SETPGRP_RELEASES_CTTY): Remove; obsolete.
      * src/callproc.c (Fcall_process):
      * src/emacs.c (main):
      * src/process.c (create_process):
      * src/term.c (dissociate_if_controlling_tty):
      Assume setsid exists.
      * src/callproc.c (child_setup): Assume setpgid exists and behaves as
      per POSIX.1-1988 or later.
      * src/conf_post.h (setpgid) [!HAVE_SETPGID]: Remove.
      * src/emacs.c (shut_down_emacs):
      * src/sysdep.c (sys_suspend, init_foreground_group):
      Assume getpgrp behaves as per POSIX.1-1998 or later.
      * src/msdos.c (setpgrp): Remove.
      (tcgetpgrp, setpgid, setsid): New functions.
      * src/systty.h (EMACS_GETPGRP): Remove.  All callers now use getpgrp.
      * src/term.c (no_controlling_tty): Remove; unused.
      * src/w32proc.c (setpgrp): Remove.
      (setsid, tcgetpgrp): New functions.
      
      Fixes: debbugs:12800
      dd0333b6
    • Paul Eggert's avatar
      Simplify by assuming __fpending. · 8148369c
      Paul Eggert authored
      Now that Emacs is using the gnulib fpending module,
      there's no need for Emacs to have a separate implementation.
      * configure.ac (stdio_ext.h, __fpending): Remove now-duplicate checks.
      (PENDING_OUTPUT_COUNT, DISPNEW_NEEDS_STDIO_EXT): Remove.
      * admin/CPP-DEFINES (PENDING_OUTPUT_COUNT): Remove.
      * src/dispnew.c: Include <fpending.h>, not <stdio_ext.h>.
      (update_frame_1): Use __fpending, not PENDING_OUTPUT_COUNT.
      Do not assume that __fpending's result fits in int.
      8148369c
  33. 16 Sep, 2012 1 commit
    • Paul Eggert's avatar
      Remove configure's --without-sync-input option. · 0caaedb1
      Paul Eggert authored
      When auditing signal-handling in preparation for cleaning it up,
      I found that SYNC_INPUT has race conditions and would be a real
      pain to fix.  Since it's an undocumented and deprecated
      configure-time option, now seems like a good time to remove it.
      Also see <http://bugs.gnu.org/11080#16>.
      * configure.ac (SYNC_INPUT, BROKEN_SA_RESTART): Remove.
      * admin/CPP-DEFINES (BROKEN_SA_RESTART, SA_RESTART): Remove.
      * etc/TODO (Make SYNC_INPUT the default): Remove, as the code now
      behaves as if SYNC_INPUT is always true.
      * src/alloc.c (_bytes_used, __malloc_extra_blocks, _malloc_internal)
      (_free_internal) [!DOUG_LEA_MALLOC]: Remove decls.
      (alloc_mutex) [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
      (malloc_hysteresis):
      (check_depth) [XMALLOC_OVERRUN_CHECK]:
      (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT):
      (__malloc_hook, __realloc_hook, __free_hook, BYTES_USED)
      (dont_register_blocks, bytes_used_when_reconsidered)
      (bytes_used_when_full, emacs_blocked_free, emacs_blocked_malloc)
      (emacs_blocked_realloc, reset_malloc_hooks, uninterrupt_malloc):
      [!SYSTEM_MALLOC && !SYNC_INPUT]:
      Remove. All uses removed.
      (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): Use a different
      implementation, one that depends on whether the new macro
      XMALLOC_BLOCK_INPUT_CHECK is defined, not on whether SYNC_INPUT
      is defined.
      * src/atimer.c (run_timers, handle_alarm_signal):
      * src/keyboard.c (pending_signal, poll_for_input_1, poll_for_input)
      (handle_async_input, process_pending_signals)
      (handle_input_available_signal, init_keyboard):
      * src/nsterm.m (ns_read_socket):
      * src/process.c (wait_reading_process_output):
      * src/regex.c (immediate_quit, IMMEDIATE_QUIT_CHECK):
      * src/sysdep.c (emacs_sigaction_init) [SA_RESTART]:
      (emacs_write):
      * src/xterm.c (XTread_socket):
      Assume SYNC_INPUT.
      * src/conf_post.h (SA_RESTART) [IRIX6_5]: Do not #undef.
      * src/eval.c (handling_signal): Remove.  All uses removed.
      * src/lisp.h (ELSE_PENDING_SIGNALS): Remove.
      All uses replaced with the SYNC_INPUT version.
      (reset_malloc_hooks, uninterrupt_malloc, handling_signal):
      Remove decls.
      * src/sysdep.c, src/syssignal.h (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
      Now static.
      
      Fixes: debbugs:12450
      0caaedb1
  34. 13 Sep, 2012 1 commit
    • Paul Eggert's avatar
      Simplify SIGIO usage. · 4a4bbad2
      Paul Eggert authored
      The code that dealt with SIGIO was crufty and confusing, e.g., it
      played tricks like "#undef SIGIO" but these tricks were not used
      consistently.  Simplify mostly by not #undeffing standard symbols,
      e.g., use "defined USABLE_SIGIO" (our symbol, which we can define
      or not as we please) rather than "defined SIGIO" (standard symbol
      that we probably shouldn't #undef).
      * configure.ac (NO_TERMIO, BROKEN_FIONREAD, BROKEN_SIGAIO)
      (BROKEN_SIGPOLL, BROKEN_SIGPTY): Remove.
      (USABLE_FIONREAD, USABLE_SIGIO): New symbols.  All uses of
      'defined SIGIO' replaced with 'defined USABLE_SIGIO', with no need
      to #undef SIGIO now (which was error-prone).  Likewise, all uses
      of 'defined FIONREAD' replaced with 'defined USABLE_FIONREAD'.
      * src/admin/CPP_DEFINES (BROKEN_SIGAIO, BROKEN_SIGIO, BROKEN_SIGPOLL)
      (BROKEN_SIGPTY, NO_TERMIO): Remove.
      * src/conf_post.h [USG5_4]: Do not include <sys/wait.h> here.
      Modules that need it can include it.
      [USG5_4 && emacs]: Likewise, do not include the streams stuff here.
      * src/dispextern.h (ignore_sigio): New decl.
      * src/emacs.c (shut_down_emacs): Invoke unrequest_sigio
      unconditionally, since it's now a no-op if !USABLE_SIGIO.
      * src/emacs.c (shut_down_emacs):
      * src/keyboard.c (kbd_buffer_store_event_hold):
      Use ignore_sigio rather than invoking 'signal' directly.
      * src/keyboard.c (USABLE_FIONREAD && USG5_4): Include <sys/filio.h>,
      for FIONREAD.
      (FIONREAD, SIGIO): Do not #undef.
      (tty_read_avail_input): Use #error rather than a syntax error.
      * src/process.c [USG5_4]: Include <sys/stream.h> and <sys/stropts.h>,
      for I_PIPE, used by SETUP_SLAVE_PTY.
      (DATAGRAM_SOCKETS): Simplify defn, based on USABLE_FIONREAD.
      * src/sysdep.c (croak): Remove; no longer needed.  This bit of
      temporary code, with Fred N. Fish's comment that it's temporary,
      has been in Emacs since at least 1992!
      (init_sigio, reset_sigio, request_sigio, unrequest_sigio):
      Arrange for them to be no-ops in all cases when ! USABLE_SIGIO.
      * src/syssignal.h (croak): Remove decl.
      (SIGIO, SIGPOO, SIGAIO, SIGPTY): Do not #undef; that's too fragile.
      * src/systty.h [!NO_TERMIO]: Do not include <termio.h>; no longer needed
      now that we're termios-only.
      (FIONREAD, ASYNC) [BROKEN_FIONREAD]: Do not #undef.
      * src/term.c (dissociate_if_controlling_tty): Use #error rather than
      a run-time error.
      
      Fixes: debbugs:12408
      4a4bbad2
  35. 11 Sep, 2012 1 commit
    • Paul Eggert's avatar
      Simplify, document, and port floating-point. · c990426a
      Paul Eggert authored
      The porting part of this patch fixes bugs on non-IEEE platforms
      with frexp, ldexp, logb.
      * admin/CPP-DEFINES (HAVE_CBRT, HAVE_LOGB, logb): Remove.
      * configure.ac (logb, cbrt): Do not check for these functions,
      as they are not being used.
      * doc/lispref/numbers.texi (Float Basics, Arithmetic Operations, Math Functions):
      Document that / and mod (with floating point arguments), along
      with asin, acos, log, log10, expt and sqrt, return special values
      instead of signaling exceptions.
      (Float Basics): Document that logb operates on the absolute value
      of its argument.
      (Math Functions): Document that (log ARG BASE) also returns NaN if
      BASE is negative.  Document that (expt X Y) returns NaN if X is a
      finite negative number and Y a finite non-integer.
      * etc/NEWS: Document NaNs versus signaling-error change.
      * src/data.c, src/lisp.h (Qdomain_error, Qsingularity_error, Qunderflow_error):
      Now static.
      * src/floatfns.c: Simplify discussion of functions that Emacs doesn't
      support, by removing commented-out code and briefly listing the
      C89 functions excluded.  The commented-out stuff was confusing
      maintenance, e.g., we thought we needed cbrt but it was commented out.
      (logb): Remove decl; no longer needed.
      (isfinite): New macro, if not already supplied.
      (isnan): Don't replace any existing macro.
      (Ffrexp, Fldexp): Define even if !HAVE_COPYSIGN, as frexp and ldexp
      are present on all C89 platforms.
      (Ffrexp): Do not special-case zero, as frexp does the right thing
      for that case.
      (Flogb): Do not use logb, as it doesn't have the desired meaning
      on hosts that use non-base-2 floating point.  Instead, stick with
      frexp, which is C89 anyway.  Do not pass an infinity or a NaN to
      frexp, to avoid getting an unspecified result.
      c990426a
  36. 09 Sep, 2012 1 commit
    • Paul Eggert's avatar
      Assume C89 or later for math functions. · f6196b87
      Paul Eggert authored
      This simplifies the code, and makes it a bit smaller and faster,
      and (most important) makes it easier to clean up signal handling
      since we can stop worring about floating-point exceptions in
      library code.  That was a problem before C89, but the problem
      went away many years ago on all practical Emacs targets.
      * configure.ac (frexp, fmod): Remove checks for these functions,
      as we now assume them.
      (FLOAT_CHECK_DOMAIN, HAVE_INVERSE_HYPERBOLIC, NO_MATHERR)
      (HAVE_EXCEPTION):
      Remove; no longer needed.
      * admin/CPP-DEFINES (HAVE_FMOD, HAVE_FREXP, FLOAT_CHECK_DOMAIN)
      (HAVE_INVERSE_HYPERBOLIC, NO_MATHERR): Remove.
      * src/data.c, src/image.c, src/lread.c, src/print.c:
      Don't include <math.h>; no longer needed.
      * src/data.c, src/floatfns.c (IEEE_FLOATING_POINT): Don't worry that it
      might be autoconfigured, as that never happens.
      * src/data.c (fmod):
      * src/doprnt.c (DBL_MAX_10_EXP):
      * src/print.c (DBL_DIG):
      Remove.  C89 or later always defines these.
      * src/floatfns.c (HAVE_MATHERR, FLOAT_CHECK_ERRNO, FLOAT_CHECK_DOMAIN)
      (in_float, float_error_arg, float_error_arg2, float_error_fn_name)
      (arith_error, domain_error, domain_error2):
      Remove all this pre-C89 cruft.  Do not include <errno.h> as that's
      no longer needed -- we simply return what C returns.  All uses removed.
      (IN_FLOAT, IN_FLOAT2): Remove.  All uses replaced with
      the wrapped code.
      (FLOAT_TO_INT, FLOAT_TO_INT2, range_error, range_error2):
      Remove.  All uses expanded, as these macros are no longer used
      more than once and are now more trouble than they're worth.
      (Ftan): Use tan, not sin / cos.
      (Flogb): Assume C89 frexp.
      (fmod_float): Assume C89 fmod.
      (matherr) [HAVE_MATHERR]: Remove; no longer needed.
      (init_floatfns): Remove.  All uses removed.
      f6196b87
  37. 04 Sep, 2012 1 commit
    • Paul Eggert's avatar
      Simplify redefinition of 'abort' (Bug#12316). · 1088b922
      Paul Eggert authored
      Do not try to redefine the 'abort' function.  Instead, redo
      the code so that it calls 'emacs_abort' rather than 'abort'.
      This removes the need for the NO_ABORT configure-time macro
      and makes it easier to change the abort code to do a backtrace.
      * configure.ac (NO_ABRT): Remove.
      * admin/CPP-DEFINES (NO_ABORT): Remove.
      * nt/inc/ms-w32.h (w32_abort) [HAVE_NTGUI]: Remove.
      * src/.gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
      * src/emacs.c (abort) [!DOS_NT && !NO_ABORT]:
      Remove; sysdep.c's emacs_abort now takes its place.
      * src/lisp.h (emacs_abort): New decl.  All calls from Emacs code to
      'abort' changed to use 'emacs_abort'.
      * src/msdos.c (dos_abort) [defined abort]: Remove; not used.
      (abort) [!defined abort]: Rename to ...
      (emacs_abort): ... new name.
      * src/sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
      the place of the old 'abort' in emacs.c.
      * src/w32.c, src/w32fns.c (abort): Do not #undef.
      * src/w32.c (emacs_abort): Rename from w32_abort.
      1088b922
  38. 18 Aug, 2012 1 commit