Alfred von Campe
2007-Apr-02 15:58 UTC
[CentOS] Problem with gettid() on CentOS 5/gcc 4.1.1
I can't get the simple program below to compile on CentOS 5 beta. It compiles (and runs) just fine on CentOS 4.4, and I'm using gettid() as described in the man page. I wonder if this is a problem with RHEL 5 as well, but I don't have a system to test on. I also wonder if this is a gcc 4.1.1 issue or something missing in CentOS 5. The issue is that the _syscall0 macro is not defined anywhere. If I copy and paste the following definition for _syscall0 from a CentOS 4.4 system into the test program, it works just fine: #define _syscall0(type,name) \ type name(void) \ {\ return syscall(__NR_##name);\ } Has anyone else run into this problem? Alfred #include <stdio.h> #include <sys/types.h> #include <linux/unistd.h> #include <errno.h> _syscall0(pid_t, gettid) int main(int argc, char *argv[]) { printf("My tid is 0x%08x\n", gettid()); }
Alfred von Campe
2007-Apr-02 21:22 UTC
[CentOS] Problem with gettid() on CentOS 5/gcc 4.1.1
A quick update to this topic. As I alluded to in my original post, the real issue is that the _syscall0 macro is not defined. Actually, none of the _syscallx (where x goes from 0 to 6) macros are defined in /usr/include/linux/unistd.h as they are on a CentOS 4.4 system. I grep'ed in all of /usr/include and couldn't find any references to these macros. Have they been deprecated or is this an oversight? At least one man page (gettid) still references _syscall0... Alfred
On Mon, Apr 02, 2007 at 11:58:28AM -0400, Alfred von Campe wrote:> I can't get the simple program below to compile on CentOS 5 beta. It compiles > (and runs) just fine on CentOS 4.4, and I'm using gettid() as described in the > man page. I wonder if this is a problem with RHEL 5 as well, but I don't have a > system to test on. I also wonder if this is a gcc 4.1.1 issue or something > missing in CentOS 5. > > The issue is that the _syscall0 macro is not defined anywhere. If I copy and > paste the following definition for _syscall0 from a CentOS 4.4 system into the > test program, it works just fine: > > #define _syscall0(type,name) \ > type name(void) \ > {\ > return syscall(__NR_##name);\ > } > > Has anyone else run into this problem? > > AlfredI've got an APP at work that will need to be working on RH5 and possibly Centos 5 that uses gettid(), so I'm going to hang onto your posting just in case it is a problem in the real release. Haven't tried RH5 yet, but I will be (and Centos, too, once it comes out). Thanks for the heads-up. -- ---- Fred Smith -- fredex at fcshome.stoneham.ma.us ----------------------------- But God demonstrates his own love for us in this: While we were still sinners, Christ died for us. ------------------------------- Romans 5:8 (niv) ------------------------------ -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available URL: <http://lists.centos.org/pipermail/centos/attachments/20070402/9247bb0c/attachment-0004.sig>
Alfred von Campe
2007-Apr-03 20:37 UTC
[CentOS] Problem with gettid() on CentOS 5/gcc 4.1.1
Could someone with access to a RHEL 5 system please post the output of the following command: grep -RE "#define[[:space:]]+_syscall" /usr/include I'd like to know if this problem affects RHEL 5 as well. Thanks, Alfred
Maybe Matching Threads
- error on solaris please help interlocked*functions
- [LLVMdev] multithreaded performance disaster with -fprofile-instr-generate (contention on profile counters)
- Enable Safe Stack for Baremetal?
- XRay TID mismatch when forking
- [LLVMdev] multithreaded performance disaster with -fprofile-instr-generate (contention on profile counters)