changeset 59644:d8d85276ffed

* editfns.c (Voperating_system_release): Added. (init_editfns): Assign new variable operating-system-release based on call to uname if available. * config.h: Regenerated.
author Steven Tamm <steventamm@mac.com>
date Wed, 19 Jan 2005 19:09:42 +0000
parents d30fc301d0d8
children 9078a74f1daf
files src/config.in src/editfns.c
diffstat 2 files changed, 21 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/config.in	Wed Jan 19 19:09:04 2005 +0000
+++ b/src/config.in	Wed Jan 19 19:09:42 2005 +0000
@@ -598,6 +598,9 @@
 /* Define to 1 if you have the <sys/un.h> header file. */
 #undef HAVE_SYS_UN_H
 
+/* Define to 1 if you have the <sys/utsname.h> header file. */
+#undef HAVE_SYS_UTSNAME_H
+
 /* Define to 1 if you have the <sys/vlimit.h> header file. */
 #undef HAVE_SYS_VLIMIT_H
 
--- a/src/editfns.c	Wed Jan 19 19:09:04 2005 +0000
+++ b/src/editfns.c	Wed Jan 19 19:09:42 2005 +0000
@@ -34,6 +34,10 @@
 #include <unistd.h>
 #endif
 
+#ifdef HAVE_SYS_UTSNAME_H
+#include <sys/utsname.h>
+#endif
+
 /* systime.h includes <sys/time.h> which, on some systems, is required
    for <sys/resource.h>; thus systime.h must be included before
    <sys/resource.h> */
@@ -106,6 +110,7 @@
 Lisp_Object Vuser_real_login_name;	/* login name of current user ID */
 Lisp_Object Vuser_full_name;		/* full name of current user */
 Lisp_Object Vuser_login_name;		/* user name from LOGNAME or USER */
+Lisp_Object Voperating_system_release;  /* Operating System Release */
 
 /* Symbol for the text property used to mark fields.  */
 
@@ -170,6 +175,16 @@
     Vuser_full_name = build_string (p);
   else if (NILP (Vuser_full_name))
     Vuser_full_name = build_string ("unknown");
+
+#ifdef HAVE_SYS_UTSNAME_H
+  {
+    struct utsname uts;
+    uname (&uts);
+    Voperating_system_release = build_string (uts.release);
+  }
+#else
+  Voperating_system_release = Qnil;
+#endif
 }
 
 DEFUN ("char-to-string", Fchar_to_string, Schar_to_string, 1, 1, 0,
@@ -4293,6 +4308,9 @@
   DEFVAR_LISP ("user-real-login-name", &Vuser_real_login_name,
 	       doc: /* The user's name, based upon the real uid only.  */);
 
+  DEFVAR_LISP ("operating-system-release", &Voperating_system_release,
+	       doc: /* The release of the operating system Emacs is running on.  */);
+
   defsubr (&Spropertize);
   defsubr (&Schar_equal);
   defsubr (&Sgoto_char);