From 6e646651d358c6de266562e0dc5c621b7ea4cd8d Mon Sep 17 00:00:00 2001 From: Konstantin Belousov Date: Thu, 13 Nov 2014 18:01:51 +0000 Subject: Remove the no-at variants of the kern_xx() syscall helpers. E.g., we have both kern_open() and kern_openat(); change the callers to use kern_openat(). This removes one (sometimes two) levels of indirection and consolidates arguments checks. Reviewed by: mckusick Sponsored by: The FreeBSD Foundation MFC after: 1 week --- sys/compat/freebsd32/freebsd32_misc.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'sys/compat/freebsd32/freebsd32_misc.c') diff --git a/sys/compat/freebsd32/freebsd32_misc.c b/sys/compat/freebsd32/freebsd32_misc.c index 8d9f97e145c8..24c573813535 100644 --- a/sys/compat/freebsd32/freebsd32_misc.c +++ b/sys/compat/freebsd32/freebsd32_misc.c @@ -1231,7 +1231,8 @@ freebsd32_utimes(struct thread *td, struct freebsd32_utimes_args *uap) sp = s; } else sp = NULL; - return (kern_utimes(td, uap->path, UIO_USERSPACE, sp, UIO_SYSSPACE)); + return (kern_utimesat(td, AT_FDCWD, uap->path, UIO_USERSPACE, + sp, UIO_SYSSPACE)); } int @@ -1697,7 +1698,8 @@ freebsd32_stat(struct thread *td, struct freebsd32_stat_args *uap) struct stat32 sb32; int error; - error = kern_stat(td, uap->path, UIO_USERSPACE, &sb); + error = kern_statat(td, 0, AT_FDCWD, uap->path, UIO_USERSPACE, + &sb, NULL); if (error) return (error); copy_stat(&sb, &sb32); @@ -1713,7 +1715,8 @@ ofreebsd32_stat(struct thread *td, struct ofreebsd32_stat_args *uap) struct ostat32 sb32; int error; - error = kern_stat(td, uap->path, UIO_USERSPACE, &sb); + error = kern_statat(td, 0, AT_FDCWD, uap->path, UIO_USERSPACE, + &sb, NULL); if (error) return (error); copy_ostat(&sb, &sb32); @@ -1761,7 +1764,8 @@ freebsd32_fstatat(struct thread *td, struct freebsd32_fstatat_args *uap) struct stat32 ub32; int error; - error = kern_statat(td, uap->flag, uap->fd, uap->path, UIO_USERSPACE, &ub); + error = kern_statat(td, uap->flag, uap->fd, uap->path, UIO_USERSPACE, + &ub, NULL); if (error) return (error); copy_stat(&ub, &ub32); @@ -1776,7 +1780,8 @@ freebsd32_lstat(struct thread *td, struct freebsd32_lstat_args *uap) struct stat32 sb32; int error; - error = kern_lstat(td, uap->path, UIO_USERSPACE, &sb); + error = kern_statat(td, AT_SYMLINK_NOFOLLOW, AT_FDCWD, uap->path, + UIO_USERSPACE, &sb, NULL); if (error) return (error); copy_stat(&sb, &sb32); @@ -1792,7 +1797,8 @@ ofreebsd32_lstat(struct thread *td, struct ofreebsd32_lstat_args *uap) struct ostat32 sb32; int error; - error = kern_lstat(td, uap->path, UIO_USERSPACE, &sb); + error = kern_statat(td, AT_SYMLINK_NOFOLLOW, AT_FDCWD, uap->path, + UIO_USERSPACE, &sb, NULL); if (error) return (error); copy_ostat(&sb, &sb32); -- cgit v1.2.3