diff options
author | ed <ed@FreeBSD.org> | 2009-02-11 20:24:59 +0000 |
---|---|---|
committer | ed <ed@FreeBSD.org> | 2009-02-11 20:24:59 +0000 |
commit | de78bbbfe832781ef4718e4d175d53fbe4e7ac40 (patch) | |
tree | 0b13c353e44fe54b12f0be5c1ae687436add79ee /lib/libc/gen/Makefile.inc | |
parent | c1e92bfb206adffe9aca701014c9028722d1ed02 (diff) | |
download | FreeBSD-src-de78bbbfe832781ef4718e4d175d53fbe4e7ac40.zip FreeBSD-src-de78bbbfe832781ef4718e4d175d53fbe4e7ac40.tar.gz |
Add two new routines: fdevname() and fdevname_r().
A more elegant way of obtaining a name of a character device by its file
descriptor on FreeBSD, is to use the FIODGNAME ioctl. Because a valid
file descriptor implies a file descriptor is visible in /dev, it will
always resolve a valid device name.
I'm adding a more friendly wrapper for this ioctl, called fdevname(). It
is a lot easier to use than devname() and also has better error
handling. When a device name cannot be resolved, it will just return
NULL instead of a generated device name that makes no sense.
Discussed with: kib
Diffstat (limited to 'lib/libc/gen/Makefile.inc')
-rw-r--r-- | lib/libc/gen/Makefile.inc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/libc/gen/Makefile.inc b/lib/libc/gen/Makefile.inc index cea797c..a7997ab 100644 --- a/lib/libc/gen/Makefile.inc +++ b/lib/libc/gen/Makefile.inc @@ -10,7 +10,7 @@ SRCS+= __getosreldate.c __xuname.c \ clock.c closedir.c confstr.c \ crypt.c ctermid.c daemon.c devname.c dirname.c disklabel.c \ dlfcn.c dlfunc.c drand48.c erand48.c err.c errlst.c errno.c \ - exec.c feature_present.c fmtcheck.c fmtmsg.c fnmatch.c \ + exec.c fdevname.c feature_present.c fmtcheck.c fmtmsg.c fnmatch.c \ fpclassify.c frexp.c fstab.c ftok.c fts.c fts-compat.c ftw.c \ getbootfile.c getbsize.c \ getcap.c getcwd.c getdomainname.c getgrent.c getgrouplist.c \ @@ -78,6 +78,8 @@ MLINKS+=arc4random.3 arc4random_addrandom.3 arc4random.3 arc4random_stir.3 \ arc4random.3 arc4random_buf.3 arc4random.3 arc4random_uniform.3 MLINKS+=ctermid.3 ctermid_r.3 MLINKS+=devname.3 devname_r.3 +MLINKS+=devname.3 fdevname.3 +MLINKS+=devname.3 fdevname_r.3 MLINKS+=directory.3 closedir.3 directory.3 dirfd.3 directory.3 opendir.3 \ directory.3 fdopendir.3 \ directory.3 readdir.3 directory.3 readdir_r.3 directory.3 rewinddir.3 \ |