aboutsummaryrefslogtreecommitdiff
path: root/sys/compat/freebsd32/freebsd32_misc.c
diff options
context:
space:
mode:
authorKonstantin Belousov <kib@FreeBSD.org>2014-11-13 18:01:51 +0000
committerKonstantin Belousov <kib@FreeBSD.org>2014-11-13 18:01:51 +0000
commit6e646651d358c6de266562e0dc5c621b7ea4cd8d (patch)
tree6efcfbcf870ce7232247484b3f06affbcf5570d6 /sys/compat/freebsd32/freebsd32_misc.c
parentea2af5c8bd95fe96ebeffa5d18d37fe4c505b776 (diff)
downloadsrc-6e646651d358c6de266562e0dc5c621b7ea4cd8d.tar.gz
src-6e646651d358c6de266562e0dc5c621b7ea4cd8d.zip
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
Notes
Notes: svn path=/head/; revision=274476
Diffstat (limited to 'sys/compat/freebsd32/freebsd32_misc.c')
-rw-r--r--sys/compat/freebsd32/freebsd32_misc.c18
1 files changed, 12 insertions, 6 deletions
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);