Skip to content

Commit

Permalink
makedev(3): Use <sys/sysmacros.h> in SYNOPSIS
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
vapier authored and mkerrisk committed Apr 20, 2016
1 parent c1a2e85 commit 3350a86
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions man3/makedev.3
Original file line number Diff line number Diff line change
Expand Up @@ -28,23 +28,13 @@
makedev, major, minor \- manage a device number
.SH SYNOPSIS
.nf
.B #include <sys/types.h>
.B #include <sys/sysmacros.h>

.BI "dev_t makedev(unsigned int " maj ", unsigned int " min );

.BI "unsigned int major(dev_t " dev );
.BI "unsigned int minor(dev_t " dev );
.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
A device ID consists of two parts:
a major ID, identifying the class of the device,
Expand Down Expand Up @@ -90,7 +80,9 @@ and
.BR minor ()
functions are not specified in POSIX.1,
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
These interfaces are defined as macros.
Since glibc 2.3.3,
Expand Down

0 comments on commit 3350a86

Please sign in to comment.