diff options
author | Bruce Evans <bde@FreeBSD.org> | 1996-03-27 19:19:58 +0000 |
---|---|---|
committer | Bruce Evans <bde@FreeBSD.org> | 1996-03-27 19:19:58 +0000 |
commit | 8fb333242904095c3354eb09bba5bc6d749f8560 (patch) | |
tree | 18a7c77b9779711174b3fa918f383fd72d2bdd9e /sys/kern | |
parent | df957ee1b3335fce4fdfd1754a19dde63a76bb5d (diff) | |
download | src-8fb333242904095c3354eb09bba5bc6d749f8560.tar.gz src-8fb333242904095c3354eb09bba5bc6d749f8560.zip |
Fixed the unit numbers of the devfs `fd' devices.
Made the devfs `fd' devices bug for bug compatible with the ones created
by MAKEDEV:
- ownership is bin.bin, not root.wheel, except for std*. The devfsext
interface doesn't seem to allow specifying the ownership of /devfs/fd,
so it's still incompatible.
- std* aren't links to fd/[0-2].
Notes
Notes:
svn path=/head/; revision=14849
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/kern_descrip.c | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c index 26f3ace641d8..96ea47403fea 100644 --- a/sys/kern/kern_descrip.c +++ b/sys/kern/kern_descrip.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)kern_descrip.c 8.6 (Berkeley) 4/19/94 - * $Id: kern_descrip.c,v 1.28 1996/02/25 09:38:18 hsu Exp $ + * $Id: kern_descrip.c,v 1.27 1996/03/11 02:17:30 hsu Exp $ */ #include <sys/param.h> @@ -1102,26 +1102,30 @@ static void *devfs_token_fildesc[NUMFDESC]; static void fildesc_drvinit(void *unused) { dev_t dev; - int i; - char name[32]; + int fd; if( ! fildesc_devsw_installed ) { dev = makedev(CDEV_MAJOR,0); cdevsw_add(&dev,&fildesc_cdevsw,NULL); fildesc_devsw_installed = 1; #ifdef DEVFS - for ( i = 0 ; i < NUMFDESC ; i++ ) { - sprintf(name,"%d",i); - devfs_token_fildesc[i] = devfs_add_devsw("fd",name, - &fildesc_cdevsw,0, - DV_CHR, 0, 0, 0666); - } + for (fd = 0; fd < NUMFDESC; fd++) + devfs_token_fildesc[fd] = + devfs_add_devswf(&fildesc_cdevsw, fd, DV_CHR, + UID_BIN, GID_BIN, 0666, + "fd/%d", fd); devfs_token_stdin = - dev_link("/","stdin",devfs_token_fildesc[0]); + devfs_add_devswf(&fildesc_cdevsw, 0, DV_CHR, + UID_ROOT, GID_WHEEL, 0666, + "stdin", fd); devfs_token_stdout = - dev_link("/","stdout",devfs_token_fildesc[1]); + devfs_add_devswf(&fildesc_cdevsw, 1, DV_CHR, + UID_ROOT, GID_WHEEL, 0666, + "stdout", fd); devfs_token_stderr = - dev_link("/","stderr",devfs_token_fildesc[2]); + devfs_add_devswf(&fildesc_cdevsw, 2, DV_CHR, + UID_ROOT, GID_WHEEL, 0666, + "stderr", fd); #endif } } |