delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2016/06/29/15:21:11

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:from:to:subject:date:message-id:references
:in-reply-to:content-type:content-transfer-encoding
:mime-version; q=dns; s=default; b=rXaT4Y9ZGHnTmgTmL+op+dtEXyLbs
ka9qQZksBZucmzJw1Ml971uo8D47+Fwyr+G0grDVXZ+5PgzI7AofXJqg/B9SCKDG
/7sXXLtuHAihZC5vOfijryJBgNjnr0mTbmnIskWMoCs1UTXMpP6b5kvoC5kKtdbA
kj7TCkt2uDE+bQ=
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:from:to:subject:date:message-id:references
:in-reply-to:content-type:content-transfer-encoding
:mime-version; s=default; bh=NTm7g/YYHzrwgHzy3cN9SIAptPQ=; b=FR8
l4a71ZwNrJo2JQaGyShnFxSb1qq7zOPLc0i83twSXnLo0qwm1sbpceACQ/cvMkWD
cgj9EIcvfp5ox7dISru9j5ZQ5qskdqGLL0HfE2DHdadxv7uwEXqrWrQ7bQqTz6b0
nX5Dpc30H7koBZIweQI1BSYM53OUAqhtOzh2nYn8=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
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=-4.6 required=5.0 tests=AWL,BAYES_50,MIME_BASE64_BLANKS,RCVD_IN_DNSWL_NONE,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 spammy=key_t, char**argv, ipch, semHandle
X-HELO: emea01-am1-obe.outbound.protection.outlook.com
From: =?utf-8?B?U3RhbmlzxYJhdyBXYXdzemN6YWs=?= <stanislaw DOT wawszczak AT iscg DOT pl>
To: Marco Atzeri <marco DOT atzeri AT gmail DOT com>,
"cygwin AT cygwin DOT com" <cygwin AT cygwin DOT com>
Subject: RE: Cygwin IPC - ftok() returns negative values - Bug Report
Date: Wed, 29 Jun 2016 19:20:38 +0000
Message-ID: <DB3PR05MB348D20C938474A90C6D8602EB230@DB3PR05MB348.eurprd05.prod.outlook.com>
References: <AM3PR05MB3399758BC225C8E63BACF0FEB230 AT AM3PR05MB339 DOT eurprd05 DOT prod DOT outlook DOT com> <20160629151446 DOT GO981 AT calimero DOT vinschen DOT de> <DB3PR05MB3481DD1143D413B28B2EF1BEB230 AT DB3PR05MB348 DOT eurprd05 DOT prod DOT outlook DOT com> <f067d528-3262-ab8a-0681-a4f55ab5c365 AT gmail DOT com>
In-Reply-To: <f067d528-3262-ab8a-0681-a4f55ab5c365@gmail.com>
authentication-results: spf=none (sender IP is ) smtp.mailfrom=stanislaw DOT wawszczak AT iscg DOT pl;
x-ms-office365-filtering-correlation-id: 9feae68a-3a17-4426-2769-08d3a052749c
x-microsoft-exchange-diagnostics: 1;DB3PR05MB345;6:0jPOO5kiz8e+awHDI+rsnS8t9scyWj/ksbAFtJWjmeA+1VEWz2Lv2SipNO36HNmu7d2H9baliOR2sXk4dfeAfBsL1ih097lSNxrD1y6Pl06RklVUIUUURuaAmGN2rC9Jba03/Op+EkZWtVAs9cAEeHjikWF1h9Mn5LhsSJMOwxtysMLOlDCLhhdI0cI2eydjfsARUt2+xls6SGJF2vL+4BrzzGrL0f/CLXdQOJw8dDbzL6tnoLYvYNvKqVkWR3VMvfbR45yY9f7p5FGYbR5UXNe7oolQBjGt76Y1YuL6pPLMol+qXbIlhXUtNcQQhPpH;5:gTnHdFsH8AOsxMSEBPbGqNsqJSnX2h2iMEoV6VgeWydf03SQeixd0URZSW16Ar84EK/N8Q39NB2k22cq91YCPPYNuNN6TXgnNWKQPxbt8wwmg1rsFN+ha37grOD9ReutdqNVzc6lC7woAeJC/fYfHA==;24:KFuilEvsDrAtV+5BbieMl4g/fINkmnuLDN7J/CiS8gvy7nEK+i0mfmavD7PejhZuXNBNks5SXJQRoYBMH6McAAc20xFiNTiMAYI/aFSiZZU=;7:2ZS1T8NjMIlwwghXLDU8GnImtqCeNGEhIG5JgKHyfnGSXxkKgSNMa9hMhixREI2sKycLnDb7oMym0/JQd5/riEgdtSmhWin2QhPJZoVh8rgT4HZyx76Zq/QJj918KD+nq98skx3JTgCmsLRUsLaAsjikI01P4x3tAf6gI74C4N7fm7DHDld/69jl/RHn/RLMPMNQpJibGZ9U7Z81757S+GlOQxJB3Jss/JJbKyNZrzq06+J8OSNBFoTWRROCvOfM
x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:DB3PR05MB345;
x-microsoft-antispam-prvs: <DB3PR05MB345E5A64D8C9E26664F7216EB230 AT DB3PR05MB345 DOT eurprd05 DOT prod DOT outlook DOT com>
x-exchange-antispam-report-test: UriScan:(20558992708506);
x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(6040130)(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046)(6041072)(6043046);SRVR:DB3PR05MB345;BCL:0;PCL:0;RULEID:;SRVR:DB3PR05MB345;
x-forefront-prvs: 09888BC01D
x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(6009001)(7916002)(199003)(24454002)(189002)(2900100001)(7846002)(50986999)(89622001)(74316001)(101416001)(15395725005)(93886004)(586003)(3846002)(76176999)(54356999)(3280700002)(19580395003)(9686002)(5003600100003)(8936002)(11100500001)(19300405004)(2501003)(77096005)(2950100001)(15975445007)(66066001)(7696003)(122556002)(305945005)(7736002)(8676002)(81166006)(81156014)(74482002)(2906002)(106356001)(5001770100001)(102836003)(10400500002)(85182001)(68736007)(92566002)(107886002)(189998001)(87936001)(97736004)(33656002)(6116002)(105586002)(86362001)(5002640100001)(85202003)(3660700001)(76576001)(562404015);DIR:OUT;SFP:1102;SCL:1;SRVR:DB3PR05MB345;H:DB3PR05MB348.eurprd05.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en;
received-spf: None (protection.outlook.com: iscg.pl does not designate permitted sender hosts)
spamdiagnosticoutput: 1:99
spamdiagnosticmetadata: NSPM
MIME-Version: 1.0
X-OriginatorOrg: iscg.pl
X-MS-Exchange-CrossTenant-originalarrivaltime: 29 Jun 2016 19:20:38.9021 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 5d91e211-393e-4cc2-bc59-c077247cadc0
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB3PR05MB345
X-IsSubscribed: yes
X-MIME-Autoconverted: from base64 to 8bit by delorie.com id u5TJL7qN026048

>On 29/06/2016 18:06, Stanisław Wawszczak wrote:
>> Dear Corinna,
>>
>> I am sorry about confusing you.
>> Simply:
>>
>> ----------------------------- Issue 
>> ------------------------------------
>> Call to ftok() returns negative value
>
> Hi Stanisław,
>
> may be I am missing somthing, but nothing on http://pubs.opengroup.org/onlinepubs/9699919799/functions/ftok.html
> 
> suggest me that the return value must be positive

Hi Marco,

You are absolutely right. But all code examples, what I have seen including sblim-sfcbd (what I have to compile) is testing result from ftok() as positive value.
The case-test code is working on native linux with positive value returned from ftok().

I have made some tests and I have stated that making call to getsem() on Cygwin with nsems == 1 is working with negative key returned from ftok.

So this is not my case at all. I am really sorry about wrong question. 

*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;
}

> Regards
> Marco


--
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


- Raw text -


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