Browse Source

resource.h: add missing RUSAGE_THREAD

There is a real-world usage of RUSAGE_THREAD by the pistache project,
https://github.com/oktal/pistache.

Reported-By: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Waldemar Brodkorb 1 year ago
parent
commit
52b67ddcf6

+ 9 - 0
libc/sysdeps/linux/alpha/bits/resource.h

@@ -165,6 +165,15 @@ enum __rusage_who
   /* All of its terminated child processes.  */
   RUSAGE_CHILDREN = -1
 #define RUSAGE_CHILDREN RUSAGE_CHILDREN
+
+#ifdef __USE_GNU
+  ,
+  /* The calling thread.  */
+  RUSAGE_THREAD = 1
+# define RUSAGE_THREAD RUSAGE_THREAD
+  /* Name for the same functionality on Solaris.  */
+# define RUSAGE_LWP RUSAGE_THREAD
+#endif
 };
 
 #define __need_timeval

+ 9 - 0
libc/sysdeps/linux/c6x/bits/resource.h

@@ -143,6 +143,15 @@ enum __rusage_who
   /* Both.  */
   RUSAGE_BOTH = -2
 #define RUSAGE_BOTH RUSAGE_BOTH
+
+#ifdef __USE_GNU
+  ,
+  /* The calling thread.  */
+  RUSAGE_THREAD = 1
+# define RUSAGE_THREAD RUSAGE_THREAD
+  /* Name for the same functionality on Solaris.  */
+# define RUSAGE_LWP RUSAGE_THREAD
+#endif
 };
 
 #define __need_timeval

+ 9 - 0
libc/sysdeps/linux/common/bits/resource.h

@@ -165,6 +165,15 @@ enum __rusage_who
   /* All of its terminated child processes.  */
   RUSAGE_CHILDREN = -1
 #define RUSAGE_CHILDREN RUSAGE_CHILDREN
+
+#ifdef __USE_GNU
+  ,
+  /* The calling thread.  */
+  RUSAGE_THREAD = 1
+# define RUSAGE_THREAD RUSAGE_THREAD
+  /* Name for the same functionality on Solaris.  */
+# define RUSAGE_LWP RUSAGE_THREAD
+#endif
 };
 
 #define __need_timeval

+ 9 - 0
libc/sysdeps/linux/mips/bits/resource.h

@@ -173,6 +173,15 @@ enum __rusage_who
   /* All of its terminated child processes.  */
   RUSAGE_CHILDREN = -1
 #define RUSAGE_CHILDREN RUSAGE_CHILDREN
+
+#ifdef __USE_GNU
+  ,
+  /* The calling thread.  */
+  RUSAGE_THREAD = 1
+# define RUSAGE_THREAD RUSAGE_THREAD
+  /* Name for the same functionality on Solaris.  */
+# define RUSAGE_LWP RUSAGE_THREAD
+#endif
 };
 
 #define __need_timeval

+ 9 - 0
libc/sysdeps/linux/sparc/bits/resource.h

@@ -164,6 +164,15 @@ enum __rusage_who
   /* All of its terminated child processes.  */
   RUSAGE_CHILDREN = -1
 #define RUSAGE_CHILDREN RUSAGE_CHILDREN
+
+#ifdef __USE_GNU
+  ,
+  /* The calling thread.  */
+  RUSAGE_THREAD = 1
+# define RUSAGE_THREAD RUSAGE_THREAD
+  /* Name for the same functionality on Solaris.  */
+# define RUSAGE_LWP RUSAGE_THREAD
+#endif
 };
 
 #define __need_timeval

+ 9 - 0
libc/sysdeps/linux/sparc64/bits/resource.h

@@ -180,6 +180,15 @@ enum __rusage_who
   /* All of its terminated child processes.  */
   RUSAGE_CHILDREN = -1
 #define RUSAGE_CHILDREN RUSAGE_CHILDREN
+
+#ifdef __USE_GNU
+  ,
+  /* The calling thread.  */
+  RUSAGE_THREAD = 1
+# define RUSAGE_THREAD RUSAGE_THREAD
+  /* Name for the same functionality on Solaris.  */
+# define RUSAGE_LWP RUSAGE_THREAD
+#endif
 };
 
 #define __need_timeval