Good morning,
I want to allocate memory by using shmget,I want this memory to consist of 4 integers and three semaphores(type sem_t) which are going to have access to the same buffer.
How can ido that?
Thanks, in advance!
This is a discussion on Qusetion related to shared memory within the C Programming forums, part of the General Programming Boards category; Good morning, I want to allocate memory by using shmget,I want this memory to consist of 4 integers and three ...
Good morning,
I want to allocate memory by using shmget,I want this memory to consist of 4 integers and three semaphores(type sem_t) which are going to have access to the same buffer.
How can ido that?
Thanks, in advance!
Create a struct containing those items, then allocate sizeof(struct) amount of shared memory.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
I support http://www.ukip.org/ as the first necessary step to a free Europe.