summaryrefslogtreecommitdiff
path: root/include/stdlib.h
diff options
context:
space:
mode:
authorEd Schouten <ed@FreeBSD.org>2009-02-11 20:24:59 +0000
committerEd Schouten <ed@FreeBSD.org>2009-02-11 20:24:59 +0000
commit26d4f5e969a5850cbb0b2344835d515c368d5652 (patch)
tree0b13c353e44fe54b12f0be5c1ae687436add79ee /include/stdlib.h
parent73bac36f82989987e21b669b627a827383ae9224 (diff)
downloadsrc-test2-26d4f5e969a5850cbb0b2344835d515c368d5652.tar.gz
src-test2-26d4f5e969a5850cbb0b2344835d515c368d5652.zip
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
Notes
Notes: svn path=/head/; revision=188497
Diffstat (limited to 'include/stdlib.h')
-rw-r--r--include/stdlib.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/stdlib.h b/include/stdlib.h
index 91be536668b7..5c8e4e363ef0 100644
--- a/include/stdlib.h
+++ b/include/stdlib.h
@@ -256,6 +256,8 @@ int cgetustr(char *, const char *, char **);
int daemon(int, int);
char *devname(__dev_t, __mode_t);
char *devname_r(__dev_t, __mode_t, char *, int);
+char *fdevname(int);
+char *fdevname_r(int, char *, int);
int getloadavg(double [], int);
__const char *
getprogname(void);