• 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
configure.ac 184 KB