Public bug reported:

Binary package hint: manpages-dev

The manual page for sched_setaffinity and sched_getaffinity system calls
contains an inaccuracy that prohibits linking of programs that use void
CPU_CLR(int cpu, cpu_set_t *set), int CPU_ISSET(int cpu, cpu_set_t
*set), void CPU_SET(int cpu, cpu_set_t *set), void CPU_ZERO(cpu_set_t
*set).

The above mentioned functions are documented as follows (fragment from
`man sched_setaffinity`):


SCHED_SETAFFINITY(2)       Linux Programmer’s Manual      SCHED_SETAFFINITY(2)

NAME
       sched_setaffinity,   sched_getaffinity,  CPU_CLR,  CPU_ISSET,  CPU_SET,
       CPU_ZERO - set and get a process’s CPU affinity mask

SYNOPSIS
       #include <sched.h>

       int sched_setaffinity(pid_t pid, unsigned int cpusetsize,
                             cpu_set_t *mask);

       int sched_getaffinity(pid_t pid, unsigned int cpusetsize,
                             cpu_set_t *mask);

       void CPU_CLR(int cpu, cpu_set_t *set);
       int CPU_ISSET(int cpu, cpu_set_t *set);
       void CPU_SET(int cpu, cpu_set_t *set);
       void CPU_ZERO(cpu_set_t *set);

.........


These sched_setaffinity and sched_getaffinity system calls wrappers are defined 
in /usr/include/sched.h but the definitions are copied by the preprocessor only 
if _GNU_SOURCE is defined:

#ifdef __USE_GNU
/* Access macros for `cpu_set'.  */
# define CPU_SETSIZE __CPU_SETSIZE
# define CPU_SET(cpu, cpusetp)   __CPU_SET (cpu, cpusetp)
# define CPU_CLR(cpu, cpusetp)   __CPU_CLR (cpu, cpusetp)
# define CPU_ISSET(cpu, cpusetp) __CPU_ISSET (cpu, cpusetp)
# define CPU_ZERO(cpusetp)       __CPU_ZERO (cpusetp)
# define CPU_COUNT(cpusetp)      __CPU_COUNT (cpusetp)


/* Set the CPU affinity for a task */
extern int sched_setaffinity (__pid_t __pid, size_t __cpusetsize,
                              __const cpu_set_t *__cpuset) __THROW;

/* Get the CPU affinity for a task */
extern int sched_getaffinity (__pid_t __pid, size_t __cpusetsize,
                              cpu_set_t *__cpuset) __THROW;
#endif

The __USE_GNU definition is defined if and only if _GNU_SOURCE is
defined (see /usr/include/features.h ).


Fix: in the manual, specify that _GNU_SOURCE should be defined before including 
sched.h.


Package version:
[EMAIL PROTECTED]:~$ apt-cache show manpages-dev
Package: manpages-dev
Priority: optional
Section: doc
Installed-Size: 2960
Maintainer: Ubuntu Core Developers <[EMAIL PROTECTED]>
Original-Maintainer: Martin Schulze <[EMAIL PROTECTED]>
Architecture: all
Source: manpages
Version: 2.62-1
Replaces: glibc-doc (<< 2.3.6-8)
Depends: manpages
Suggests: man-browser
Filename: pool/main/m/manpages/manpages-dev_2.62-1_all.deb
Size: 1251810
MD5sum: 6b1c597a48a143d44edd18798b595b59
SHA1: 6c51f92977c30d26399f1bc1847eb875faf39425
SHA256: 583978a78d146d5735c0aac7ec03621dd254479878e8f1dd1e5c230a9208b5af
Description: Manual pages about using GNU/Linux for development
 These man pages describe the Linux programming interface, including
 these two sections:
  2 = Linux system calls.
  3 = Library calls (note that a more comprehensive source of information
      may be found in the glibc-doc package).
Bugs: mailto:[EMAIL PROTECTED]
Origin: Ubuntu


Might be related to package libc6-dev.

[EMAIL PROTECTED]:~$ apt-cache show libc6-dev
Package: libc6-dev
Priority: optional
Section: libdevel
Installed-Size: 13020
Maintainer: Ubuntu Core developers <[EMAIL PROTECTED]>
Original-Maintainer: GNU Libc Maintainers <[EMAIL PROTECTED]>
Architecture: i386
Source: glibc
Version: 2.6.1-1ubuntu9
Replaces: man-db (<= 2.3.10-41), gettext (<= 0.10.26-1), ppp (<= 2.2.0f-24), 
libgdbmg1-dev (<= 1.7.3-24)
Provides: libc-dev
Depends: libc6 (= 2.6.1-1ubuntu9), linux-libc-dev
Recommends: gcc | c-compiler
Suggests: glibc-doc, manpages-dev
Conflicts: libstdc++2.10-dev (<< 1:2.95.2-15), gcc-2.95 (<< 1:2.95.3-9), 
binutils (<< 2.17cvs20070426-1), libc-dev
Filename: pool/main/g/glibc/libc6-dev_2.6.1-1ubuntu9_i386.deb
Size: 3287192
MD5sum: a480d3bac817ba427a5bbd3b6b282efc
SHA1: 71a3209c5a1671ee70976d0197753771f51ff647
SHA256: 280ee1685edcdcb0a39050a17e7e2027da216204481bafc15d9eefb6125be2fa
Description: GNU C Library: Development Libraries and Header Files
 Contains the symlinks, headers, and object files needed to compile
 and link programs which use the standard C library.
Bugs: mailto:[EMAIL PROTECTED]
Build-Essential: yes
Origin: Ubuntu

** Affects: manpages (Ubuntu)
     Importance: Undecided
         Status: New

-- 
manpages-dev contains an inaccuracy for sched_setaffinity and sched_getaffinity 
manual pages
https://bugs.launchpad.net/bugs/160145
You received this bug notification because you are a member of Ubuntu
Bugs, which is the bug contact for Ubuntu.

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to