syscalls: Second argument of packed-struct read is now optional.
* guix/build/syscalls.scm (define-c-struct)[read]: OFFSET defaults to 0. (unfold-interface-list): Remove second argument to 'read-ifaddrs'. (terminal-window-size): Remove second argument to 'read-winsize'.
This commit is contained in:
parent
73f38d5ff3
commit
f77863a09e
|
@ -199,7 +199,7 @@ structure with the given TYPES. READ uses WRAP-FIELDS to return its value."
|
||||||
(begin
|
(begin
|
||||||
(define (write! bv offset fields ...)
|
(define (write! bv offset fields ...)
|
||||||
(write-types bv offset (types ...) (fields ...)))
|
(write-types bv offset (types ...) (fields ...)))
|
||||||
(define (read bv offset)
|
(define* (read bv #:optional (offset 0))
|
||||||
(read-types wrap-fields bv offset (types ...) ()))))))
|
(read-types wrap-fields bv offset (types ...) ()))))))
|
||||||
|
|
||||||
|
|
||||||
|
@ -858,8 +858,7 @@ return the list of resulting <interface> objects."
|
||||||
(result '()))
|
(result '()))
|
||||||
(if (null-pointer? ptr)
|
(if (null-pointer? ptr)
|
||||||
(reverse result)
|
(reverse result)
|
||||||
(match (read-ifaddrs (pointer->bytevector ptr %sizeof-ifaddrs)
|
(match (read-ifaddrs (pointer->bytevector ptr %sizeof-ifaddrs))
|
||||||
0)
|
|
||||||
((ifaddr . ptr)
|
((ifaddr . ptr)
|
||||||
(loop ptr (cons ifaddr result)))))))
|
(loop ptr (cons ifaddr result)))))))
|
||||||
|
|
||||||
|
@ -921,8 +920,7 @@ corresponds to the TIOCGWINSZ ioctl."
|
||||||
(ret (%ioctl (fileno port) TIOCGWINSZ size))
|
(ret (%ioctl (fileno port) TIOCGWINSZ size))
|
||||||
(err (errno)))
|
(err (errno)))
|
||||||
(if (zero? ret)
|
(if (zero? ret)
|
||||||
(read-winsize (pointer->bytevector size (sizeof winsize-struct))
|
(read-winsize (pointer->bytevector size (sizeof winsize-struct)))
|
||||||
0)
|
|
||||||
(throw 'system-error "terminal-window-size" "~A"
|
(throw 'system-error "terminal-window-size" "~A"
|
||||||
(list (strerror err))
|
(list (strerror err))
|
||||||
(list err)))))
|
(list err)))))
|
||||||
|
|
Loading…
Reference in New Issue