summaryrefslogtreecommitdiff
path: root/guix/build/syscalls.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2016-11-16 23:12:14 +0100
committerLudovic Courtès <ludo@gnu.org>2016-11-16 23:38:05 +0100
commitf43714e62080f8bdf1ddb02672d26527ac3819ec (patch)
tree394a4a17dc181ccfdc6fe475e4ef02a2c3e024dc /guix/build/syscalls.scm
parentd87c201f9677dd6d00ef255146fcc0652b8c41b6 (diff)
downloadguix-patches-f43714e62080f8bdf1ddb02672d26527ac3819ec.tar
guix-patches-f43714e62080f8bdf1ddb02672d26527ac3819ec.tar.gz
syscalls: C struct writer correctly handles pointer fields.
* guix/build/syscalls.scm (write-type): Add case for '*.
Diffstat (limited to 'guix/build/syscalls.scm')
-rw-r--r--guix/build/syscalls.scm5
1 files changed, 4 insertions, 1 deletions
diff --git a/guix/build/syscalls.scm b/guix/build/syscalls.scm
index 2cee6544c4..bdc9940bb3 100644
--- a/guix/build/syscalls.scm
+++ b/guix/build/syscalls.scm
@@ -202,7 +202,7 @@ result is the alignment of the \"most strictly aligned component\"."
types ...))))
(define-syntax write-type
- (syntax-rules (~ array)
+ (syntax-rules (~ array *)
((_ bv offset (type ~ order) value)
(bytevector-uint-set! bv offset value
(endianness order) (sizeof* type)))
@@ -215,6 +215,9 @@ result is the alignment of the \"most strictly aligned component\"."
((head . tail)
(write-type bv o type head)
(loop (+ 1 i) tail (+ o (sizeof* type))))))))
+ ((_ bv offset '* value)
+ (bytevector-uint-set! bv offset (pointer-address value)
+ (native-endianness) (sizeof* '*)))
((_ bv offset type value)
(bytevector-uint-set! bv offset value
(native-endianness) (sizeof* type)))))