Re: proper API for sched_setaffinity ?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 25 May 2005 11:50:16 -0600 Chris Friesen wrote:

> On my system (Mandrake 10.0) the man page for sched_setaffinity() lists 
> the prototype as:
> 
> int  sched_setaffinity(pid_t  pid,  unsigned  int  len,  unsigned  long
>         *mask);
> 
> 
> But /usr/include/sched.h gives it as
> 
> extern int sched_setaffinity (__pid_t __pid, __const cpu_set_t *__mask)
> 
> Which is correct?

Here "man sched_setaffinity" says:

HISTORY
       The affinity syscalls were  introduced  in  Linux  kernel  2.5.8.   The
       library  calls  were  introduced  in  glibc 2.3, and are still in glibc
       2.3.2. Later glibc 2.3.2 development versions changed this interface to
       one without the len field, and still later versions reverted again. The
       glibc prototype is now

       /* Set the CPU affinity for a task */
       extern int sched_setaffinity (pid_t pid, size_t cpusetsize,
                                     const cpu_set_t *cpuset);

       /* Get the CPU affinity for a task */
       extern int sched_getaffinity (pid_t pid, size_t cpusetsize,
                                     cpu_set_t *cpuset);

So looks like you have a version of glibc with a broken interface (and
2.3.5 here has correct prototypes).

Attachment: pgpYzcwluXrze.pgp
Description: PGP signature


[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux