/[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 - (show annotations)
Sat Jan 18 14:30:43 1997 UTC (17 years, 3 months ago) by ram
Branch: MAIN
CVS Tags: RELEASE_18a
Branch point for: RELENG_18
Werkowskis source kit 1.03.7
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 1997/01/18 14:30:43 ram Exp $")
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 ;;; Hacked into (Free)bsd-os.lisp /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/4.4Lite")
27
28 (defun software-version ()
29 "Returns a string describing version of the supporting software."
30 (string-trim '(#\newline)
31 (with-output-to-string (stream)
32 (run-program "/usr/bin/uname" '("-sr") :output stream))))
33
34
35 ;;; OS-Init initializes our operating-system interface. It sets the values
36 ;;; of the global port variables to what they should be and calls the functions
37 ;;; that set up the argument blocks for the server interfaces.
38
39 (defun os-init ()
40 nil)
41
42
43 ;;; GET-SYSTEM-INFO -- Interface
44 ;;;
45 ;;; Return system time, user time and number of page faults.
46 ;;;
47 (defun get-system-info ()
48 (multiple-value-bind (err? utime stime maxrss ixrss idrss
49 isrss minflt majflt)
50 (unix:unix-getrusage unix:rusage_self)
51 (declare (ignore maxrss ixrss idrss isrss minflt))
52 (unless err?
53 (error "Unix system call getrusage failed: ~A."
54 (unix:get-unix-error-msg utime)))
55
56 (values utime stime majflt)))
57
58
59 ;;; GET-PAGE-SIZE -- Interface
60 ;;;
61 ;;; Return the system page size.
62 ;;;
63 (defun get-page-size ()
64 ;; probably should call getpagesize()
65 4096)
66

  ViewVC Help
Powered by ViewVC 1.1.5