X-Recipient: archive-cygwin AT delorie DOT 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 AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT 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 AT cygwin DOT com References: <20160629151446 DOT GO981 AT calimero DOT vinschen DOT de> From: Ken Brown 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: 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 > #include > #include > #include > > 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