summaryrefslogtreecommitdiffstats
path: root/sys/miscfs
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>1996-01-25 07:17:31 +0000
committerphk <phk@FreeBSD.org>1996-01-25 07:17:31 +0000
commit395d8976253f10ed7a47c9353ea87efd21574485 (patch)
tree60cc44d0fb3ba6df1a9a0db5b16a941be6829b36 /sys/miscfs
parentb744a1f417735566235e99126473ae0f41273749 (diff)
downloadFreeBSD-src-395d8976253f10ed7a47c9353ea87efd21574485.zip
FreeBSD-src-395d8976253f10ed7a47c9353ea87efd21574485.tar.gz
Make devfs_add_devfsf() which takes printf style args.
Diffstat (limited to 'sys/miscfs')
-rw-r--r--sys/miscfs/devfs/devfs_tree.c39
1 files changed, 38 insertions, 1 deletions
diff --git a/sys/miscfs/devfs/devfs_tree.c b/sys/miscfs/devfs/devfs_tree.c
index 3616c3b..35a88cc 100644
--- a/sys/miscfs/devfs/devfs_tree.c
+++ b/sys/miscfs/devfs/devfs_tree.c
@@ -2,7 +2,7 @@
/*
* Written by Julian Elischer (julian@DIALix.oz.au)
*
- * $Header: /home/ncvs/src/sys/miscfs/devfs/devfs_tree.c,v 1.14 1996/01/21 09:07:58 julian Exp $
+ * $Header: /home/ncvs/src/sys/miscfs/devfs/devfs_tree.c,v 1.15 1996/01/21 09:43:31 julian Exp $
*/
#include "param.h"
@@ -897,6 +897,43 @@ int dev_add_entry(char *name, dn_p parent, int type, union typeinfo *by, devnm_p
* The appropriate type... (called (sometimes indirectly) by drivers..) *
* this function is exported.. see sys/devfsext.h *
\***********************************************************************/
+void *devfs_add_devswf(
+ void *devsw,
+ int minor,
+ int chrblk,
+ uid_t uid,
+ gid_t gid,
+ int perms,
+ char *fmt,
+ ...)
+{
+ va_list ap;
+ char *p, buf[256]; /* XXX */
+ int i;
+
+ va_start(ap, fmt);
+ i = kvprintf(fmt, NULL, (void*)buf, 32, ap);
+ va_end(ap);
+ buf[i] = '\0';
+ p = NULL;
+ for (i=0; buf[i]; i++)
+ if (buf[i] == '/')
+ p = buf + 1;
+ if (p) {
+ *p++ = '\0';
+ return devfs_add_devsw(buf, p, devsw, minor, chrblk,
+ uid, gid, perms);
+ } else {
+ return devfs_add_devsw("/", buf, devsw, minor, chrblk,
+ uid, gid, perms);
+ }
+}
+
+/***********************************************************************\
+* Add the named device entry into the given directory, and make it *
+* The appropriate type... (called (sometimes indirectly) by drivers..) *
+* this function is exported.. see sys/devfsext.h *
+\***********************************************************************/
void *devfs_add_devsw(char *path,
char *name,
void *devsw,
OpenPOWER on IntegriCloud