/[cmucl]/src/code/osf1-os.lisp
ViewVC logotype

Contents of /src/code/osf1-os.lisp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.7 - (show annotations)
Fri Mar 19 15:18:59 2010 UTC (4 years, 1 month ago) by rtoy
Branch: MAIN
CVS Tags: sparc-tramp-assem-base, post-merge-intl-branch, release-20b-pre1, release-20b-pre2, sparc-tramp-assem-2010-07-19, GIT-CONVERSION, cross-sol-x86-merged, RELEASE_20b, cross-sol-x86-base, snapshot-2010-12, snapshot-2010-11, snapshot-2011-09, snapshot-2011-06, snapshot-2011-07, snapshot-2011-04, snapshot-2011-02, snapshot-2011-03, snapshot-2011-01, snapshot-2010-05, snapshot-2010-04, snapshot-2010-07, snapshot-2010-06, snapshot-2010-08, cross-sol-x86-2010-12-20, cross-sparc-branch-base, HEAD
Branch point for: cross-sparc-branch, RELEASE-20B-BRANCH, sparc-tramp-assem-branch, cross-sol-x86-branch
Changes since 1.6: +3 -1 lines
Merge intl-branch 2010-03-18 to HEAD.  To build, you need to use
boot-2010-02-1 as the bootstrap file.  You should probably also use
the new -P option for build.sh to generate and update the po files
while building.
1 ;;; -*- Package: SYSTEM -*-
2 ;;;
3 ;;; **********************************************************************
4 ;;; This code was written as part of the CMU Common Lisp project at
5 ;;; Carnegie Mellon University, and has been placed in the public domain.
6 ;;;
7 (ext:file-comment
8 "$Header: /tiger/var/lib/cvsroots/cmucl/src/code/osf1-os.lisp,v 1.7 2010/03/19 15:18:59 rtoy Rel $")
9 ;;;
10 ;;; **********************************************************************
11 ;;;
12 ;;; OS interface functions for CMU CL under Mach.
13 ;;;
14 ;;; Written and maintained mostly by Skef Wholey and Rob MacLachlan.
15 ;;; Scott Fahlman, Dan Aronson, and Steve Handerson did stuff here, too.
16 ;;;
17 (in-package "SYSTEM")
18 (use-package "EXTENSIONS")
19 (intl:textdomain "cmucl")
20
21 (export '(get-system-info get-page-size os-init))
22
23 (pushnew :osf1 *features*)
24
25 (setq *software-type* "OSF1")
26
27 (defvar *software-version* nil "Version string for supporting software")
28
29 (defun software-version ()
30 "Returns a string describing version of the supporting software."
31 (unless *software-version*
32 (setf *software-version*
33 (string-trim '(#\newline)
34 (with-output-to-string (stream)
35 (run-program "/usr/bin/uname"
36 '("-sr")
37 :output stream)))))
38 *software-version*)
39
40
41 ;;; OS-Init initializes our operating-system interface. It sets the values
42 ;;; of the global port variables to what they should be and calls the functions
43 ;;; that set up the argument blocks for the server interfaces.
44
45 (defvar *task-self*)
46
47 (defun os-init ()
48 (setf *software-version* nil))
49
50 ;;; GET-SYSTEM-INFO -- Interface
51 ;;;
52 ;;; Return system time, user time and number of page faults. For
53 ;;; page-faults, we add pagein and pageout, since that is a somewhat more
54 ;;; interesting number than the total faults.
55 ;;;
56 (defun get-system-info ()
57 (multiple-value-bind (err? utime stime maxrss ixrss idrss
58 isrss minflt majflt)
59 (unix:unix-getrusage unix:rusage_self)
60 (declare (ignore maxrss ixrss idrss isrss minflt))
61 (unless err?
62 (error "Unix system call getrusage failed: ~A."
63 (unix:get-unix-error-msg utime)))
64 (values utime stime majflt)))
65
66
67 ;;; GET-PAGE-SIZE -- Interface
68 ;;;
69 ;;; Return the system page size.
70 ;;;
71 (defun get-page-size ()
72 (multiple-value-bind (val err)
73 (unix:unix-getpagesize)
74 (unless val
75 (error "Getpagesize failed: ~A" (unix:get-unix-error-msg err)))
76 val))
77

  ViewVC Help
Powered by ViewVC 1.1.5