diff options
| author | Tom Rhodes <trhodes@FreeBSD.org> | 2005-02-23 02:02:38 +0000 |
|---|---|---|
| committer | Tom Rhodes <trhodes@FreeBSD.org> | 2005-02-23 02:02:38 +0000 |
| commit | 0e5d513b500357d746805e564846986699670477 (patch) | |
| tree | c8a61a57e2f7080ab2a2b2e3f40741f3b5aa0f57 /lib/libc/gen/devname.3 | |
| parent | aa7fd9158c2a47c04b5914393ec9e94759207504 (diff) | |
Notes
Diffstat (limited to 'lib/libc/gen/devname.3')
| -rw-r--r-- | lib/libc/gen/devname.3 | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/lib/libc/gen/devname.3 b/lib/libc/gen/devname.3 index 42cc407e07fc..79bc7df6e644 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 |
