summaryrefslogtreecommitdiff
path: root/guix/build
diff options
context:
space:
mode:
authorMarius Bakke <marius@gnu.org>2020-06-08 19:05:56 +0200
committerMarius Bakke <marius@gnu.org>2020-06-08 19:05:56 +0200
commitdd2d3ed2d30b5d705f9ed8695ab3171c29469f76 (patch)
tree22e909cfe9de99fab471621a907b9f87045bb3bd /guix/build
parent24b61fb8ea8a9e8c5320d1db1447f9b62ad04b3d (diff)
parent1fd2c00efbe701a81d86c254d5f4f285e63c1cde (diff)
downloadguix-patches-dd2d3ed2d30b5d705f9ed8695ab3171c29469f76.tar
guix-patches-dd2d3ed2d30b5d705f9ed8695ab3171c29469f76.tar.gz
Merge branch 'master' into staging
Diffstat (limited to 'guix/build')
-rw-r--r--guix/build/syscalls.scm14
1 files changed, 12 insertions, 2 deletions
diff --git a/guix/build/syscalls.scm b/guix/build/syscalls.scm
index d69b178a0a..85c1c45f81 100644
--- a/guix/build/syscalls.scm
+++ b/guix/build/syscalls.scm
@@ -1218,7 +1218,7 @@ handler if the lock is already held by another process."
;; zero.
16)
-(define (set-thread-name name)
+(define (set-thread-name!/linux name)
"Set the name of the calling thread to NAME. NAME is truncated to 15
bytes."
(let ((ptr (string->pointer name)))
@@ -1231,7 +1231,7 @@ bytes."
(list (strerror err))
(list err))))))
-(define (thread-name)
+(define (thread-name/linux)
"Return the name of the calling thread as a string."
(let ((buf (make-bytevector %max-thread-name-length)))
(let-values (((ret err)
@@ -1245,6 +1245,16 @@ bytes."
(list (strerror err))
(list err))))))
+(define set-thread-name
+ (if (string-contains %host-type "linux")
+ set-thread-name!/linux
+ (const #f)))
+
+(define thread-name
+ (if (string-contains %host-type "linux")
+ thread-name/linux
+ (const "")))
+
;;;
;;; Network interfaces.