From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 103645 invoked by alias); 11 Mar 2016 10:19:14 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 103388 invoked by uid 89); 11 Mar 2016 10:19:12 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.1 required=5.0 tests=AWL,BAYES_00,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy=semaphore X-HELO: mail-wm0-f53.google.com Received: from mail-wm0-f53.google.com (HELO mail-wm0-f53.google.com) (74.125.82.53) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Fri, 11 Mar 2016 10:19:07 +0000 Received: by mail-wm0-f53.google.com with SMTP id l68so11856261wml.0 for ; Fri, 11 Mar 2016 02:19:07 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:date:message-id:subject:from:to; bh=6j1yi1hy/q8rBCMDIZQK0Ar6Y7zHYo+/iOSqGDwQeLw=; b=hiGTwy3xCFbYRQFam6F2eCDERfg0SBY8rFAx5lg5fhMdns+1mFRXkyvvW3r0MTfMna ci20Peyv8482uRQD6okcRBrdbtK2E71le4q9tjaf7L7Y7zChsKZawIWCVwRGVQpxPRYZ 7DZlyvcJwBR1WekQKKjLZux2xJ5HsHvr+TS70DTp+Bh9xKi2ZSLpL7w3UCr5kfp7v4wE 3LKj08yBTelrburIbVR50Rm08qOT94/GAK5vVdT4KZy4ZObv2qHAqMdDA7OvYH+Ua2H+ afaAApnXmunYCIQ3uyR9E4k2yx1UTXyK3mkKafrFt465vAS0ihsSvPt5mB6CCSaa9sC2 gdpQ== X-Gm-Message-State: AD7BkJIpbg5UZpy4HaMsIRWG0gir3dZ/+MEndaSvG/hvuLXpo2ntEbbAUe1njWqUr86xQ/Z8akBI6axfPRAd6Q== MIME-Version: 1.0 X-Received: by 10.28.63.13 with SMTP id m13mr2068866wma.55.1457691544577; Fri, 11 Mar 2016 02:19:04 -0800 (PST) Received: by 10.194.92.229 with HTTP; Fri, 11 Mar 2016 02:19:04 -0800 (PST) Date: Fri, 11 Mar 2016 10:19:00 -0000 Message-ID: Subject: SEMCTL fails with error 22 From: Meenakshi Pant To: cygwin@cygwin.com Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2016-03/txt/msg00148.txt.bz2 Hi, My program creates a semaphore, but moving further the SEMCTL function is failing with error 22 with the latest CYGWIN 2.4. The cygserver is up. Below is the simplified code as a test case.It fails with the same error as my original program. /* semtest.c - program to test semaphore */ #include #include #include #include #include #include extern int errno; #define KEY (1492) void main() { int id; printf("\n Semaphore Test"); union semun { int val; struct semid_ds *buf; ushort * array; } argument; argument.val = 0; id = semget(KEY, 1, 0666 | IPC_CREAT); if(id < 0) { printf("\n Unable to obtain semaphore %d ", errno); exit(0); } printf("\n Semaphore created successfully %d ", id); printf("\n Value before errno = %d", errno ); errno = 0; if( semctl(id, 0, SETVAL, argument) < 0) { printf("\nCannot set semaphore value.errno = %d", errno ); } else { printf("Semaphore %d initialized.\n", KEY); } } Thanks -- 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