cancellation variant for uClibc?

Mike Frysinger vapier at gentoo.org
Fri Aug 25 20:20:42 UTC 2006


On Friday 25 August 2006 10:20, Paul Brook wrote:
> > With the introduction of NPTL into uClibc, how this will change, if it
> > will? If I understood what Peter is suggesting, we should have:
> >
> > __libc_open defined as GLOBAL into libc.so.0 (not cancellable) + open as
> > weak alias
> >  open (cancellable) as GLOBAL into libpthread (and __libc_open an UND
> > symbol).
>
> No. The libc version is cancellable, and libpthread does not provide
> anything.

for the sake of sanity i'd agree this is the way to go ... that way we dont 
have to verify every pthread implementation has all the cancel points 
implemented properly (linuxthreads.old atm is missing a bunch)

so our libc functions would turn into like (ugly hand typed pseudo code):

#ifdef UCLIBC_HAS_THREADS
extern weak_function pthread_setcanceltype(...);
#endif

int open(...) {
#ifdef UCLIBC_HAS_THREADS
	int multi_thread = !IS_SINGLE_THREAD();
	int oldtype;
	if (unlikely(!just_one_thread && pthread_setcanceltype != NULL))
		pthread_setcanceltype(ASYNC, &oldtype);
#endif
	<normal open code>
#ifdef UCLIBC_HAS_THREADS
	if (unlikely(!just_one_thread && pthread_setcanceltype != NULL))
		pthread_setcanceltype(oldtype, NULL);
#endif
	return <result from normal open code>;
}
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 827 bytes
Desc: not available
Url : http://lists.busybox.net/pipermail/uclibc/attachments/20060825/0a07c18e/attachment-0002.pgp 


More information about the uClibc mailing list