Mail Archives: cygwin/2001/11/28/12:06:58
Hi,
I am working with semaphores. When I try to get a semaphore, I use
semget, but it returns me a value <0. The strerror is: Permission
denied
I tried in different ways, but it still doesn't work...
Can you help me?
--------------------------------------------------------------------
#include <sys/types.h>
#include <sys/ipc.h>
union semun {
int val;
struct semid_ds *buf;
ushort * array;
} argument;
#include <sys/sem.h>
#include <stdio.h>
#include <errno.h>
extern int errno;
main()
{
key_t id;
int c=19;
if (( id=semget((key_t)ftok("./semabinit.c", c), 1, 0666 |
IPC_CREAT))== -1)
printf("strerror says open failed: %s\n", strerror( errno ) );
return(id);
}
=====
c:\>ptk
__________________________________________________
__________________________________________________
Do You Yahoo!?
Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month.
http://geocities.yahoo.com/ps/info1
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/
- Raw text -