Hello all,
I'm a newbie on FreeBSD programming. I'm trying to use the POSIX semaphores to synchronize two processes. The code of my consumer is the following:
The code of my producer is the following:
On Ubuntu Linux this code works fine, while on FreeBSD I get a core dump on the functions sem_wait() and sem_post().
I printed "sem" through
and I got 0x0. Furthermore, I noticed that the directory /dev/shm does not exist.
Thank you very much for your help :beer
I'm a newbie on FreeBSD programming. I'm trying to use the POSIX semaphores to synchronize two processes. The code of my consumer is the following:
Code:
sem_t *sem = sem_open("/my_sem", O_CREATE|O_RDWR,0644,0);
sem_wait(sem);
The code of my producer is the following:
Code:
sem_t *sem = sem_open("/my_sem", O_RDWR);
sem_post(sem);
On Ubuntu Linux this code works fine, while on FreeBSD I get a core dump on the functions sem_wait() and sem_post().
I printed "sem" through
Code:
printf("%p\n",sem)
Thank you very much for your help :beer