Changeset View
Changeset View
Standalone View
Standalone View
sys/compat/linux/linux_misc.c
Show First 20 Lines • Show All 807 Lines • ▼ Show 20 Lines | |||||
{ | { | ||||
struct l_timespec l_times[2]; | struct l_timespec l_times[2]; | ||||
struct timespec times[2], *timesp = NULL; | struct timespec times[2], *timesp = NULL; | ||||
char *path = NULL; | char *path = NULL; | ||||
int error, dfd, flags = 0; | int error, dfd, flags = 0; | ||||
dfd = (args->dfd == LINUX_AT_FDCWD) ? AT_FDCWD : args->dfd; | dfd = (args->dfd == LINUX_AT_FDCWD) ? AT_FDCWD : args->dfd; | ||||
if (args->flags & ~LINUX_AT_SYMLINK_NOFOLLOW) | if (args->flags & ~(LINUX_AT_SYMLINK_NOFOLLOW | LINUX_AT_EMPTY_PATH)) | ||||
return (EINVAL); | return (EINVAL); | ||||
if (args->times != NULL) { | if (args->times != NULL) { | ||||
error = copyin(args->times, l_times, sizeof(l_times)); | error = copyin(args->times, l_times, sizeof(l_times)); | ||||
if (error != 0) | if (error != 0) | ||||
return (error); | return (error); | ||||
if (linux_utimensat_nsec_valid(l_times[0].tv_nsec) != 0 || | if (linux_utimensat_nsec_valid(l_times[0].tv_nsec) != 0 || | ||||
Show All 33 Lines | if (args->times != NULL) { | ||||
* 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) | if (args->flags & LINUX_AT_SYMLINK_NOFOLLOW) | ||||
flags |= AT_SYMLINK_NOFOLLOW; | flags |= AT_SYMLINK_NOFOLLOW; | ||||
if (args->flags & LINUX_AT_EMPTY_PATH) | |||||
flags |= AT_EMPTY_PATH; | |||||
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)); | ||||
} | } | ||||
} | } | ||||
▲ Show 20 Lines • Show All 1,770 Lines • Show Last 20 Lines |