Date: Fri, 15 Dec 2006 18:04:19 GMT From: Roman Divacky <rdivacky@FreeBSD.org> To: Perforce Change Reviews <perforce@FreeBSD.org> Subject: PERFORCE change 111746 for review Message-ID: <200612151804.kBFI4JK0096085@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=111746 Change 111746 by rdivacky@rdivacky_witten on 2006/12/15 18:04:05 Implement linux_utimes syscall. Submitted by: "Scot Hetzel" <swhetzel@gmail.com> Affected files ... .. //depot/projects/linuxolator/src/sys/amd64/linux32/linux32_dummy.c#6 edit .. //depot/projects/linuxolator/src/sys/amd64/linux32/linux32_proto.h#14 edit .. //depot/projects/linuxolator/src/sys/amd64/linux32/linux32_syscall.h#14 edit .. //depot/projects/linuxolator/src/sys/amd64/linux32/linux32_sysent.c#13 edit .. //depot/projects/linuxolator/src/sys/amd64/linux32/syscalls.master#13 edit .. //depot/projects/linuxolator/src/sys/compat/linux/linux_misc.c#46 edit .. //depot/projects/linuxolator/src/sys/i386/linux/linux_dummy.c#6 edit .. //depot/projects/linuxolator/src/sys/i386/linux/linux_proto.h#14 edit .. //depot/projects/linuxolator/src/sys/i386/linux/linux_syscall.h#13 edit .. //depot/projects/linuxolator/src/sys/i386/linux/linux_sysent.c#13 edit .. //depot/projects/linuxolator/src/sys/i386/linux/syscalls.master#12 edit Differences ... ==== //depot/projects/linuxolator/src/sys/amd64/linux32/linux32_dummy.c#6 (text+ko) ==== @@ -75,7 +75,6 @@ DUMMY(timer_getoverrun); DUMMY(timer_delete); DUMMY(fstatfs64); -DUMMY(utimes); DUMMY(fadvise64_64); DUMMY(mbind); DUMMY(get_mempolicy); ==== //depot/projects/linuxolator/src/sys/amd64/linux32/linux32_proto.h#14 (text+ko) ==== @@ -834,7 +834,8 @@ char sig_l_[PADL_(int)]; int sig; char sig_r_[PADR_(int)]; }; struct linux_utimes_args { - register_t dummy; + char fname_l_[PADL_(char *)]; char * fname; char fname_r_[PADR_(char *)]; + char tptr_l_[PADL_(struct l_timeval *)]; struct l_timeval * tptr; char tptr_r_[PADR_(struct l_timeval *)]; }; struct linux_fadvise64_64_args { register_t dummy; @@ -1400,7 +1401,7 @@ #define LINUX_SYS_AUE_linux_statfs64 AUE_NULL #define LINUX_SYS_AUE_linux_fstatfs64 AUE_NULL #define LINUX_SYS_AUE_linux_tgkill AUE_NULL -#define LINUX_SYS_AUE_linux_utimes AUE_NULL +#define LINUX_SYS_AUE_linux_utimes AUE_UTIMES #define LINUX_SYS_AUE_linux_fadvise64_64 AUE_NULL #define LINUX_SYS_AUE_linux_mbind AUE_NULL #define LINUX_SYS_AUE_linux_get_mempolicy AUE_NULL ==== //depot/projects/linuxolator/src/sys/amd64/linux32/linux32_syscall.h#14 (text+ko) ==== ==== //depot/projects/linuxolator/src/sys/amd64/linux32/linux32_sysent.c#13 (text+ko) ==== @@ -291,7 +291,7 @@ { AS(linux_statfs64_args), (sy_call_t *)linux_statfs64, AUE_NULL, NULL, 0, 0 }, /* 268 = linux_statfs64 */ { 0, (sy_call_t *)linux_fstatfs64, AUE_NULL, NULL, 0, 0 }, /* 269 = linux_fstatfs64 */ { AS(linux_tgkill_args), (sy_call_t *)linux_tgkill, AUE_NULL, NULL, 0, 0 }, /* 270 = linux_tgkill */ - { 0, (sy_call_t *)linux_utimes, AUE_NULL, NULL, 0, 0 }, /* 271 = linux_utimes */ + { AS(linux_utimes_args), (sy_call_t *)linux_utimes, AUE_UTIMES, NULL, 0, 0 }, /* 271 = linux_utimes */ { 0, (sy_call_t *)linux_fadvise64_64, AUE_NULL, NULL, 0, 0 }, /* 272 = linux_fadvise64_64 */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 273 = */ { 0, (sy_call_t *)linux_mbind, AUE_NULL, NULL, 0, 0 }, /* 274 = linux_mbind */ ==== //depot/projects/linuxolator/src/sys/amd64/linux32/syscalls.master#13 (text+ko) ==== @@ -438,7 +438,8 @@ 268 AUE_NULL STD { int linux_statfs64(char *path, struct l_statfs64_buf *buf); } 269 AUE_NULL STD { int linux_fstatfs64(void); } 270 AUE_NULL STD { int linux_tgkill(int tgid, int pid, int sig); } -271 AUE_NULL STD { int linux_utimes(void); } +271 AUE_UTIMES STD { int linux_utimes(char *fname, \ + struct l_timeval *tptr); } 272 AUE_NULL STD { int linux_fadvise64_64(void); } 273 AUE_NULL UNIMPL 274 AUE_NULL STD { int linux_mbind(void); } ==== //depot/projects/linuxolator/src/sys/compat/linux/linux_misc.c#46 (text+ko) ==== @@ -788,6 +788,38 @@ LFREEPATH(fname); return (error); } + +int +linux_utimes(struct thread *td, struct linux_utimes_args *args) +{ + l_timeval ltv[2]; + struct timeval tv[2], *tvp = NULL; + char *fname; + int error; + + LCONVPATHEXIST(td, args->fname, &fname); + +#ifdef DEBUG + if (ldebug(utimes)) + printf(ARGS(utimes, "%s, *"), fname); +#endif + + if (args->tptr != NULL) { + if ((error = copyin(args->tptr, ltv, sizeof ltv))) { + LFREEPATH(fname); + return (error); + } + tv[0].tv_sec = ltv[0].tv_sec; + tv[0].tv_usec = ltv[0].tv_usec; + tv[1].tv_sec = ltv[1].tv_sec; + tv[1].tv_usec = ltv[1].tv_usec; + tvp = tv; + } + + error = kern_utimes(td, fname, UIO_SYSSPACE, tvp, UIO_SYSSPACE); + LFREEPATH(fname); + return (error); +} #endif /* __i386__ || __amd64__ */ #define __WCLONE 0x80000000 ==== //depot/projects/linuxolator/src/sys/i386/linux/linux_dummy.c#6 (text+ko) ==== @@ -71,7 +71,6 @@ DUMMY(epoll_wait); DUMMY(remap_file_pages); DUMMY(fstatfs64); -DUMMY(utimes); DUMMY(fadvise64_64); DUMMY(mbind); DUMMY(get_mempolicy); ==== //depot/projects/linuxolator/src/sys/i386/linux/linux_proto.h#14 (text+ko) ==== @@ -837,7 +837,8 @@ char sig_l_[PADL_(int)]; int sig; char sig_r_[PADR_(int)]; }; struct linux_utimes_args { - register_t dummy; + char fname_l_[PADL_(char *)]; char * fname; char fname_r_[PADR_(char *)]; + char tptr_l_[PADL_(struct l_timeval *)]; struct l_timeval * tptr; char tptr_r_[PADR_(struct l_timeval *)]; }; struct linux_fadvise64_64_args { register_t dummy; ==== //depot/projects/linuxolator/src/sys/i386/linux/linux_syscall.h#13 (text+ko) ==== ==== //depot/projects/linuxolator/src/sys/i386/linux/linux_sysent.c#13 (text+ko) ==== @@ -290,7 +290,7 @@ { AS(linux_statfs64_args), (sy_call_t *)linux_statfs64, AUE_STATFS, NULL, 0, 0 }, /* 268 = linux_statfs64 */ { 0, (sy_call_t *)linux_fstatfs64, AUE_FSTATFS, NULL, 0, 0 }, /* 269 = linux_fstatfs64 */ { AS(linux_tgkill_args), (sy_call_t *)linux_tgkill, AUE_NULL, NULL, 0, 0 }, /* 270 = linux_tgkill */ - { 0, (sy_call_t *)linux_utimes, AUE_UTIMES, NULL, 0, 0 }, /* 271 = linux_utimes */ + { AS(linux_utimes_args), (sy_call_t *)linux_utimes, AUE_UTIMES, NULL, 0, 0 }, /* 271 = linux_utimes */ { 0, (sy_call_t *)linux_fadvise64_64, AUE_NULL, NULL, 0, 0 }, /* 272 = linux_fadvise64_64 */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 273 = */ { 0, (sy_call_t *)linux_mbind, AUE_NULL, NULL, 0, 0 }, /* 274 = linux_mbind */ ==== //depot/projects/linuxolator/src/sys/i386/linux/syscalls.master#12 (text+ko) ==== @@ -443,7 +443,8 @@ 268 AUE_STATFS STD { int linux_statfs64(char *path, struct l_statfs64_buf *buf); } 269 AUE_FSTATFS STD { int linux_fstatfs64(void); } 270 AUE_NULL STD { int linux_tgkill(int tgid, int pid, int sig); } -271 AUE_UTIMES STD { int linux_utimes(void); } +271 AUE_UTIMES STD { int linux_utimes(char *fname, \ + struct l_timeval *tptr); } 272 AUE_NULL STD { int linux_fadvise64_64(void); } 273 AUE_NULL UNIMPL 274 AUE_NULL STD { int linux_mbind(void); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200612151804.kBFI4JK0096085>