Raymond Toy pushed to branch master at cmucl / cmucl
Commits: c2a99381 by Raymond Toy at 2023-04-26T21:38:42+00:00 Fix #131: Move unix-uname to contrib/unix
- - - - - acb29d8f by Raymond Toy at 2023-04-26T21:38:42+00:00 Merge branch 'issue-131-move-unix-uname' into 'master'
Fix #131: Move unix-uname to contrib/unix
Closes #131
See merge request cmucl/cmucl!142 - - - - -
5 changed files:
- src/code/exports.lisp - src/code/unix.lisp - src/contrib/unix/unix-glibc2.lisp - src/contrib/unix/unix.lisp - src/i18n/locale/cmucl-unix.pot
Changes:
===================================== src/code/exports.lisp ===================================== @@ -249,9 +249,6 @@ "OPEN-DIR" "READ-DIR"
- ;; linux-os, sunos-os. - "UNIX-UNAME" - ;; filesys.lisp "UNIX-GETPWUID"
@@ -411,7 +408,7 @@ "TIOCSETP" "TTY-IUCLC" "TTY-OCRNL" "TTY-OFDEL" "TTY-OFILL" "TTY-OLCUC" "TTY-ONLRET" "TTY-ONOCR" - "TTY-XCASE" "UNIX-DUP2" "UNIX-GETITIMER" "UNIX-PID" "UNIX-UNAME" + "TTY-XCASE" "UNIX-DUP2" "UNIX-GETITIMER" "UNIX-PID" "UTSNAME" ) #+solaris
===================================== src/code/unix.lisp ===================================== @@ -2724,27 +2724,6 @@ (machine (array char 65)) (domainname (array char 65))))
-(defun unix-uname () - _N"Unix-uname returns information from the uname(2) system call. - The return values are - - Name of the operating system - Name of this node within some implementation-defined network, if any - Release level of this operating system - Version level of this operating system release - Name of the hardware type on which the system is running" - (with-alien ((names (struct utsname))) - (syscall* (#-(or freebsd (and x86 solaris)) "uname" - #+(and x86 solaris) "nuname" ; See /usr/include/sys/utsname.h - #+freebsd "__xuname" #+freebsd int - (* (struct utsname))) - (values (cast (slot names 'sysname) c-string) - (cast (slot names 'nodename) c-string) - (cast (slot names 'release) c-string) - (cast (slot names 'version) c-string) - (cast (slot names 'machine) c-string)) - #+freebsd 256 - (addr names)))) ;;; For asdf. Well, only getenv, but might as well make it symmetric.
===================================== src/contrib/unix/unix-glibc2.lisp ===================================== @@ -1908,5 +1908,26 @@ in at a time in poll.") :until (zerop (sap-int (alien-sap member))) :collect (string (cast member c-call:c-string))))))))
+(defun unix-uname () + _N"Unix-uname returns information from the uname(2) system call. + The return values are + + Name of the operating system + Name of this node within some implementation-defined network, if any + Release level of this operating system + Version level of this operating system release + Name of the hardware type on which the system is running" + (with-alien ((names (struct utsname))) + (syscall* (#-(or freebsd (and x86 solaris)) "uname" + #+(and x86 solaris) "nuname" ; See /usr/include/sys/utsname.h + #+freebsd "__xuname" #+freebsd int + (* (struct utsname))) + (values (cast (slot names 'sysname) c-string) + (cast (slot names 'nodename) c-string) + (cast (slot names 'release) c-string) + (cast (slot names 'version) c-string) + (cast (slot names 'machine) c-string)) + #+freebsd 256 + (addr names))))
;; EOF
===================================== src/contrib/unix/unix.lisp ===================================== @@ -929,4 +929,25 @@ _N"Unix-getpagesize returns the number of bytes in a system page." (int-syscall ("getpagesize")))
+(defun unix-uname () + _N"Unix-uname returns information from the uname(2) system call. + The return values are + + Name of the operating system + Name of this node within some implementation-defined network, if any + Release level of this operating system + Version level of this operating system release + Name of the hardware type on which the system is running" + (with-alien ((names (struct utsname))) + (syscall* (#-(or freebsd (and x86 solaris)) "uname" + #+(and x86 solaris) "nuname" ; See /usr/include/sys/utsname.h + #+freebsd "__xuname" #+freebsd int + (* (struct utsname))) + (values (cast (slot names 'sysname) c-string) + (cast (slot names 'nodename) c-string) + (cast (slot names 'release) c-string) + (cast (slot names 'version) c-string) + (cast (slot names 'machine) c-string)) + #+freebsd 256 + (addr names)))) ;; EOF
===================================== src/i18n/locale/cmucl-unix.pot ===================================== @@ -1370,18 +1370,6 @@ msgid "" " and its children." msgstr ""
-#: src/code/unix.lisp -msgid "" -"Unix-uname returns information from the uname(2) system call.\n" -" The return values are\n" -"\n" -" Name of the operating system\n" -" Name of this node within some implementation-defined network, if any\n" -" Release level of this operating system\n" -" Version level of this operating system release\n" -" Name of the hardware type on which the system is running" -msgstr "" - #: src/code/unix.lisp msgid "" "Get the value of the environment variable named Name. If no such\n"
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/compare/90a5e5690f8baa91a3484f9...