RFC: libpthread and cancelable syscalls -take 2-

Peter S. Mazinger ps.m at gmx.net
Wed Dec 14 13:37:13 UTC 2005


Hello!

It seems noone has an opinion on my first attempt to clarify this issue.
I have looked more into current glibc and they do not "overwrite" any 
functions it seems, so all that weak versus strong versus hidden seems to 
be unneeded.
The script sysdeps/unix/make-syscalls.sh is used to generate all these (if 
there is no special version of .c for a function, like fcntl.c)

It seems that it generates syscalls for ldso/libc/librt/libpthread.

There are 3 categories of syscalls: cancelable(C), without error 
handling(E) and with error return value(V).
The files syscalls.list list all the syscalls and their "args"
There exist uncancelable versions for 
open/close/read/write/writev/fcntl/waitpid that are used internally within 
libc.

The function itself is modified to be cancelable having 2 additions
ex. open64.c
int __libc_open64(...) {
	if (SINGLE_THREAD_P)
		return __libc_open (....);
	int oldtype = LIBC_CANCEL_ASYNC ();
	int result = __libc_open (...);
	LIBC_CANCEL_RESET (oldtype);
	return result;
}
generic settings:
SINGLE_THREAD_P (1)
LIBC_CANCEL_ASYNC 0
LIBC_CANCEL_RESET(val) ((void)(val))

that are overwritten by nptl w/
LIBC_CANCEL_ASYNC() __X_enable_asynccancel()
LIBC_CANCEL_RESET(oldtype) __X_disable_asynccancel(oldtype)

where X is libc/pthread/librt

linuxthreads was switched to this in 2002, so the current linuxthreads.old 
is either converted or can't be used.

The version that will be added by Mike is probably compatible.

all __libc_X are hidden in libc, most of __X too.

Peter

-- 
Peter S. Mazinger <ps dot m at gmx dot net>           ID: 0xA5F059F2
Key fingerprint = 92A4 31E1 56BC 3D5A 2D08  BB6E C389 975E A5F0 59F2




More information about the uClibc mailing list