All of lore.kernel.org
 help / color / mirror / Atom feed
* proper API for sched_setaffinity ?
@ 2005-05-25 17:50 Chris Friesen
  2005-05-25 18:26 ` Christoph Hellwig
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Chris Friesen @ 2005-05-25 17:50 UTC (permalink / raw)
  To: linux-kernel

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?

Chris

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: proper API for sched_setaffinity ?
  2005-05-25 17:50 proper API for sched_setaffinity ? Chris Friesen
@ 2005-05-25 18:26 ` Christoph Hellwig
  2005-05-25 18:33 ` Sergey Vlasov
  2005-05-26  9:02 ` P
  2 siblings, 0 replies; 4+ messages in thread
From: Christoph Hellwig @ 2005-05-25 18:26 UTC (permalink / raw)
  To: Chris Friesen; +Cc: linux-kernel

On Wed, May 25, 2005 at 11:50:16AM -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?

The first is the syscall, the second is an API glibc folks invented and put
into libc while beeing on crack.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: proper API for sched_setaffinity ?
  2005-05-25 17:50 proper API for sched_setaffinity ? Chris Friesen
  2005-05-25 18:26 ` Christoph Hellwig
@ 2005-05-25 18:33 ` Sergey Vlasov
  2005-05-26  9:02 ` P
  2 siblings, 0 replies; 4+ messages in thread
From: Sergey Vlasov @ 2005-05-25 18:33 UTC (permalink / raw)
  To: Chris Friesen; +Cc: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1237 bytes --]

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 #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: proper API for sched_setaffinity ?
  2005-05-25 17:50 proper API for sched_setaffinity ? Chris Friesen
  2005-05-25 18:26 ` Christoph Hellwig
  2005-05-25 18:33 ` Sergey Vlasov
@ 2005-05-26  9:02 ` P
  2 siblings, 0 replies; 4+ messages in thread
From: P @ 2005-05-26  9:02 UTC (permalink / raw)
  To: Chris Friesen; +Cc: linux-kernel

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?

The sched_setaffinity interface really is very messy:
http://mail.linux.ie/pipermail/ilug/2004-November/019784.html
API changes in same minor version of glibc should just not happen.

-- 
Pádraig Brady - http://www.pixelbeat.org
--

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2005-05-26  9:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-05-25 17:50 proper API for sched_setaffinity ? Chris Friesen
2005-05-25 18:26 ` Christoph Hellwig
2005-05-25 18:33 ` Sergey Vlasov
2005-05-26  9:02 ` P

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.