summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorchris <chris@FreeBSD.org>2001-08-06 05:56:33 +0000
committerchris <chris@FreeBSD.org>2001-08-06 05:56:33 +0000
commit81b95242db35dc7073e271d0822c12bda409ae37 (patch)
treec12097a4ddeaa7de7588329800f4558b619156f8
parent947433403cee31c0248eb42457ef3a2d114ecb53 (diff)
downloadFreeBSD-src-81b95242db35dc7073e271d0822c12bda409ae37.zip
FreeBSD-src-81b95242db35dc7073e271d0822c12bda409ae37.tar.gz
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
-rw-r--r--sys/kern/kern_descrip.c23
1 files changed, 0 insertions, 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;
OpenPOWER on IntegriCloud