me
/
guix
Archived
1
0
Fork 0

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.
master
Jan (janneke) Nieuwenhuizen 2020-05-30 15:11:49 +02:00 committed by Jan Nieuwenhuizen
parent 4c26229ccb
commit 1428926f1f
No known key found for this signature in database
GPG Key ID: F3C1A0D9C1D65273
1 changed files with 12 additions and 2 deletions

View File

@ -1218,7 +1218,7 @@ handler if the lock is already held by another process."
;; zero. ;; zero.
16) 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 "Set the name of the calling thread to NAME. NAME is truncated to 15
bytes." bytes."
(let ((ptr (string->pointer name))) (let ((ptr (string->pointer name)))
@ -1231,7 +1231,7 @@ bytes."
(list (strerror err)) (list (strerror err))
(list err)))))) (list err))))))
(define (thread-name) (define (thread-name/linux)
"Return the name of the calling thread as a string." "Return the name of the calling thread as a string."
(let ((buf (make-bytevector %max-thread-name-length))) (let ((buf (make-bytevector %max-thread-name-length)))
(let-values (((ret err) (let-values (((ret err)
@ -1245,6 +1245,16 @@ bytes."
(list (strerror err)) (list (strerror err))
(list 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. ;;; Network interfaces.