From 881412da8f41ea4f4c7c621ea840feaba6fec919 Mon Sep 17 00:00:00 2001 From: Rohan Prinja Date: Thu, 16 Jul 2015 13:26:48 +0530 Subject: [PATCH 3/5] guix/build/syscalls.scm: remove unneeded low-level accessor --- guix/build/syscalls.scm | 27 --------------------------- 1 file changed, 27 deletions(-) diff --git a/guix/build/syscalls.scm b/guix/build/syscalls.scm index 800a3a8..a50a9bf 100644 --- a/guix/build/syscalls.scm +++ b/guix/build/syscalls.scm @@ -593,33 +593,6 @@ sockaddr' from an record type." ((next name-ptr flags addr netmask broadaddr data) flags))) -(define (ifaddrs-pointer->bv ptr) - "Return a bytevector aliasing the memory pointed to by a -'struct ifaddrs' pointer, passed as a pointer object PTR." - (pointer->bytevector ptr (sizeof %struct-ifaddrs-type))) - -;; Return the bytevector aliasing the memory pointed to by -;; the ifa-next field in a 'struct ifaddrs' pointer passed in -;; as a bytevector. -(define next-ifaddr - (compose ifaddrs-pointer->bv - next-ifaddr-ptr)) - -(define (next-ifaddr-ptr bv) - "Return a bytevector aliasing the memory pointed to by the -ifa_next field of a struct ifaddrs* pointer passed as a -bytevector BV." - (let* ((ptr-size (sizeof '*)) - (address (cond ((= ptr-size 4) (bytevector-u32-native-ref bv 0)) - ((= ptr-size 8) (bytevector-u64-native-ref bv 0))))) - (make-pointer address))) - -;; Is an interface the last in the intrusive linked list of struct ifaddrs? -;; Here, IFADDRS is a bytevector aliasing the memory pointed to by -;; a 'struct ifaddrs' pointer. -(define-syntax-rule (last-interface? ifaddrs) - (null-pointer? (next-ifaddr-ptr ifaddrs))) - (define (write-socket-address! sockaddr bv index) "Write SOCKADDR, a socket address as returned by 'make-socket-address', to bytevector BV at INDEX." -- 1.9.1