__clone2(2) (from sys-apps/man-pages-3.41) claims that sched.h would declare a __clone2 function. It is exported by the C library: # scanelf -s __clone2 /lib/libc-2.15.so TYPE SYM FILE ET_DYN __clone2 /lib/libc-2.15.so But apparently no header declares it: # grep -R __clone2 /usr/include/ [empty] While some glibc-2.15 internal header *does* declare it: # grep -R __clone2 glibc-2.15/ [...] glibc-2.15/include/sched.h:extern int __clone2 (int (*__fn) (void *__arg), void *__child_stack_base, Reproducible: Always
tschwinge@freenode#glibc said that it might be necessary to add a "separate sysdeps/unix/sysv/linux/ia64/bits/sched.h, duplicating most of Linux' generic sysdeps/unix/sysv/linux/bits/sched.h". (Just quoting, since I do not know enough about glibc to contribute anything useful there.) I CC vapier as glibc's IA64 maintainer [1]. [1] http://sourceware.org/glibc/wiki/MAINTAINERS
i think you misread the man page. it does not say __clone2 is provided via sched.h, just clone. note that if you try to use clone directly, ia64 isn't the only odd case you have to handle. for arches whose stack grows in a different direction (like hppa), you'll need to pass a different value for the stack base.
(In reply to comment #2) > i think you misread the man page. it does not say __clone2 is provided via > sched.h, just clone. So I am expected to provide the declaration myself? If so, I'll open a bug on kernel.org against man-pages, to clarify that in the text.
(In reply to comment #3) currently, that's how it's always been done. note that you really really should not be using clone but instead stick to pthreads. also not that you cannot use clone in a threaded application as you will hit deadlocks (due to glibc itself using locks).
(In reply to comment #4) > (In reply to comment #3) > > currently, that's how it's always been done. note that you really really > should not be using clone but instead stick to pthreads. also not that you > cannot use clone in a threaded application as you will hit deadlocks (due to > glibc itself using locks). I am currently trying to get app-emulation/lxc to run here. I'll send them you remarks, once I have a patch ready.
Since there's no RESOLVED MISUNDERSTANDING ... Please reopen if there's anything new coming up here.