delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2001/11/28/12:06:58

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin AT sources DOT redhat DOT com
Message-ID: <20011128170550.78398.qmail@web11603.mail.yahoo.com>
Date: Wed, 28 Nov 2001 09:05:50 -0800 (PST)
From: Marcello <piteko AT yahoo DOT com>
Subject: semget and permission denied
To: cygwin AT cygwin DOT com
MIME-Version: 1.0

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019