[BACK]Return to makedev.3 CVS log [TXT][DIR] Up to [local] / src / share / man / man3

File: [local] / src / share / man / man3 / makedev.3 (download)

Revision 1.2, Fri Jan 25 00:19:26 2019 UTC (5 years, 4 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE, OPENBSD_7_5, OPENBSD_7_4_BASE, OPENBSD_7_4, OPENBSD_7_3_BASE, OPENBSD_7_3, OPENBSD_7_2_BASE, OPENBSD_7_2, OPENBSD_7_1_BASE, OPENBSD_7_1, OPENBSD_7_0_BASE, OPENBSD_7_0, OPENBSD_6_9_BASE, OPENBSD_6_9, OPENBSD_6_8_BASE, OPENBSD_6_8, OPENBSD_6_7_BASE, OPENBSD_6_7, OPENBSD_6_6_BASE, OPENBSD_6_6, OPENBSD_6_5_BASE, OPENBSD_6_5, HEAD
Changes since 1.1: +3 -3 lines

I am retiring my old email address;  replace it with my OpenBSD one.

.\"	$OpenBSD: makedev.3,v 1.2 2019/01/25 00:19:26 millert Exp $
.\"
.\" Copyright (c) 2014 Todd C. Miller <millert@openbsd.org>
.\"
.\" Permission to use, copy, modify, and distribute this software for any
.\" purpose with or without fee is hereby granted, provided that the above
.\" copyright notice and this permission notice appear in all copies.
.\"
.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
.Dd $Mdocdate: January 25 2019 $
.Dt MAKEDEV 3
.Os
.Sh NAME
.Nm makedev ,
.Nm major ,
.Nm minor
.Nd create or extract device numbers
.Sh SYNOPSIS
.In sys/types.h
.Ft dev_t
.Fn makedev "unsigned int maj" "unsigned int min"
.Ft unsigned int
.Fn major "dev_t dev"
.Ft unsigned int
.Fn minor "dev_t dev"
.Sh DESCRIPTION
On
.Ox ,
all devices on the system are assigned a unique number which consists
of a major and minor component.
Typically, the major number identifies the kind of device and
the minor number identifies a specific instance of the device.
.Pp
The
.Fn makedev
macro is used to combine a major and minor device number into
a form suitable for use with the
.Xr mknod 2
system call.
.Pp
The
.Fn major
macro extracts the major number from the specified device number.
.Pp
The
.Fn minor
macro extracts the minor number from the specified device number.
.Sh RETURN VALUES
The
.Fn makedev
macro returns a combined device number from the specified major and
minor numbers.
.Pp
The
.Fn major
macro returns the major number corresponding to the specified device number.
.Pp
The
.Fn minor
macro returns the minor number corresponding to the specified device number.
.Sh SEE ALSO
.Xr mknod 2 ,
.Xr intro 4
.Sh STANDARDS
The
.Fn makedev ,
.Fn major ,
and
.Fn minor
macros are not standardized by
.St -p1003.1
but are available on most systems.
.Sh HISTORY
The
.Fn makedev ,
.Fn major ,
and
.Fn minor
macros first appeared in
.At v7 .
.Sh CAVEATS
On some systems,
.Fn makedev ,
.Fn major ,
and
.Fn minor
are implemented as functions rather than macros.