aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/config.in3
-rw-r--r--src/editfns.c18
2 files changed, 21 insertions, 0 deletions
diff --git a/src/config.in b/src/config.in
index 87e37e65ef2..34ba3a061df 100644
--- a/src/config.in
+++ b/src/config.in
@@ -598,6 +598,9 @@ Boston, MA 02111-1307, USA. */
598/* Define to 1 if you have the <sys/un.h> header file. */ 598/* Define to 1 if you have the <sys/un.h> header file. */
599#undef HAVE_SYS_UN_H 599#undef HAVE_SYS_UN_H
600 600
601/* Define to 1 if you have the <sys/utsname.h> header file. */
602#undef HAVE_SYS_UTSNAME_H
603
601/* Define to 1 if you have the <sys/vlimit.h> header file. */ 604/* Define to 1 if you have the <sys/vlimit.h> header file. */
602#undef HAVE_SYS_VLIMIT_H 605#undef HAVE_SYS_VLIMIT_H
603 606
diff --git a/src/editfns.c b/src/editfns.c
index 45b7caa280b..6641c990a4f 100644
--- a/src/editfns.c
+++ b/src/editfns.c
@@ -34,6 +34,10 @@ Boston, MA 02111-1307, USA. */
34#include <unistd.h> 34#include <unistd.h>
35#endif 35#endif
36 36
37#ifdef HAVE_SYS_UTSNAME_H
38#include <sys/utsname.h>
39#endif
40
37/* systime.h includes <sys/time.h> which, on some systems, is required 41/* systime.h includes <sys/time.h> which, on some systems, is required
38 for <sys/resource.h>; thus systime.h must be included before 42 for <sys/resource.h>; thus systime.h must be included before
39 <sys/resource.h> */ 43 <sys/resource.h> */
@@ -106,6 +110,7 @@ Lisp_Object Vsystem_name;
106Lisp_Object Vuser_real_login_name; /* login name of current user ID */ 110Lisp_Object Vuser_real_login_name; /* login name of current user ID */
107Lisp_Object Vuser_full_name; /* full name of current user */ 111Lisp_Object Vuser_full_name; /* full name of current user */
108Lisp_Object Vuser_login_name; /* user name from LOGNAME or USER */ 112Lisp_Object Vuser_login_name; /* user name from LOGNAME or USER */
113Lisp_Object Voperating_system_release; /* Operating System Release */
109 114
110/* Symbol for the text property used to mark fields. */ 115/* Symbol for the text property used to mark fields. */
111 116
@@ -170,6 +175,16 @@ init_editfns ()
170 Vuser_full_name = build_string (p); 175 Vuser_full_name = build_string (p);
171 else if (NILP (Vuser_full_name)) 176 else if (NILP (Vuser_full_name))
172 Vuser_full_name = build_string ("unknown"); 177 Vuser_full_name = build_string ("unknown");
178
179#ifdef HAVE_SYS_UTSNAME_H
180 {
181 struct utsname uts;
182 uname (&uts);
183 Voperating_system_release = build_string (uts.release);
184 }
185#else
186 Voperating_system_release = Qnil;
187#endif
173} 188}
174 189
175DEFUN ("char-to-string", Fchar_to_string, Schar_to_string, 1, 1, 0, 190DEFUN ("char-to-string", Fchar_to_string, Schar_to_string, 1, 1, 0,
@@ -4293,6 +4308,9 @@ functions if all the text being accessed has this property. */);
4293 DEFVAR_LISP ("user-real-login-name", &Vuser_real_login_name, 4308 DEFVAR_LISP ("user-real-login-name", &Vuser_real_login_name,
4294 doc: /* The user's name, based upon the real uid only. */); 4309 doc: /* The user's name, based upon the real uid only. */);
4295 4310
4311 DEFVAR_LISP ("operating-system-release", &Voperating_system_release,
4312 doc: /* The release of the operating system Emacs is running on. */);
4313
4296 defsubr (&Spropertize); 4314 defsubr (&Spropertize);
4297 defsubr (&Schar_equal); 4315 defsubr (&Schar_equal);
4298 defsubr (&Sgoto_char); 4316 defsubr (&Sgoto_char);