X-Recipient: archive-cygwin@delorie.com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
	:list-unsubscribe:list-subscribe:list-archive:list-post
	:list-help:sender:subject:to:references:from:message-id:date
	:mime-version:in-reply-to:content-type
	:content-transfer-encoding; q=dns; s=default; b=MftIwmGgRMNu/9dC
	wHTh0225kUS7hRguZdXpXOMkvQr98bOQZRG5Z7iJPY5j63DdxDtNU47qvXrOp2TE
	E4jQ4YRpWrDkWvcTBE7Sr4EhIetHAV7N9aA9udcD18Ce4qS4gLmzpGh9RKPhYY3w
	2U8/eGKzvfisQJXSD+ZwRsuIENU=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
	:list-unsubscribe:list-subscribe:list-archive:list-post
	:list-help:sender:subject:to:references:from:message-id:date
	:mime-version:in-reply-to:content-type
	:content-transfer-encoding; s=default; bh=VRSqeEVm0O8bvYQQhuLStC
	sLIGc=; b=RT3wm+pOrgGgZj94q2eMPyVkMJWPcCyfVUpgX75bADy+Yaej+ZGvXi
	ZV4Dp2VLyuVTCEpJ9AiRctFDXivIsjX+c6VPB4W4vNPLcVQqL9pKF24SwI1AdsPy
	PtexCdOl+uw90jhSSN3hCl1pBleEjK8IuAwJXAwW0FamiL5qIlsBw=
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 spammy=
X-HELO: limerock01.mail.cornell.edu
X-CornellRouted: This message has been Routed already.
Subject: Re: Cygwin IPC - ftok() returns negative values - Bug Report
To: cygwin@cygwin.com
References: <AM3PR05MB3399758BC225C8E63BACF0FEB230@AM3PR05MB339.eurprd05.prod.outlook.com> <20160629151446.GO981@calimero.vinschen.de> <DB3PR05MB3481DD1143D413B28B2EF1BEB230@DB3PR05MB348.eurprd05.prod.outlook.com> <f067d528-3262-ab8a-0681-a4f55ab5c365@gmail.com> <DB3PR05MB348D20C938474A90C6D8602EB230@DB3PR05MB348.eurprd05.prod.outlook.com>
From: Ken Brown <kbrown@cornell.edu>
Message-ID: <1c8d0a60-1598-0546-2861-87bcf270bb90@cornell.edu>
Date: Wed, 29 Jun 2016 16:01:27 -0400
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1
MIME-Version: 1.0
In-Reply-To: <DB3PR05MB348D20C938474A90C6D8602EB230@DB3PR05MB348.eurprd05.prod.outlook.com>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
X-PMX-Cornell-Gauge: Gauge=XX
X-IsSubscribed: yes

On 6/29/2016 3:20 PM, Stanisław Wawszczak wrote:
>> On 29/06/2016 18:06, Stanisław Wawszczak wrote:
> *Real question is why Cygwin's implementation of getsem() is not allowing to ask for more than nsems == 1?*
> Here is stated, that the platform is limiting the nsems value: http://pubs.opengroup.org/onlinepubs/9699919799/functions/semget.html#tag_16_512
> This code is not working, return errno == 22 (EINVAL, I guess...)
> #include <sys/ipc.h>
> #include <sys/sem.h>
> #include <stdio.h>
> #include <errno.h>
>
> int main(int argc, char**argv)
> {
> 	int provs = 100;
> 	key_t semHandle = ftok("/etc/fstab", 'A');
> 	int sfcbSem = -1;
> 	printf("semHandle <= 0 ; (semHandle = %lld)\n", semHandle);
> 	if ((sfcbSem = semget(semHandle, 2, IPC_CREAT | IPC_EXCL | 0600)) == -1)
> 	{
> 		printf("error semget, errno = %d\n", errno);
> 	}
> 	printf("finished\n");
> 	return 0;
> }

Do you have the cygserver service running?  (See 
/usr/share/doc/Cygwin/cygserver.README.)

Ken

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

