Commit 3861a828 authored by Robert Brown's avatar Robert Brown Committed by Nikodemus Siivola
Browse files

Add support for the Linux system call gettid(), which is only accessible via syscall(2).

parent a7e75ffb
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -31,3 +31,14 @@

(defsyscall "fdatasync" :int
  (fd file-descriptor-designator))

;;;; sys/syscall.h

(defsyscall ("syscall" syscall) :int
  "Invoke the system call whose assembly language interface is selected
with NUMBER."
  (number :int))

(defun gettid ()
  "Returns the thread ID of the calling thread."
  (syscall sys-gettid))
+3 −0
Original line number Diff line number Diff line
@@ -229,8 +229,10 @@

   ;; Platform-specific Functions

   #+linux #:gettid
   #+linux #:fdatasync
   #+linux #:mremap
   #+linux #:syscall

   ;; Constants

@@ -264,6 +266,7 @@

   #+linux #:mremap-maymove
   #+linux #:mremap-fixed
   #+linux #:sys-gettid

   #:ms-async #:ms-sync #:ms-invalidate

+7 −1
Original line number Diff line number Diff line
@@ -41,7 +41,8 @@
(include "sys/types.h" "sys/stat.h" "sys/mman.h" "sys/wait.h" "fcntl.h"
         "errno.h" "signal.h" "unistd.h" "termios.h" "sys/ioctl.h" "limits.h"
         "sys/uio.h"  "time.h" "dirent.h" "pwd.h" "grp.h" "syslog.h"
         "sys/resource.h" "stdlib.h" "sys/utsname.h" "sys/statvfs.h")
         "sys/resource.h" "stdlib.h" "sys/utsname.h" "sys/statvfs.h"
         #+linux "sys/syscall.h")

(in-package #:osicat-posix)

@@ -761,3 +762,8 @@

(constant (wnohang "WNOHANG"))
(constant (wuntraced "WUNTRACED"))

;;;; from sys/syscall.h

#+linux
(constant (sys-gettid "SYS_gettid"))