[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
28/28: syscalls: set-thread-name, thread-name: Stub for the Hurd.
From: |
guix-commits |
Subject: |
28/28: syscalls: set-thread-name, thread-name: Stub for the Hurd. |
Date: |
Sat, 30 May 2020 11:20:20 -0400 (EDT) |
janneke pushed a commit to branch wip-hurd-vm
in repository guix.
commit b73d83f2175f5f20c5cf720af8a951c926fa975e
Author: Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
AuthorDate: Sat May 30 15:11:49 2020 +0200
syscalls: set-thread-name, thread-name: Stub for the Hurd.
Avoid crash
Backtrace:
guix/build/syscalls.scm:405:8: In procedure prctl: Function not
implemented
because of missing prctl on the Hurd.
* guix/build/syscalls.scm (set-thread-name, thread-name): Rename to ...
(set-thread-name!/linux,thread-name/linux): ...this.
(set-thread-name, thread-name): Swtich between linux implementation and or
stub.
---
guix/build/syscalls.scm | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/guix/build/syscalls.scm b/guix/build/syscalls.scm
index d69b178..549346c 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
+ (cute const #f)))
+
+(define thread-name
+ (if (string-contains %host-type "linux")
+ thread-name/linux
+ (cute const "")))
+
;;;
;;; Network interfaces.
- 15/28: system: Add 'multiboot-modules' field to <boot-parameters>., (continued)
- 15/28: system: Add 'multiboot-modules' field to <boot-parameters>., guix-commits, 2020/05/30
- 18/28: system: examples: Add bare-hurd.tmpl., guix-commits, 2020/05/30
- 13/28: system: Add 'hurd' field to <operating-system>., guix-commits, 2020/05/30
- 17/28: system: Use 'hurd' package in label., guix-commits, 2020/05/30
- 16/28: bootloader: grub: Add support for multiboot., guix-commits, 2020/05/30
- 23/28: services: Add `hurd-console-service-type'., guix-commits, 2020/05/30
- 26/28: system: hurd: Remove 'cross-hurd-image' hack., guix-commits, 2020/05/30
- 21/28: services: hurd: Use activation-service, hurd-etc-service., guix-commits, 2020/05/30
- 27/28: system: bare-hurd.tmpl: Add openssh client and service., guix-commits, 2020/05/30
- 24/28: services: Add `hurd-getty-service-type'., guix-commits, 2020/05/30
- 28/28: syscalls: set-thread-name, thread-name: Stub for the Hurd.,
guix-commits <=
- 19/28: services: hurd: Add `hurd-etc-service'., guix-commits, 2020/05/30
- 20/28: system: Add `hurd-activation'., guix-commits, 2020/05/30
- 22/28: gnu: hurd: Create minimal "runsystem" script to invoke "rc"., guix-commits, 2020/05/30
- 25/28: system: hurd: Populate services., guix-commits, 2020/05/30