As can be seen here:
http://sources.redhat.com/cgi-bin/cvsweb.cgi/libc/posix/sched.h?cvsroot=glibc
the sched_setaffinity() interface has changed 3 times:
rh9 = glibc-2.3.2 = int sched_setaffinity(__pid_t __pid, unsigned int
__len, unsigned long int *__mask);
fc1 = glibc-2.3.3 = int sched_setaffinity(__pid_t __pid, __const
cpu_set_t *__mask);
fc2 = glibc-cvs = int sched_setaffinity(__pid_t __pid, size_t
__cpusetsize, __const cpu_set_t *__cpuset);
Now I would like to write code that can handle all of these
and was wondering whether I could use conditional
compilation, rather than a configure script.
What I've come up with so far is:
#ifdef CPU_SET
//use glibc-2.3.2 interface
#else
//any clever way to select between the last 2?
#endif
Please don't say I need a configure script to get
a program to compile on both fc1 and fc2?
thanks,
Pádraig.
Maintained by the ILUG website team. The aim of Linux.ie is to
support and help commercial and private users of Linux in Ireland. You can
display ILUG news in your own webpages, read backend
information to find out how. Networking services kindly provided by HEAnet, server kindly donated by
Dell. Linux is a trademark of Linus Torvalds,
used with permission. No penguins were harmed in the production or maintenance
of this highly praised website. Looking for the
Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!