Changeset View
Changeset View
Standalone View
Standalone View
sys/compat/linux/linux_misc.c
Show First 20 Lines • Show All 855 Lines • ▼ Show 20 Lines | if (args->times != NULL) { | ||||
/* This breaks POSIX, but is what the Linux kernel does | /* This breaks POSIX, but is what the Linux kernel does | ||||
* _on purpose_ (documented in the man page for utimensat(2)), | * _on purpose_ (documented in the man page for utimensat(2)), | ||||
* so we must follow that behaviour. */ | * so we must follow that behaviour. */ | ||||
if (times[0].tv_nsec == UTIME_OMIT && | if (times[0].tv_nsec == UTIME_OMIT && | ||||
times[1].tv_nsec == UTIME_OMIT) | times[1].tv_nsec == UTIME_OMIT) | ||||
return (0); | return (0); | ||||
} | } | ||||
if (args->flags & LINUX_AT_SYMLINK_NOFOLLOW) | |||||
flags |= AT_SYMLINK_NOFOLLOW; | |||||
if (!LUSECONVPATH(td)) { | if (!LUSECONVPATH(td)) { | ||||
if (args->pathname != NULL) { | if (args->pathname != NULL) { | ||||
return (kern_utimensat(td, dfd, args->pathname, | return (kern_utimensat(td, dfd, args->pathname, | ||||
UIO_USERSPACE, timesp, UIO_SYSSPACE, flags)); | UIO_USERSPACE, timesp, UIO_SYSSPACE, flags)); | ||||
} | } | ||||
} | } | ||||
if (args->pathname != NULL) | if (args->pathname != NULL) | ||||
LCONVPATHEXIST_AT(td, args->pathname, &path, dfd); | LCONVPATHEXIST_AT(td, args->pathname, &path, dfd); | ||||
else if (args->flags != 0) | else if (args->flags != 0) | ||||
return (EINVAL); | return (EINVAL); | ||||
if (args->flags & LINUX_AT_SYMLINK_NOFOLLOW) | |||||
flags |= AT_SYMLINK_NOFOLLOW; | |||||
if (path == NULL) | if (path == NULL) | ||||
error = kern_futimens(td, dfd, timesp, UIO_SYSSPACE); | error = kern_futimens(td, dfd, timesp, UIO_SYSSPACE); | ||||
else { | else { | ||||
error = kern_utimensat(td, dfd, path, UIO_SYSSPACE, timesp, | error = kern_utimensat(td, dfd, path, UIO_SYSSPACE, timesp, | ||||
UIO_SYSSPACE, flags); | UIO_SYSSPACE, flags); | ||||
LFREEPATH(path); | LFREEPATH(path); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 1,758 Lines • Show Last 20 Lines |