diff options
author | phk <phk@FreeBSD.org> | 2005-03-10 18:49:17 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2005-03-10 18:49:17 +0000 |
commit | 7a56697451af85732d5a5f6a0051edc853828cfe (patch) | |
tree | 9045b6d6be5771be9c8e66ae148f1640bc358e55 /sys/fs/devfs | |
parent | 75bcf4d381dea96e2c41fb2edafacd6e06dd1f43 (diff) | |
download | FreeBSD-src-7a56697451af85732d5a5f6a0051edc853828cfe.zip FreeBSD-src-7a56697451af85732d5a5f6a0051edc853828cfe.tar.gz |
One more bit of the major/minor patch to make ttyname happy as well.
Diffstat (limited to 'sys/fs/devfs')
-rw-r--r-- | sys/fs/devfs/devfs_vnops.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/sys/fs/devfs/devfs_vnops.c b/sys/fs/devfs/devfs_vnops.c index dbce518..eef811f 100644 --- a/sys/fs/devfs/devfs_vnops.c +++ b/sys/fs/devfs/devfs_vnops.c @@ -462,7 +462,7 @@ devfs_getattr(ap) fix(dev->si_ctime); vap->va_ctime = dev->si_ctime; - vap->va_rdev = de->de_inode ^ devfs_random(); + vap->va_rdev = dev->si_inode ^ devfs_random(); } vap->va_gen = 0; vap->va_flags = 0; @@ -483,7 +483,9 @@ devfs_ioctl_f(struct file *fp, u_long com, void *data, struct ucred *cred, struc struct cdevsw *dsw; struct vnode *vp; struct vnode *vpold; - int error; + int error, i; + const char *p; + struct fiodgname_arg *fgn; error = devfs_fp_check(fp, &dev, &dsw); if (error) @@ -493,6 +495,13 @@ devfs_ioctl_f(struct file *fp, u_long com, void *data, struct ucred *cred, struc *(int *)data = dsw->d_flags & D_TYPEMASK; dev_relthread(dev); return (0); + } else if (com == FIODGNAME) { + fgn = data; + p = devtoname(dev); + i = strlen(p) + 1; + if (i > fgn->len) + return (EINVAL); + return (copyout(p, fgn->buf, i)); } if (dsw->d_flags & D_NEEDGIANT) mtx_lock(&Giant); |