Next: , Previous: , Up: srfi env-inquiry   [Index]


2.36.4 Implementation

The implementation of this SRFI is inherently system–dependent. The version shown below is for an imaginary Scheme implementation, and is in R5RS style. Trivial wrappers will convert it to an R6RS or R7RS library.

Some of the information can be derived from the uname() system call, which is provided by the POSIX standard. (Some of the same information is available on Win32 using GetSystemInfo() and GetComputerNameA().)

The exact Scheme interface to uname() is highly system–dependent.

The version below uses the Guile convention.

(define (implementation-name)
  "Fantastic Scheme")

(define (implementation-version)
  "1.0")

(define (cpu-architecture)
  (vector-ref (uname) 4)) ; POSIX machine field

(define (machine-name)
  (vector-ref (uname) 1)) ; POSIX nodename field

(define (os-name)
  (vector-ref (uname) 0)) ; POSIX sysname field

(define (os-version)
  (string-append
    (vector-ref (uname) 2)   ; POSIX version field
    " "
    (vector-ref (uname) 3))) ; POSIX release field