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: Cc: Yeo Kai Wei Subject: Re: [QUERY] Help With Semaphore Error on Windows : Cygwin Message-Id: <20230217175237.c4dbcc3969477c3dd4d4d8a9@nifty.ne.jp> In-Reply-To: References: 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 Precedence: list List-Id: General Cygwin discussions and problem reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Takashi Yano via Cygwin Reply-To: Takashi Yano Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: cygwin-bounces+archive-cygwin=delorie DOT com AT cygwin DOT com Sender: "Cygwin" 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 -- 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