Skip to content
Snippets Groups Projects
Commit 90a5e569 authored by Raymond Toy's avatar Raymond Toy
Browse files

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
parents 412d6523 31825793
No related branches found
No related tags found
No related merge requests found
......@@ -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))))
......@@ -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))))
......@@ -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 ""
......
#@ 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 ""
......@@ -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 ""
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment