diff options
author | Leo Famulari <leo@famulari.name> | 2017-01-25 12:42:39 -0500 |
---|---|---|
committer | Leo Famulari <leo@famulari.name> | 2017-01-25 12:42:39 -0500 |
commit | d123f2f991e0bf6f51e5f207d291fb4c1ceb1245 (patch) | |
tree | 8ca3cbeff8a08ab9e11a0324fd9ec0bae7614f4c /guix/build | |
parent | a282d7ff174ccc13b3645359449af6052451c2a1 (diff) | |
parent | 864042c5c5f845fd3c1ae37c64dc1a672fedef28 (diff) |
Merge branch 'master' into core-updates
Diffstat (limited to 'guix/build')
-rw-r--r-- | guix/build/syscalls.scm | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/guix/build/syscalls.scm b/guix/build/syscalls.scm index 475fc96490..b68c48a05a 100644 --- a/guix/build/syscalls.scm +++ b/guix/build/syscalls.scm @@ -21,6 +21,7 @@ (define-module (guix build syscalls) #:use-module (system foreign) #:use-module (rnrs bytevectors) + #:autoload (ice-9 binary-ports) (get-bytevector-n) #:use-module (srfi srfi-1) #:use-module (srfi srfi-9) #:use-module (srfi srfi-9 gnu) @@ -142,7 +143,8 @@ utmpx-time utmpx-address login-type - utmpx-entries)) + utmpx-entries + (read-utmpx-from-port . read-utmpx))) ;;; Commentary: ;;; @@ -1598,4 +1600,13 @@ always a positive integer." ((? utmpx? entry) (loop (cons entry entries)))))) +(define (read-utmpx-from-port port) + "Read a utmpx entry from PORT. Return either the EOF object or a utmpx +entry." + (match (get-bytevector-n port sizeof-utmpx) + ((? eof-object? eof) + eof) + ((? bytevector? bv) + (read-utmpx bv)))) + ;;; syscalls.scm ends here |