summaryrefslogtreecommitdiffstats
path: root/sys/amd64
diff options
context:
space:
mode:
authorjkim <jkim@FreeBSD.org>2006-12-20 20:17:35 +0000
committerjkim <jkim@FreeBSD.org>2006-12-20 20:17:35 +0000
commit3b05cb0c58ed250c60f7321838347a39face122f (patch)
tree40841c4230fafceca6bed9870e7bee86d23f61b9 /sys/amd64
parent32be6116587f790003891e0bb8b64be55589ed4e (diff)
downloadFreeBSD-src-3b05cb0c58ed250c60f7321838347a39face122f.zip
FreeBSD-src-3b05cb0c58ed250c60f7321838347a39face122f.tar.gz
MFP4: 109655
- Move linux_nanosleep() from src/sys/amd64/linux32/linux32_machdep.c to src/sys/compat/linux/linux_time.c. - Validate timespec ranges before use as Linux kernel does. - Fix l_timespec structure. - Clean up style(9) nits.
Diffstat (limited to 'sys/amd64')
-rw-r--r--sys/amd64/linux32/linux.h4
-rw-r--r--sys/amd64/linux32/linux32_machdep.c21
2 files changed, 2 insertions, 23 deletions
diff --git a/sys/amd64/linux32/linux.h b/sys/amd64/linux32/linux.h
index 6c67e54..505e568 100644
--- a/sys/amd64/linux32/linux.h
+++ b/sys/amd64/linux32/linux.h
@@ -171,8 +171,8 @@ struct l_rusage {
* stat family of syscalls
*/
struct l_timespec {
- l_ulong tv_sec;
- l_ulong tv_nsec;
+ l_time_t tv_sec;
+ l_long tv_nsec;
} __packed;
struct l_newstat {
diff --git a/sys/amd64/linux32/linux32_machdep.c b/sys/amd64/linux32/linux32_machdep.c
index c4a58c7..942f5bd 100644
--- a/sys/amd64/linux32/linux32_machdep.c
+++ b/sys/amd64/linux32/linux32_machdep.c
@@ -1049,27 +1049,6 @@ linux_gettimeofday(struct thread *td, struct linux_gettimeofday_args *uap)
}
int
-linux_nanosleep(struct thread *td, struct linux_nanosleep_args *uap)
-{
- struct timespec rqt, rmt;
- struct l_timespec ats32;
- int error;
-
- error = copyin(uap->rqtp, &ats32, sizeof(ats32));
- if (error != 0)
- return (error);
- rqt.tv_sec = ats32.tv_sec;
- rqt.tv_nsec = ats32.tv_nsec;
- error = kern_nanosleep(td, &rqt, &rmt);
- if (uap->rmtp != NULL) {
- ats32.tv_sec = rmt.tv_sec;
- ats32.tv_nsec = rmt.tv_nsec;
- error = copyout(&ats32, uap->rmtp, sizeof(ats32));
- }
- return (error);
-}
-
-int
linux_getrusage(struct thread *td, struct linux_getrusage_args *uap)
{
struct l_rusage s32;
OpenPOWER on IntegriCloud