aboutsummaryrefslogtreecommitdiff
path: root/sys/kern
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2018-01-17 22:36:58 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2018-01-17 22:36:58 +0000
commitb1288166e0f73ddc7f5b8de210db62e987dda609 (patch)
tree05554e6a69b2f81e0dc24cf191091d4e81ff45ec /sys/kern
parent19a63eb534a17b9a61626315b58cf557b6913d02 (diff)
downloadsrc-b1288166e0f73ddc7f5b8de210db62e987dda609.tar.gz
src-b1288166e0f73ddc7f5b8de210db62e987dda609.zip
Notes
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/kern_descrip.c15
-rw-r--r--sys/kern/vfs_syscalls.c21
-rw-r--r--sys/kern/vnode_if.src2
3 files changed, 27 insertions, 11 deletions
diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c
index c1100b7c8fdf..385514fbfabf 100644
--- a/sys/kern/kern_descrip.c
+++ b/sys/kern/kern_descrip.c
@@ -1418,12 +1418,17 @@ struct fpathconf_args {
int
sys_fpathconf(struct thread *td, struct fpathconf_args *uap)
{
+ long value;
+ int error;
- return (kern_fpathconf(td, uap->fd, uap->name));
+ error = kern_fpathconf(td, uap->fd, uap->name, &value);
+ if (error == 0)
+ td->td_retval[0] = value;
+ return (error);
}
int
-kern_fpathconf(struct thread *td, int fd, int name)
+kern_fpathconf(struct thread *td, int fd, int name, long *valuep)
{
struct file *fp;
struct vnode *vp;
@@ -1435,19 +1440,19 @@ kern_fpathconf(struct thread *td, int fd, int name)
return (error);
if (name == _PC_ASYNC_IO) {
- td->td_retval[0] = _POSIX_ASYNCHRONOUS_IO;
+ *valuep = _POSIX_ASYNCHRONOUS_IO;
goto out;
}
vp = fp->f_vnode;
if (vp != NULL) {
vn_lock(vp, LK_SHARED | LK_RETRY);
- error = VOP_PATHCONF(vp, name, td->td_retval);
+ error = VOP_PATHCONF(vp, name, valuep);
VOP_UNLOCK(vp, 0);
} else if (fp->f_type == DTYPE_PIPE || fp->f_type == DTYPE_SOCKET) {
if (name != _PC_PIPE_BUF) {
error = EINVAL;
} else {
- td->td_retval[0] = PIPE_BUF;
+ *valuep = PIPE_BUF;
error = 0;
}
} else {
diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c
index 7114ca9f3d94..d28c588ebfd9 100644
--- a/sys/kern/vfs_syscalls.c
+++ b/sys/kern/vfs_syscalls.c
@@ -2384,8 +2384,14 @@ struct pathconf_args {
int
sys_pathconf(struct thread *td, struct pathconf_args *uap)
{
+ long value;
+ int error;
- return (kern_pathconf(td, uap->path, UIO_USERSPACE, uap->name, FOLLOW));
+ error = kern_pathconf(td, uap->path, UIO_USERSPACE, uap->name, FOLLOW,
+ &value);
+ if (error == 0)
+ td->td_retval[0] = value;
+ return (error);
}
#ifndef _SYS_SYSPROTO_H_
@@ -2397,14 +2403,19 @@ struct lpathconf_args {
int
sys_lpathconf(struct thread *td, struct lpathconf_args *uap)
{
+ long value;
+ int error;
- return (kern_pathconf(td, uap->path, UIO_USERSPACE, uap->name,
- NOFOLLOW));
+ error = kern_pathconf(td, uap->path, UIO_USERSPACE, uap->name,
+ NOFOLLOW, &value);
+ if (error == 0)
+ td->td_retval[0] = value;
+ return (error);
}
int
kern_pathconf(struct thread *td, char *path, enum uio_seg pathseg, int name,
- u_long flags)
+ u_long flags, long *valuep)
{
struct nameidata nd;
int error;
@@ -2415,7 +2426,7 @@ kern_pathconf(struct thread *td, char *path, enum uio_seg pathseg, int name,
return (error);
NDFREE(&nd, NDF_ONLY_PNBUF);
- error = VOP_PATHCONF(nd.ni_vp, name, td->td_retval);
+ error = VOP_PATHCONF(nd.ni_vp, name, valuep);
vput(nd.ni_vp);
return (error);
}
diff --git a/sys/kern/vnode_if.src b/sys/kern/vnode_if.src
index 30f5d752f62b..90cef879c4ed 100644
--- a/sys/kern/vnode_if.src
+++ b/sys/kern/vnode_if.src
@@ -429,7 +429,7 @@ vop_print {
vop_pathconf {
IN struct vnode *vp;
IN int name;
- OUT register_t *retval;
+ OUT long *retval;
};