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

Bug#714604: marked as done (libc6-dev: RUSAGE_THREAD constant not exported)



Your message dated Mon, 1 Jul 2013 14:13:05 +0200
with message-id <20130701121305.GP13072@hall.aurel32.net>
and subject line Re: Bug#714604: libc6-dev: RUSAGE_THREAD constant not exported
has caused the Debian Bug report #714604,
regarding libc6-dev: RUSAGE_THREAD constant not exported
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org
immediately.)


-- 
714604: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=714604
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Package: libc6-dev
Version: 2.13-38
Severity: normal

Hi,

When including sys/time.h and sys/resource.h as the getrusage manpage says,
RUSAGE_THREAD is not defined.

For example, the following code fails to compile:

    #include <sys/time.h>
    #include <sys/resource.h>
     
    int main()
    {
     
      struct rusage usage;
      int r;
     
      r = getrusage(RUSAGE_THREAD, &usage);
      r = getrusage(RUSAGE_SELF, &usage);
     
      return 0;
    }


with:

        error: ‘RUSAGE_THREAD’ undeclared (first use in this function)


Doing a grep in /usr/include it seems it should be defined to 1 and now I'm using:

        #ifndef RUSAGE_THREAD
        #define RUSAGE_THREAD 1
        #endif

as a workaround.


I'm not sure if this is the package I should report it, but as far as I checked
it seems that with these headers it should be defined (instead of a bug in the
manpage or something else). Sorry if I'm wrong :-S


Also, if you want me to try something, just let me know!




Thanks a lot,
Rodrigo

-- System Information:
Debian Release: 7.1
  APT prefers stable
  APT policy: (500, 'stable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.8-2-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages libc6-dev depends on:
ii  libc-dev-bin    2.13-38
ii  libc6           2.13-38
ii  linux-libc-dev  3.2.46-1

Versions of packages libc6-dev recommends:
ii  gcc [c-compiler]      4:4.7.2-1
ii  gcc-4.4 [c-compiler]  4.4.7-2
ii  gcc-4.5 [c-compiler]  4.5.3-12
ii  gcc-4.6 [c-compiler]  4.6.3-14
ii  gcc-4.7 [c-compiler]  4.7.2-5

Versions of packages libc6-dev suggests:
pn  glibc-doc     <none>
ii  manpages-dev  3.44-1

-- no debconf information

--- End Message ---
--- Begin Message ---
On Mon, Jul 01, 2013 at 10:26:10AM +0100, Rodrigo Campos wrote:
> Package: libc6-dev
> Version: 2.13-38
> Severity: normal
> 
> Hi,
> 
> When including sys/time.h and sys/resource.h as the getrusage manpage says,
> RUSAGE_THREAD is not defined.
> 
> For example, the following code fails to compile:
> 
>     #include <sys/time.h>
>     #include <sys/resource.h>
>      
>     int main()
>     {
>      
>       struct rusage usage;
>       int r;
>      
>       r = getrusage(RUSAGE_THREAD, &usage);
>       r = getrusage(RUSAGE_SELF, &usage);
>      
>       return 0;
>     }
> 
> 
> with:
> 
>         error: ‘RUSAGE_THREAD’ undeclared (first use in this function)
> 
> 
> Doing a grep in /usr/include it seems it should be defined to 1 and now I'm using:
> 
>         #ifndef RUSAGE_THREAD
>         #define RUSAGE_THREAD 1
>         #endif
> 
> as a workaround.
> 
> 
> I'm not sure if this is the package I should report it, but as far as I checked
> it seems that with these headers it should be defined (instead of a bug in the
> manpage or something else). Sorry if I'm wrong :-S
> 
> 
> Also, if you want me to try something, just let me know!

RUSAGE_THREAD is not in the POSIX standard and is a GNU extension.
Therefore you should compile your code with -D_GNU_SOURCE (or add a
#define _GNU_SOURCE).

-- 
Aurelien Jarno	                        GPG: 1024D/F1BCDB73
aurelien@aurel32.net                 http://www.aurel32.net

--- End Message ---

Reply to: