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

Diff of /src/code/linux-os.lisp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.3 by toy, Mon Nov 18 13:52:24 2002 UTC revision 1.3.14.1 by rtoy, Mon Jun 14 14:42:49 2004 UTC
# Line 24  Line 24 
24    
25  (setq *software-type* "Linux")  (setq *software-type* "Linux")
26    
27    ;;; We use READ-SEQUENCE instead of READ-LINE to work around a bug in
28    ;;; the proc file system on Linux kernel 2.6.x. The select() system
29    ;;; call does not work correctly on certain files; it never reports
30    ;;; that data is available for reading. Since CMUCL's fd-streams use
31    ;;; select(), as a part of the SERVE-EVENT mechanism, normal I/O (for
32    ;;; instance with READ-CHAR or READ-LINE) will fail on these files.
33    ;;; Luckily READ-SEQUENCE does not suffer from this problem.
34    ;;;
35    ;;; We could also call "uname -r" here, but using the filesystem-based
36    ;;; interface seems cleaner.
37  (defun software-version ()  (defun software-version ()
38    "Returns a string describing version of the supporting software."    "Returns a string describing version of the supporting software."
39    (when (probe-file "/proc/version")    (when (probe-file "/proc/version")
40      (with-open-file (f "/proc/version")      (with-open-file (f "/proc/version")
41        (read-line f))))        (let* ((buf (make-string 1024))
42                 (count (read-sequence buf f :end 1024)))
43            (subseq buf 0 (1- count))))))
44    
45    
46  ;;; OS-Init initializes our operating-system interface.  ;;; OS-Init initializes our operating-system interface.

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.3.14.1

  ViewVC Help
Powered by ViewVC 1.1.5