diff options
| author | Edward Tomasz Napierala <trasz@FreeBSD.org> | 2009-07-08 15:23:18 +0000 |
|---|---|---|
| committer | Edward Tomasz Napierala <trasz@FreeBSD.org> | 2009-07-08 15:23:18 +0000 |
| commit | c38898116a2737ea168993b9419c4370e7280303 (patch) | |
| tree | e525a39d82e8f09edff07a5f34dbc91455121d99 /sys | |
| parent | 6b53d5c0e71582ff79b1490b71c13fcdb9a1680b (diff) | |
Notes
Diffstat (limited to 'sys')
| -rw-r--r-- | sys/bsm/audit_kevents.h | 1 | ||||
| -rw-r--r-- | sys/compat/freebsd32/syscalls.master | 1 | ||||
| -rw-r--r-- | sys/compat/svr4/svr4_stat.c | 3 | ||||
| -rw-r--r-- | sys/i386/ibcs2/ibcs2_misc.c | 3 | ||||
| -rw-r--r-- | sys/kern/syscalls.master | 1 | ||||
| -rw-r--r-- | sys/kern/vfs_syscalls.c | 27 | ||||
| -rw-r--r-- | sys/sys/syscallsubr.h | 2 |
7 files changed, 31 insertions, 7 deletions
diff --git a/sys/bsm/audit_kevents.h b/sys/bsm/audit_kevents.h index c58371818fa8..880809549e7b 100644 --- a/sys/bsm/audit_kevents.h +++ b/sys/bsm/audit_kevents.h @@ -597,6 +597,7 @@ #define AUE_PWRITE 43193 /* Darwin/FreeBSD. */ #define AUE_FSCTL 43194 /* Darwin. */ #define AUE_FFSCTL 43195 /* Darwin. */ +#define AUE_LPATHCONF 43196 /* FreeBSD. */ /* * Darwin BSM uses a number of AUE_O_* definitions, which are aliased to the diff --git a/sys/compat/freebsd32/syscalls.master b/sys/compat/freebsd32/syscalls.master index 6e0f8864b36f..66731fc5b1e8 100644 --- a/sys/compat/freebsd32/syscalls.master +++ b/sys/compat/freebsd32/syscalls.master @@ -900,3 +900,4 @@ struct msqid_ds32 *buf); } 512 AUE_SHMCTL STD { int freebsd32_shmctl(int shmid, int cmd, \ struct shmid_ds32 *buf); } +513 AUE_LPATHCONF STD { int lpathconf(char *path, int name); } diff --git a/sys/compat/svr4/svr4_stat.c b/sys/compat/svr4/svr4_stat.c index 9ef94be5da1f..cfb8276cee44 100644 --- a/sys/compat/svr4/svr4_stat.c +++ b/sys/compat/svr4/svr4_stat.c @@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$"); #include <sys/jail.h> #include <sys/kernel.h> #include <sys/malloc.h> +#include <sys/namei.h> #include <sys/unistd.h> #include <sys/time.h> #include <sys/syscallsubr.h> @@ -669,7 +670,7 @@ svr4_sys_pathconf(td, uap) return (0); default: CHECKALTEXIST(td, uap->path, &path); - error = kern_pathconf(td, path, UIO_SYSSPACE, name); + error = kern_pathconf(td, path, UIO_SYSSPACE, name, FOLLOW); free(path, M_TEMP); return (error); } diff --git a/sys/i386/ibcs2/ibcs2_misc.c b/sys/i386/ibcs2/ibcs2_misc.c index 94fe50f26570..23c617de6e74 100644 --- a/sys/i386/ibcs2/ibcs2_misc.c +++ b/sys/i386/ibcs2/ibcs2_misc.c @@ -66,6 +66,7 @@ __FBSDID("$FreeBSD$"); #include <sys/malloc.h> #include <sys/file.h> /* Must come after sys/malloc.h */ #include <sys/mutex.h> +#include <sys/namei.h> #include <sys/priv.h> #include <sys/reboot.h> #include <sys/resourcevar.h> @@ -763,7 +764,7 @@ ibcs2_pathconf(td, uap) CHECKALTEXIST(td, uap->path, &path); uap->name++; /* iBCS2 _PC_* defines are offset by one */ - error = kern_pathconf(td, path, UIO_SYSSPACE, uap->name); + error = kern_pathconf(td, path, UIO_SYSSPACE, uap->name, FOLLOW); free(path, M_TEMP); return (error); } diff --git a/sys/kern/syscalls.master b/sys/kern/syscalls.master index 940f13da7e4f..4e2e99c09a5f 100644 --- a/sys/kern/syscalls.master +++ b/sys/kern/syscalls.master @@ -910,5 +910,6 @@ struct msqid_ds *buf); } 512 AUE_SHMCTL NOSTD { int shmctl(int shmid, int cmd, \ struct shmid_ds *buf); } +513 AUE_LPATHCONF STD { int lpathconf(char *path, int name); } ; Please copy any additions and changes to the following compatability tables: ; sys/compat/freebsd32/syscalls.master diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c index 7252c4779b3d..28d95e2eb084 100644 --- a/sys/kern/vfs_syscalls.c +++ b/sys/kern/vfs_syscalls.c @@ -2506,17 +2506,36 @@ pathconf(td, uap) } */ *uap; { - return (kern_pathconf(td, uap->path, UIO_USERSPACE, uap->name)); + return (kern_pathconf(td, uap->path, UIO_USERSPACE, uap->name, FOLLOW)); +} + +#ifndef _SYS_SYSPROTO_H_ +struct lpathconf_args { + char *path; + int name; +}; +#endif +int +lpathconf(td, uap) + struct thread *td; + register struct lpathconf_args /* { + char *path; + int name; + } */ *uap; +{ + + return (kern_pathconf(td, uap->path, UIO_USERSPACE, uap->name, NOFOLLOW)); } int -kern_pathconf(struct thread *td, char *path, enum uio_seg pathseg, int name) +kern_pathconf(struct thread *td, char *path, enum uio_seg pathseg, int name, + u_long flags) { struct nameidata nd; int error, vfslocked; - NDINIT(&nd, LOOKUP, FOLLOW | LOCKSHARED | LOCKLEAF | MPSAFE | - AUDITVNODE1, pathseg, path, td); + NDINIT(&nd, LOOKUP, LOCKSHARED | LOCKLEAF | MPSAFE | AUDITVNODE1 | + flags, pathseg, path, td); if ((error = namei(&nd)) != 0) return (error); vfslocked = NDHASGIANT(&nd); diff --git a/sys/sys/syscallsubr.h b/sys/sys/syscallsubr.h index 7e5c15d3f215..d0f209cc5b82 100644 --- a/sys/sys/syscallsubr.h +++ b/sys/sys/syscallsubr.h @@ -145,7 +145,7 @@ int kern_open(struct thread *td, char *path, enum uio_seg pathseg, int kern_openat(struct thread *td, int fd, char *path, enum uio_seg pathseg, int flags, int mode); int kern_pathconf(struct thread *td, char *path, enum uio_seg pathseg, - int name); + int name, u_long flags); int kern_pipe(struct thread *td, int fildes[2]); int kern_preadv(struct thread *td, int fd, struct uio *auio, off_t offset); int kern_ptrace(struct thread *td, int req, pid_t pid, void *addr, |
