From: Andrea Corallo Date: Tue, 24 Dec 2019 07:17:40 +0000 (+0100) Subject: Revert "use memory mapped file for loading elns" X-Git-Tag: emacs-28.0.90~2727^2~890 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=df62baa7d4e8ce0760f32122899ae3c803180907;p=emacs.git Revert "use memory mapped file for loading elns" This reverts commit 5e07231151ef60a5066617ef6cec7c0077825b1c. --- diff --git a/src/comp.c b/src/comp.c index 75b41e2af8f..68b1cdf7449 100644 --- a/src/comp.c +++ b/src/comp.c @@ -27,13 +27,6 @@ along with GNU Emacs. If not, see . */ #include #include -#include /* For getpid. */ -#include -#include /* For O_RDONLY. */ -#include -/* FIXME non portable. */ -#include /* For memfd_create. */ - #include "lisp.h" #include "puresize.h" #include "window.h" @@ -3305,22 +3298,8 @@ DEFUN ("native-elisp-load", Fnative_elisp_load, Snative_elisp_load, 1, 1, 0, xsignal2 (Qnative_lisp_load_failed, file, build_string ("Empty relocation table")); - /* FIXME non portable. */ - /* We copy the content of the file to be loaded in a memory mapped - file. We then keep track of this in the struct - Lisp_Native_Comp_Unit. In case this will be overwritten - or delete we'll dump the right data. */ - int fd_in = emacs_open (SSDATA (file), O_RDONLY, 0); - int fd_out = memfd_create (SSDATA (file), 0); - if (fd_in < 0 || fd_out < 0) - xsignal2 (Qnative_lisp_load_failed, file, - build_string ("Failing to get file descriptor")); - struct stat st; - if (fstat (fd_in, &st) != 0) - report_file_error ("Input file status", file); - copy_file_fd (fd_out, fd_in, &st, Qnil, file); - dynlib_handle_ptr handle = - dynlib_open (format_string ("/proc/%d/fd/%d", getpid (), fd_out)); + dynlib_handle_ptr handle = dynlib_open (SSDATA (file)); + load_handle_stack = Fcons (make_mint_ptr (handle), load_handle_stack); if (!handle) xsignal2 (Qnative_lisp_load_failed, file, build_string (dynlib_error ())); struct Lisp_Native_Comp_Unit *comp_u = allocate_native_comp_unit();