delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2005/01/06/08:50:57

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
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
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
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 (&notify_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/

- Raw text -


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