Subj : problem with sem_open To : comp.programming.threads From : Mozis Date : Thu Mar 10 2005 01:11 am I'm getting segmentation fault with following code: int main () { int val; sem_t *sem; sem = sem_open ("/tmp/testsem1", O_RDWR | O_CREAT, FILE_MODE, 1); printf ("sem = %p %x\n",sem,sem); sem_getvalue (sem, &val); printf ("val = %d\n", val); return 0; } O/P : sem = (nil) 0 segmentation fault. I could not figure out what went wrong with the code.plz help me out. I'm using RHEL 3 , kenel v2.4.21-8, gcc 3.2.3 Thanx in advance. Regards, Mozis .