我需要gettid從賽頓打電話。根據其手冊頁,我應該使用該syscall功能。我正在運行Linux。我可以輕松獲得gettid函數編號:cdef extern from "sys/syscall.h":
cdef int __NR_gettid但是我找不到如何導入或更佳的cimport syscall。有任何想法嗎?
1 回答

眼眸繁星
TA貢獻1873條經驗 獲得超9個贊
您可以在cython的github存儲庫中查找,如何最好地完成其中的包含,例如:stdio.h。
將其應用到:
%%cython
cdef extern from "<sys/syscall.h>" nogil:
int __NR_gettid
long syscall(long number, ...)
def gettid():
return syscall(__NR_gettid)
現在gettid()產生:
>>> gettid()
7231
- 1 回答
- 0 關注
- 261 瀏覽
添加回答
舉報
0/150
提交
取消