[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 4/5] Allow the systed socket fd to be retrieved.
From: |
Matthew Leach |
Subject: |
[PATCH 4/5] Allow the systed socket fd to be retrieved. |
Date: |
Sat, 26 Mar 2016 21:16:41 +0000 |
* src/emacs.c (Fsystemd_socket_fd): New.
---
src/emacs.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/src/emacs.c b/src/emacs.c
index 5a87bcd..da869af 100644
--- a/src/emacs.c
+++ b/src/emacs.c
@@ -2368,6 +2368,18 @@ When systemd passes a socket through to emacs, return
`t'.*/)
#endif
}
+DEFUN ("systemd-socket-fd", Fsystemd_socket_fd, Ssystemd_socket_fd, 0, 0, 0,
+ doc: /* Returns the fd of the socket that systemd will pass through.
+When systemd support is not enabled, return nil.*/)
+ (void)
+{
+#ifdef HAVE_SYSTEMD
+ return make_number (SD_LISTEN_FDS_START);
+#else
+ return Qnil;
+#endif
+}
+
DEFUN ("daemon-initialized", Fdaemon_initialized, Sdaemon_initialized, 0, 0, 0,
doc: /* Mark the Emacs daemon as being initialized.
This finishes the daemonization process by doing the other half of detaching
@@ -2437,6 +2449,7 @@ syms_of_emacs (void)
defsubr (&Sinvocation_directory);
defsubr (&Sdaemonp);
defsubr (&Ssystemd_socket);
+ defsubr (&Ssystemd_socket_fd);
defsubr (&Sdaemon_initialized);
DEFVAR_LISP ("command-line-args", Vcommand_line_args,
--
2.7.4
[PATCH 1/5] Check for libsystemd when building Emacs., Matthew Leach, 2016/03/26