Raymond Toy pushed to branch master at cmucl / cmucl
Commits: 31825793 by Raymond Toy at 2023-04-25T20:49:36+00:00 Fix #189: Move get-system-info from unix.lisp to os.lisp
- - - - - 90a5e569 by Raymond Toy at 2023-04-25T20:49:36+00:00 Merge branch 'issue-189-move-get-system-info' into 'master'
Fix #189: Move get-system-info from unix.lisp to os.lisp
Closes #189
See merge request cmucl/cmucl!141 - - - - -
5 changed files:
- src/code/os.lisp - src/code/unix.lisp - src/i18n/locale/cmucl-linux-os.pot - + src/i18n/locale/cmucl-os.pot - src/i18n/locale/cmucl-unix.pot
Changes:
===================================== src/code/os.lisp ===================================== @@ -15,7 +15,7 @@
(in-package "SYSTEM") (use-package "EXTENSIONS") -(intl:textdomain "cmucl-linux-os") +(intl:textdomain "cmucl-os")
(export '(get-page-size))
@@ -33,3 +33,27 @@ maybe-page-size))
+;;; GET-SYSTEM-INFO -- Interface +;;; +;;; Return system time, user time (in usec) and number of page +;;; faults. +;;; +(defun get-system-info () + _N"Get system information consisting of the user time (in usec), the + system time (in usec) and the number of major page faults." + (alien:with-alien ((utime unix:int64-t 0) + (stime unix:int64-t 0) + (major-fault c-call:long 0)) + (let ((rc (alien:alien-funcall + (alien:extern-alien "os_get_system_info" + (function c-call:int + (* unix:int64-t) + (* unix:int64-t) + (* c-call:long))) + (alien:addr utime) + (alien:addr stime) + (alien:addr major-fault)))) + (when (minusp rc) + (error (intl:gettext "Unix system call getrusage failed: ~A.") + (unix:get-unix-error-msg utime))) + (values utime stime major-fault))))
===================================== src/code/unix.lisp ===================================== @@ -2921,28 +2921,3 @@ (extern-alien "os_get_locale_codeset" (function (* char)))) c-string)) - -;;; GET-SYSTEM-INFO -- Interface -;;; -;;; Return system time, user time (in usec) and number of page -;;; faults. -;;; -(defun get-system-info () - "Get system information consisting of the user time (in usec), the - system time (in usec) and the number of major page faults." - (with-alien ((utime int64-t 0) - (stime int64-t 0) - (major-fault c-call:long 0)) - (let ((rc (alien-funcall - (extern-alien "os_get_system_info" - (function c-call:int - (* int64-t) - (* int64-t) - (* c-call:long))) - (addr utime) - (addr stime) - (addr major-fault)))) - (when (minusp rc) - (error (intl:gettext "Unix system call getrusage failed: ~A.") - (unix:get-unix-error-msg utime))) - (values utime stime major-fault))))
===================================== src/i18n/locale/cmucl-linux-os.pot ===================================== @@ -19,14 +19,6 @@ msgstr "" msgid "Getpagesize failed: ~A" msgstr ""
-#: src/code/os.lisp -msgid "Return the system page size" -msgstr "" - -#: src/code/os.lisp -msgid "get-page-size failed: ~A" -msgstr "" - #: src/code/signal.lisp msgid "Stack fault on coprocessor" msgstr ""
===================================== src/i18n/locale/cmucl-os.pot ===================================== @@ -0,0 +1,35 @@ +#@ cmucl-os + +# SOME DESCRIPTIVE TITLE +# FIRST AUTHOR EMAIL@ADDRESS, YEAR +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: YEAR-MO-DA HO:MI +ZONE\n" +"Last-Translator: FULL NAME EMAIL@ADDRESS\n" +"Language-Team: LANGUAGE LL@li.org\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: src/code/os.lisp +msgid "Return the system page size" +msgstr "" + +#: src/code/os.lisp +msgid "get-page-size failed: ~A" +msgstr "" + +#: src/code/os.lisp +msgid "" +"Get system information consisting of the user time (in usec), the\n" +" system time (in usec) and the number of major page faults." +msgstr "" + +#: src/code/os.lisp +msgid "Unix system call getrusage failed: ~A." +msgstr "" +
===================================== src/i18n/locale/cmucl-unix.pot ===================================== @@ -1444,13 +1444,3 @@ msgstr "" msgid "Get the codeset from the locale" msgstr ""
-#: src/code/unix.lisp -msgid "" -"Get system information consisting of the user time (in usec), the\n" -" system time (in usec) and the number of major page faults." -msgstr "" - -#: src/code/unix.lisp -msgid "Unix system call getrusage failed: ~A." -msgstr "" -
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/compare/412d65234e9caf87ba2f9bb...