Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm 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 Message-ID: <1105019442.41dd4232c0e7b@imp1-q.free.fr> Date: Thu, 6 Jan 2005 14:50:42 +0100 From: claude DOT roblez AT free DOT fr To: cygwin AT cygwin DOT com Subject: timer_create / POSIX non conformance ? MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit User-Agent: Internet Messaging Program (IMP) 3.2.5 The problem appears with the [timer_create] function called with a [sigevent] structure having its [sigev_notify] member set to [SIGEV_THREAD]. In this case, the function pointed to by the [sigev_notify_function] member is prototyped [void(*)(union sigval)] and should receive the [sigev_value] member. (according to "The Open Group Base Specifications Issue 6 IEEE Std 1003.1, 2004 Edition") On various Linux systems (Debian, Fedora...), the behaviour is appropriate. Under Cygwin, in order to perform correctly, I have to declare my function : static void SignalTimer(union sigval *sig) instead of : static void SignalTimer(union sigval sig). Actually, the function receives a pointer to the sigev_value member rather than the union itself. I had a glance at the cygwin source code (file: timer.cc) case SIGEV_THREAD: { pthread_t notify_thread; debug_printf ("%p starting thread", x); int rc = pthread_create (¬ify_thread, tt.evp.sigev_notify_attributes,(void * (*) (void *)) tt.evp.sigev_notify_function,&tt.evp.sigev_value); The last argument: [&tt.evp.sigev_value] is probably wrong (passing an address) FYI: installed cygwin 1.5.12-1 on XP SP2 Any comments and/or a fix in an upcoming snapshot or release will be appreciated. Claude Roblez -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/