From 81b95242db35dc7073e271d0822c12bda409ae37 Mon Sep 17 00:00:00 2001 From: chris Date: Mon, 6 Aug 2001 05:56:33 +0000 Subject: Remove the fildesc_clone() function and its associated unnecessary code. It didn't implement the proper /dev/fd functionality (which would be to include in the directory listing /dev/fd/n if the process has fd n open) anyway. Anything needing access to /dev/fd/n where n > 2 can use the optional fdescfs module, which implements this properly and does not cause any trouble with devfs. Discussed with: phk --- sys/kern/kern_descrip.c | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c index b2cc930..b72bf26 100644 --- a/sys/kern/kern_descrip.c +++ b/sys/kern/kern_descrip.c @@ -1470,28 +1470,6 @@ SYSCTL_INT(_kern, OID_AUTO, openfiles, CTLFLAG_RD, &nfiles, 0, "System-wide number of open files"); static void -fildesc_clone(void *arg, char *name, int namelen, dev_t *dev) -{ - int u; - - if (*dev != NODEV) - return; - if (dev_stdclone(name, NULL, "fd/", &u) != 1) - return; - if (u <= 2) - return; - /* Don't clone higher than it makes sense */ - if (u >= maxfilesperproc) - return; - /* And don't clone higher than our minors will support */ - if (u > 0xffffff) - return; - u = unit2minor(u); - *dev = make_dev(&fildesc_cdevsw, u, UID_BIN, GID_BIN, 0666, name); - return; -} - -static void fildesc_drvinit(void *unused) { dev_t dev; @@ -1502,7 +1480,6 @@ fildesc_drvinit(void *unused) make_dev_alias(dev, "stdout"); dev = make_dev(&fildesc_cdevsw, 2, UID_BIN, GID_BIN, 0666, "fd/2"); make_dev_alias(dev, "stderr"); - EVENTHANDLER_REGISTER(dev_clone, fildesc_clone, 0, 1000); if (!devfs_present) { int fd; -- cgit v1.1