[26/39] open.2: Remove unused <sys/stat.h>

Message ID 20210510175546.28445-27-alx.manpages@gmail.com
State New
Headers show
Series
  • man2: SYNOPSIS: Fix headers, use syscall(), and other fixes
Related show

Commit Message

Florian Weimer via Libc-alpha May 10, 2021, 5:55 p.m.
I can't see a reason to include it.  <fcntl.h> provides O_*
constants for 'flags', S_* constants for 'mode', and mode_t.

Probably a long time ago, some of those weren't defined in
<fcntl.h>, and both headers needed to be included, or maybe it's
a historical error.

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

---
 man2/open.2 | 1 -
 1 file changed, 1 deletion(-)

-- 
2.31.1

Comments

Florian Weimer via Libc-alpha May 10, 2021, 6:02 p.m. | #1
On 5/10/21 7:55 PM, Alejandro Colomar wrote:
> I can't see a reason to include it.  <fcntl.h> provides O_*

> constants for 'flags', S_* constants for 'mode', and mode_t.

> 

> Probably a long time ago, some of those weren't defined in

> <fcntl.h>, and both headers needed to be included, or maybe it's

> a historical error.

> 

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


Drop this one, please.  (We discussed it yesterday.)

> ---

>   man2/open.2 | 1 -

>   1 file changed, 1 deletion(-)

> 

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

> index bac1ee806..1bcd995f4 100644

> --- a/man2/open.2

> +++ b/man2/open.2

> @@ -53,7 +53,6 @@

>   open, openat, creat \- open and possibly create a file

>   .SH SYNOPSIS

>   .nf

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

>   .B #include <fcntl.h>

>   .PP

>   .BI "int open(const char *" pathname ", int " flags );

> 



-- 
Alejandro Colomar
Linux man-pages comaintainer; https://www.kernel.org/doc/man-pages/
http://www.alejandro-colomar.es/
Florian Weimer via Libc-alpha May 11, 2021, 5:15 a.m. | #2
On 5/11/21 6:02 AM, Alejandro Colomar (man-pages) wrote:
> On 5/10/21 7:55 PM, Alejandro Colomar wrote:

>> I can't see a reason to include it.  <fcntl.h> provides O_*

>> constants for 'flags', S_* constants for 'mode', and mode_t.

>>

>> Probably a long time ago, some of those weren't defined in

>> <fcntl.h>, and both headers needed to be included, or maybe it's

>> a historical error.

>>

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

> 

> Drop this one, please.  (We discussed it yesterday.)


Okay.

-- 
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/open.2 b/man2/open.2
index bac1ee806..1bcd995f4 100644
--- a/man2/open.2
+++ b/man2/open.2
@@ -53,7 +53,6 @@ 
 open, openat, creat \- open and possibly create a file
 .SH SYNOPSIS
 .nf
-.B #include <sys/stat.h>
 .B #include <fcntl.h>
 .PP
 .BI "int open(const char *" pathname ", int " flags );