delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2023/02/17/03:54:30

X-Recipient: archive-cygwin AT delorie DOT com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CF4E0385482D
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com;
s=default; t=1676624022;
bh=2tpS0qQFFiZcgjYI7vpk6ywI3Q5HwQYv8O+IoIGczEY=;
h=Date:To:Cc:Subject:In-Reply-To:References:List-Id:
List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe:
From:Reply-To:From;
b=cMpHRLZmrnhfgtCvsEO5u8JdVVl3JA7mTEgE8v+dwyuv/9ITTXi04/Yd9bKHFu2XG
jzf2fFIxbXCCscDL/BG2Koa+6ChasM4UrPD49V+cgSuaL9FyD0O71JNsPAyW0txZG2
q/0lzY/skklzT+GWDbTEx6BGOa4fkpM0+fSr4AZ8=
X-Original-To: cygwin AT cygwin DOT com
Delivered-To: cygwin AT cygwin DOT com
DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1FD56385B519
DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-06.nifty.com 31H8qbvn016337
X-Nifty-SrcIP: [220.150.135.41]
Date: Fri, 17 Feb 2023 17:52:37 +0900
To: <cygwin AT cygwin DOT com>
Cc: Yeo Kai Wei <yeokaiwei AT hotmail DOT com>
Subject: Re: [QUERY] Help With Semaphore Error on Windows : Cygwin
Message-Id: <20230217175237.c4dbcc3969477c3dd4d4d8a9@nifty.ne.jp>
In-Reply-To: <PH0PR05MB9918CF909700C957414348F7A4A19@PH0PR05MB9918.namprd05.prod.outlook.com>
References: <PH0PR05MB9918C60D1BF4A9A8D25DEADEA4A09 AT PH0PR05MB9918 DOT namprd05 DOT prod DOT outlook DOT com>
<Y+5E2Hftco5JMrpl AT calimero DOT vinschen DOT de>
<PH0PR05MB9918CF909700C957414348F7A4A19 AT PH0PR05MB9918 DOT namprd05 DOT prod DOT outlook DOT com>
X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.30; i686-pc-mingw32)
Mime-Version: 1.0
X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00, DKIM_SIGNED,
DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, NICE_REPLY_A, RCVD_IN_DNSWL_NONE,
SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6
X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on
server2.sourceware.org
X-BeenThere: cygwin AT cygwin DOT com
X-Mailman-Version: 2.1.29
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Unsubscribe: <https://cygwin.com/mailman/options/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=unsubscribe>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-request AT cygwin DOT com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=subscribe>
From: Takashi Yano via Cygwin <cygwin AT cygwin DOT com>
Reply-To: Takashi Yano <takashi DOT yano AT nifty DOT ne DOT jp>
Errors-To: cygwin-bounces+archive-cygwin=delorie DOT com AT cygwin DOT com
Sender: "Cygwin" <cygwin-bounces+archive-cygwin=delorie DOT com AT cygwin DOT com>

On Fri, 17 Feb 2023 12:56:06 +0800
Yeo Kai Wei wrote:
> Hi All,
> 
> Thanks for the help.
> 
> It works now.
> 
> So, the 2 things that were required
> 
> 1. Adding the '/' in front of the semaphore name so that Cygwin can 
> recognise it
> 
> #define SemaphoreName "/mysemaphore"
> 
> 2. Changing the if check from if(semptr == (void*) -1) to if(semptr == 
> (sem_t*) 0)

No. You should use:
  if (semptr == SEM_FAILED)

-- 
Takashi Yano <takashi DOT yano AT nifty DOT ne DOT jp>

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

- Raw text -


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