C++ gettid() was not declared in this scope

前端 未结 3 2117
轻奢々
轻奢々 2020-12-28 17:32

A simple program is: I would like to get the thread ID of both of the threads using this gettid function. I do not want to do the sysCall directly. I want to use this funct

3条回答
  •  失恋的感觉
    2020-12-28 18:10

    This is a silly glibc bug. Work around it like this:

    #include 
    #include 
    #define gettid() syscall(SYS_gettid)
    

提交回复
热议问题