X-Git-Url: https://git.saurik.com/apple/libc.git/blobdiff_plain/5b2abdfbf4211b6592cdd02b9507555a0ecbb04b..3d9156a7a519a5e3aa1b92e9d9d4b991f1aed7ff:/gen/devname.3 diff --git a/gen/devname.3 b/gen/devname.3 index 1a08e34..3a14aeb 100644 --- a/gen/devname.3 +++ b/gen/devname.3 @@ -32,7 +32,7 @@ .\" @(#)devname.3 8.2 (Berkeley) 4/29/95 .\" $FreeBSD: src/lib/libc/gen/devname.3,v 1.11 2001/10/01 16:08:50 ru Exp $ .\" -.Dd April 29, 1995 +.Dd October 25, 2004 .Dt DEVNAME 3 .Os .Sh NAME @@ -45,6 +45,8 @@ .In stdlib.h .Ft char * .Fn devname "dev_t dev" "mode_t type" +.Ft char * +.Fn devname_r "dev_t dev" "mode_t type" "char *buf" "int len" .Sh DESCRIPTION The .Fn devname @@ -55,10 +57,21 @@ with a device number of .Fa dev , and a file type matching the one encoded in .Fa type -which must be one of S_IFBLK or S_IFCHR. +which must be one of +.Dv S_IFBLK +or +.Dv S_IFCHR . If no device matches the specified values, or no information is available, NULL is returned. .Pp +The +.Fn devname +function uses a static buffer, which will be overwritten +on subsequent calls. +The +.Fn devname_r +functions takes a buffer and length as arguments to avoid this problem. +.Pp The traditional display for applications when no device is found is the string .Dq ?? .