1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-25 11:37:56 +00:00

Add an EXAMPLES section[1], quote Nd, and bump doc date.

PR:		53621 [1]
Submitted by:	Faried Nawaz <fn@hungry.com> [1]
This commit is contained in:
Tom Rhodes 2005-02-23 02:02:38 +00:00
parent aa7fd9158c
commit 0e5d513b50
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=142277

View File

@ -32,12 +32,12 @@
.\" @(#)devname.3 8.2 (Berkeley) 4/29/95
.\" $FreeBSD$
.\"
.Dd July 18, 1999
.Dd February 22, 2005
.Dt DEVNAME 3
.Os
.Sh NAME
.Nm devname
.Nd get device name
.Nd "get device name"
.Sh LIBRARY
.Lb libc
.Sh SYNOPSIS
@ -78,6 +78,16 @@ returns the name stored in a static buffer which will be overwritten
on subsequent calls.
.Fn devname_r
takes a buffer and length as argument to avoid this problem.
.Sh EXAMPLES
.Bd -literal -compact
int fd;
struct stat buf;
char *name;
fd = open("/dev/tun");
fstat(fd, &buf);
printf("devname is /dev/%s\en", devname(buf.st_rdev, S_IFCHR));
.Ed
.Sh SEE ALSO
.Xr stat 2
.Sh HISTORY