From 3bb9abc888338017c27ac6e2347bb35d89084e64 Mon Sep 17 00:00:00 2001 From: Steven Tamm Date: Wed, 19 Jan 2005 19:09:42 +0000 Subject: [PATCH] * editfns.c (Voperating_system_release): Added. (init_editfns): Assign new variable operating-system-release based on call to uname if available. * config.h: Regenerated. --- src/config.in | 3 +++ src/editfns.c | 18 ++++++++++++++++++ 2 files changed, 21 insertions(+) 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. */ /* Define to 1 if you have the header file. */ #undef HAVE_SYS_UN_H +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_UTSNAME_H + /* Define to 1 if you have the header file. */ #undef HAVE_SYS_VLIMIT_H 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. */ #include #endif +#ifdef HAVE_SYS_UTSNAME_H +#include +#endif + /* systime.h includes which, on some systems, is required for ; thus systime.h must be included before */ @@ -106,6 +110,7 @@ Lisp_Object Vsystem_name; 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 @@ init_editfns () 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 @@ functions if all the text being accessed has this property. */); 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); -- 2.39.2