This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: problem in aio_notify.c in glibc 2.1.92?


On Tue, 15 Aug 2000, Kevin B. Hendricks wrote:

> We on ppc seem to be passing the value of the sival_int but expecting a
> pointer. This jives with what Geoff said about the ABI.
> 
> So how do we fix this?

You rewrite the function call so that it follows the type system of the
language. This will require bouncing the control through an intermediate
static function within aio_notify.c:

    static void *notify_func_wrapper(void *arg)
    {

You use the void * parameter of this function to pass in a pointer to the
right context information so that a call can be made to to the user's
registered notification function. The call will pass the union directly, e.g

	struct sigevent *sigev = arg;
	sigev->sigev_notify_function(sigev->sigev_value);
	return 0;
    }

The pthread_create call is then modified:

    if (pthread_create(&tid, pattr, notify_func_wrapper, sigev) < 0)
	result = -1;

Try this, see if tst-aio5.c passes.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]