diff options
author | Konstantin Belousov <kib@FreeBSD.org> | 2020-01-28 11:22:20 +0000 |
---|---|---|
committer | Konstantin Belousov <kib@FreeBSD.org> | 2020-01-28 11:22:20 +0000 |
commit | 2a3529df1dede41a6e56a84787ba2562631e644b (patch) | |
tree | d3abb7efe50deca9b6071af69059f319f8b66ad5 | |
parent | dc13edbc7df93478417321a5011326dbe2e13c47 (diff) |
Notes
-rw-r--r-- | sys/compat/linuxkpi/common/src/linux_compat.c | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/sys/compat/linuxkpi/common/src/linux_compat.c b/sys/compat/linuxkpi/common/src/linux_compat.c index af9a6b6388d8..5dd60d3a772a 100644 --- a/sys/compat/linuxkpi/common/src/linux_compat.c +++ b/sys/compat/linuxkpi/common/src/linux_compat.c @@ -1526,7 +1526,9 @@ linux_file_ioctl(struct file *fp, u_long cmd, void *data, struct ucred *cred, struct linux_file *filp; const struct file_operations *fop; struct linux_cdev *ldev; - int error; + struct fiodgname_arg *fgn; + const char *p; + int error, i; error = 0; filp = (struct linux_file *)fp->f_data; @@ -1554,6 +1556,23 @@ linux_file_ioctl(struct file *fp, u_long cmd, void *data, struct ucred *cred, case FIOGETOWN: *(int *)data = fgetown(&filp->f_sigio); break; + case FIODGNAME: +#ifdef COMPAT_FREEBSD32 + case FIODGNAME_32: +#endif + if (filp->f_cdev == NULL || filp->f_cdev->cdev == NULL) { + error = ENXIO; + break; + } + fgn = data; + p = devtoname(filp->f_cdev->cdev); + i = strlen(p) + 1; + if (i > fgn->len) { + error = EINVAL; + break; + } + error = copyout(p, fiodgname_buf_get_ptr(fgn, cmd), i); + break; default: error = linux_file_ioctl_sub(fp, filp, fop, cmd, data, td); break; |