summaryrefslogtreecommitdiffstats
path: root/lib/libc/gen
diff options
context:
space:
mode:
authortrhodes <trhodes@FreeBSD.org>2005-02-23 02:02:38 +0000
committertrhodes <trhodes@FreeBSD.org>2005-02-23 02:02:38 +0000
commitd838320b8a048866309d45ac98ad4feb0fc10ae2 (patch)
treec8a61a57e2f7080ab2a2b2e3f40741f3b5aa0f57 /lib/libc/gen
parent40f7cb97004eb7f676af6adc922e49c146df454a (diff)
downloadFreeBSD-src-d838320b8a048866309d45ac98ad4feb0fc10ae2.zip
FreeBSD-src-d838320b8a048866309d45ac98ad4feb0fc10ae2.tar.gz
Add an EXAMPLES section[1], quote Nd, and bump doc date.
PR: 53621 [1] Submitted by: Faried Nawaz <fn@hungry.com> [1]
Diffstat (limited to 'lib/libc/gen')
-rw-r--r--lib/libc/gen/devname.314
1 files changed, 12 insertions, 2 deletions
diff --git a/lib/libc/gen/devname.3 b/lib/libc/gen/devname.3
index 42cc407..79bc7df 100644
--- a/lib/libc/gen/devname.3
+++ b/lib/libc/gen/devname.3
@@ -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
OpenPOWER on IntegriCloud