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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1.2.1 - (show annotations)
Tue Jun 23 11:21:35 1998 UTC (15 years, 10 months ago) by pw
Branch: RELENG_18
CVS Tags: RELEASE_18b, RELEASE_18c
Changes since 1.1: +15 -10 lines
This (huge) revision brings the RELENG_18 branch up to the current HEAD.
Note code/unix-glib2.lisp not yet included -- not sure it is ready to go.
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/bsd-os.lisp,v 1.1.2.1 1998/06/23 11:21:35 pw Exp $")
9 ;;;
10 ;;; **********************************************************************
11 ;;;
12 ;;; OS interface functions for CMU CL under BSD Unix.
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 ;;; Hacked into (Free)bsd-os.lisp by Paul Werkowski.
18
19 (in-package "SYSTEM")
20 (use-package "EXTENSIONS")
21 (export '(get-system-info get-page-size os-init))
22
23 (pushnew :bsd *features*)
24 (pushnew :freebsd *features*)
25
26 (setq *software-type* #+FreeBSD "FreeBSD" #-FreeBSD "BSD")
27
28 (defvar *software-version* nil "Version string for supporting software")
29
30 (defun software-version ()
31 "Returns a string describing version of the supporting software."
32 (unless *software-version*
33 (setf *software-version*
34 (string-trim '(#\newline)
35 (with-output-to-string (stream)
36 (run-program "/usr/bin/uname"
37 '("-r")
38 :output stream)))))
39 *software-version*)
40
41
42 ;;; OS-Init initializes our operating-system interface. It sets the values
43 ;;; of the global port variables to what they should be and calls the functions
44 ;;; that set up the argument blocks for the server interfaces.
45
46 (defun os-init ()
47 (setf *software-version* nil))
48
49 ;;; GET-SYSTEM-INFO -- Interface
50 ;;;
51 ;;; Return system time, user time and number of page faults.
52 ;;;
53 (defun get-system-info ()
54 (multiple-value-bind (err? utime stime maxrss ixrss idrss
55 isrss minflt majflt)
56 (unix:unix-getrusage unix:rusage_self)
57 (declare (ignore maxrss ixrss idrss isrss minflt))
58 (unless err?
59 (error "Unix system call getrusage failed: ~A."
60 (unix:get-unix-error-msg utime)))
61
62 (values utime stime majflt)))
63
64
65 ;;; GET-PAGE-SIZE -- Interface
66 ;;;
67 ;;; Return the system page size.
68 ;;;
69 (defun get-page-size ()
70 ;; probably should call getpagesize()
71 4096)

  ViewVC Help
Powered by ViewVC 1.1.5