makedev(3): Use <sys/sysmacros.h> in SYNOPSIS

Defining these functions via <sys/types.h> causes problems for
some folk. As noted by Zack Wein:

    libstdc++ force-enables _GNU_SOURCE, which means people
    writing in C++ _can't_ avoid these nonstandard macros by
    using a strict conformance mode.

Since glibc has basically always used <sys/sysmacros.h>,
update the docs to have people include that instead.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
Mike Frysinger 2016-04-19 01:52:43 -04:00 committed by Michael Kerrisk
parent c1a2e851a1
commit 3350a86413
1 changed files with 4 additions and 12 deletions

View File

@ -28,23 +28,13 @@
makedev, major, minor \- manage a device number makedev, major, minor \- manage a device number
.SH SYNOPSIS .SH SYNOPSIS
.nf .nf
.B #include <sys/types.h> .B #include <sys/sysmacros.h>
.BI "dev_t makedev(unsigned int " maj ", unsigned int " min ); .BI "dev_t makedev(unsigned int " maj ", unsigned int " min );
.BI "unsigned int major(dev_t " dev ); .BI "unsigned int major(dev_t " dev );
.BI "unsigned int minor(dev_t " dev ); .BI "unsigned int minor(dev_t " dev );
.fi .fi
.sp
.BR makedev (),
.BR major (),
.BR minor ():
.nf
Since glibc 2.19:
_DEFAULT_SOURCE
In glibc up to and including 2.19:
_BSD_SOURCE
.fi
.SH DESCRIPTION .SH DESCRIPTION
A device ID consists of two parts: A device ID consists of two parts:
a major ID, identifying the class of the device, a major ID, identifying the class of the device,
@ -90,7 +80,9 @@ and
.BR minor () .BR minor ()
functions are not specified in POSIX.1, functions are not specified in POSIX.1,
but are present on many other systems. but are present on many other systems.
.\" The BSDs, HP-UX, Solaris, AIX, Irix .\" The BSDs, HP-UX, Solaris, AIX, Irix.
.\" The header location is inconsistent:
.\" Could be sys/mkdev.h, sys/sysmacros.h, or sys/types.h.
.SH NOTES .SH NOTES
These interfaces are defined as macros. These interfaces are defined as macros.
Since glibc 2.3.3, Since glibc 2.3.3,