Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/linux/22.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Linux Cython的syscall或getId系统函数_Linux_Cython - Fatal编程技术网

Linux Cython的syscall或getId系统函数

Linux Cython的syscall或getId系统函数,linux,cython,Linux,Cython,我需要从Cython调用getId。根据其手册页,我应该使用syscall函数。我在运行Linux 我可以轻松获得getId函数号: cdef extern from "sys/syscall.h": cdef int __NR_gettid 但我找不到如何导入或更好地导入syscall 有什么想法吗 谢谢。您可以在cython的github存储库中查找这些内容是如何做到最好的,例如: 应用这一点将导致: %%cython cdef extern from "<sys/sysca

我需要从Cython调用
getId
。根据其手册页,我应该使用
syscall
函数。我在运行Linux

我可以轻松获得
getId
函数号:

cdef extern from "sys/syscall.h":
    cdef int __NR_gettid
但我找不到如何导入或更好地导入
syscall

有什么想法吗


谢谢。

您可以在cython的github存储库中查找这些内容是如何做到最好的,例如:

应用这一点将导致:

%%cython
cdef extern from "<sys/syscall.h>" nogil:
    int __NR_gettid
    long syscall(long number, ...)

def gettid():
    return syscall(__NR_gettid)
>>> gettid()
7231