[v5,23/35] getrlimit.2, getrusage.2: Remove unused include

Message ID 20210404115847.78166-24-alx.manpages@gmail.com
State New
Headers show
Series
  • Untitled series #36406
Related show

Commit Message

Wilco Dijkstra via Libc-alpha April 4, 2021, 11:58 a.m.
<sys/time.h> is not required by any of these function declaration
or macro definition used by these functions.  It's maybe (or maybe
not) needed by some tipe inside the rlimit structure, but that
info belongs to system_data_types(7), not here.

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>

---
 man2/getrlimit.2 | 1 -
 man2/getrusage.2 | 9 ---------
 2 files changed, 10 deletions(-)

-- 
2.31.0

Comments

Wilco Dijkstra via Libc-alpha April 5, 2021, 10:48 a.m. | #1
Hi ALex,

On 4/4/21 1:58 PM, Alejandro Colomar wrote:
> <sys/time.h> is not required by any of these function declaration

> or macro definition used by these functions.  It's maybe (or maybe

> not) needed by some tipe inside the rlimit structure, but that

> info belongs to system_data_types(7), not here.

> 

> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>



Patch applied.

Thanks,

Michael


> ---

>  man2/getrlimit.2 | 1 -

>  man2/getrusage.2 | 9 ---------

>  2 files changed, 10 deletions(-)

> 

> diff --git a/man2/getrlimit.2 b/man2/getrlimit.2

> index 444c50525..648fd3c85 100644

> --- a/man2/getrlimit.2

> +++ b/man2/getrlimit.2

> @@ -66,7 +66,6 @@

>  getrlimit, setrlimit, prlimit \- get/set resource limits

>  .SH SYNOPSIS

>  .nf

> -.B #include <sys/time.h>

>  .B #include <sys/resource.h>

>  .PP

>  .BI "int getrlimit(int " resource ", struct rlimit *" rlim );

> diff --git a/man2/getrusage.2 b/man2/getrusage.2

> index d3c0de8a0..85c4ffed1 100644

> --- a/man2/getrusage.2

> +++ b/man2/getrusage.2

> @@ -41,7 +41,6 @@

>  getrusage \- get resource usage

>  .SH SYNOPSIS

>  .nf

> -.B #include <sys/time.h>

>  .B #include <sys/resource.h>

>  .PP

>  .BI "int getrusage(int " who ", struct rusage *" usage );

> @@ -230,14 +229,6 @@ is Linux-specific.

>  Resource usage metrics are preserved across an

>  .BR execve (2).

>  .PP

> -Including

> -.I <sys/time.h>

> -is not required these days, but increases portability.

> -(Indeed,

> -.I struct timeval

> -is defined in

> -.IR <sys/time.h> .)

> -.PP

>  In Linux kernel versions before 2.6.9, if the disposition of

>  .B SIGCHLD

>  is set to

> 



-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

Patch

diff --git a/man2/getrlimit.2 b/man2/getrlimit.2
index 444c50525..648fd3c85 100644
--- a/man2/getrlimit.2
+++ b/man2/getrlimit.2
@@ -66,7 +66,6 @@ 
 getrlimit, setrlimit, prlimit \- get/set resource limits
 .SH SYNOPSIS
 .nf
-.B #include <sys/time.h>
 .B #include <sys/resource.h>
 .PP
 .BI "int getrlimit(int " resource ", struct rlimit *" rlim );
diff --git a/man2/getrusage.2 b/man2/getrusage.2
index d3c0de8a0..85c4ffed1 100644
--- a/man2/getrusage.2
+++ b/man2/getrusage.2
@@ -41,7 +41,6 @@ 
 getrusage \- get resource usage
 .SH SYNOPSIS
 .nf
-.B #include <sys/time.h>
 .B #include <sys/resource.h>
 .PP
 .BI "int getrusage(int " who ", struct rusage *" usage );
@@ -230,14 +229,6 @@  is Linux-specific.
 Resource usage metrics are preserved across an
 .BR execve (2).
 .PP
-Including
-.I <sys/time.h>
-is not required these days, but increases portability.
-(Indeed,
-.I struct timeval
-is defined in
-.IR <sys/time.h> .)
-.PP
 In Linux kernel versions before 2.6.9, if the disposition of
 .B SIGCHLD
 is set to