From c62adaccc729931a72a2b16aab9a93d1b5e1eb46 Mon Sep 17 00:00:00 2001 From: Jeff Johnston Date: Thu, 25 Apr 2002 22:12:10 +0000 Subject: [PATCH] 2002-04-25 Jeff Johnston * libc/sys/linux/Makefile.am: Add support for sched.c. * libc/sys/linux/Makefile.in: Regenerated. * libc/sys/linux/sched.c: New file. * libc/sys/linux/sys/types.h: Add struct timespec. --- newlib/ChangeLog | 7 +++++++ newlib/libc/sys/linux/Makefile.am | 2 +- newlib/libc/sys/linux/Makefile.in | 15 ++++++++------- newlib/libc/sys/linux/sched.c | 16 ++++++++++++++++ newlib/libc/sys/linux/sys/types.h | 10 ++++++++++ 5 files changed, 42 insertions(+), 8 deletions(-) create mode 100644 newlib/libc/sys/linux/sched.c diff --git a/newlib/ChangeLog b/newlib/ChangeLog index 5b60c579c..8f360fb6a 100644 --- a/newlib/ChangeLog +++ b/newlib/ChangeLog @@ -1,3 +1,10 @@ +2002-04-25 Jeff Johnston + + * libc/sys/linux/Makefile.am: Add support for sched.c. + * libc/sys/linux/Makefile.in: Regenerated. + * libc/sys/linux/sched.c: New file. + * libc/sys/linux/sys/types.h: Add struct timespec. + 2002-04-25 Thomas Fitzsimmons * configure.in (CC_FOR_BUILD): Set to gcc whether diff --git a/newlib/libc/sys/linux/Makefile.am b/newlib/libc/sys/linux/Makefile.am index 9248f33c1..fec559293 100644 --- a/newlib/libc/sys/linux/Makefile.am +++ b/newlib/libc/sys/linux/Makefile.am @@ -9,7 +9,7 @@ SUBLIBS = $(LINUX_MACH_LIB) LIB_SOURCES = \ brk.c getoptlong.c ids.c inode.c io.c linux.c mmap.c \ - process.c realpath.c \ + process.c realpath.c sched.c \ select.c signal.c siglongjmp.c socket.c sleep.c stack.c \ sysconf.c systat.c termios.c time.c \ usleep.c wait.c diff --git a/newlib/libc/sys/linux/Makefile.in b/newlib/libc/sys/linux/Makefile.in index 24b587f80..f13defa33 100644 --- a/newlib/libc/sys/linux/Makefile.in +++ b/newlib/libc/sys/linux/Makefile.in @@ -98,7 +98,7 @@ SUBLIBS = $(LINUX_MACH_LIB) LIB_SOURCES = \ brk.c getoptlong.c ids.c inode.c io.c linux.c mmap.c \ - process.c realpath.c \ + process.c realpath.c sched.c \ select.c signal.c siglongjmp.c socket.c sleep.c stack.c \ sysconf.c systat.c termios.c time.c \ usleep.c wait.c @@ -132,17 +132,18 @@ DEFS = @DEFS@ -I. -I$(srcdir) CPPFLAGS = @CPPFLAGS@ LIBS = @LIBS@ @USE_LIBTOOL_FALSE@lib_a_OBJECTS = brk.o getoptlong.o ids.o inode.o \ -@USE_LIBTOOL_FALSE@io.o linux.o mmap.o process.o realpath.o select.o \ -@USE_LIBTOOL_FALSE@signal.o siglongjmp.o socket.o sleep.o stack.o \ -@USE_LIBTOOL_FALSE@sysconf.o systat.o termios.o time.o usleep.o wait.o +@USE_LIBTOOL_FALSE@io.o linux.o mmap.o process.o realpath.o sched.o \ +@USE_LIBTOOL_FALSE@select.o signal.o siglongjmp.o socket.o sleep.o \ +@USE_LIBTOOL_FALSE@stack.o sysconf.o systat.o termios.o time.o usleep.o \ +@USE_LIBTOOL_FALSE@wait.o LTLIBRARIES = $(noinst_LTLIBRARIES) @USE_LIBTOOL_TRUE@liblinux_la_DEPENDENCIES = @USE_LIBTOOL_TRUE@liblinux_la_OBJECTS = brk.lo getoptlong.lo ids.lo \ @USE_LIBTOOL_TRUE@inode.lo io.lo linux.lo mmap.lo process.lo \ -@USE_LIBTOOL_TRUE@realpath.lo select.lo signal.lo siglongjmp.lo \ -@USE_LIBTOOL_TRUE@socket.lo sleep.lo stack.lo sysconf.lo systat.lo \ -@USE_LIBTOOL_TRUE@termios.lo time.lo usleep.lo wait.lo +@USE_LIBTOOL_TRUE@realpath.lo sched.lo select.lo signal.lo \ +@USE_LIBTOOL_TRUE@siglongjmp.lo socket.lo sleep.lo stack.lo sysconf.lo \ +@USE_LIBTOOL_TRUE@systat.lo termios.lo time.lo usleep.lo wait.lo CFLAGS = @CFLAGS@ COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) diff --git a/newlib/libc/sys/linux/sched.c b/newlib/libc/sys/linux/sched.c new file mode 100644 index 000000000..6a23260ba --- /dev/null +++ b/newlib/libc/sys/linux/sched.c @@ -0,0 +1,16 @@ +/* libc/sys/linux/sched.c - Process scheduling functions */ + +/* Copyright 2002, Red Hat Inc. */ + +#include +#include +#include + +_syscall2(int,sched_getparam,pid_t,pid,struct sched_param *,sched); +_syscall1(int,sched_get_priority_max,int,policy); +_syscall1(int,sched_get_priority_min,int,policy); +_syscall1(int,sched_getscheduler,pid_t,pid); +_syscall2(int,sched_rr_get_interval,pid_t,pid,struct timespec *,interval); +_syscall2(int,sched_setparam,pid_t,pid,const struct sched_param *,sched); +_syscall3(int,sched_setscheduler,pid_t,pid,int,policy,const struct sched_param *,sched); +_syscall0(int,sched_yield); diff --git a/newlib/libc/sys/linux/sys/types.h b/newlib/libc/sys/linux/sys/types.h index 1954af9c8..637463b06 100644 --- a/newlib/libc/sys/linux/sys/types.h +++ b/newlib/libc/sys/linux/sys/types.h @@ -31,6 +31,16 @@ typedef __pid_t pid_t; typedef __off_t off_t; typedef __loff_t loff_t; +/* Time Value Specification Structures, P1003.1b-1993, p. 261 */ + +#ifndef _STRUCT_TIMESPEC +#define _STRUCT_TIMESPEC +struct timespec { + time_t tv_sec; /* Seconds */ + long tv_nsec; /* Nanoseconds */ +}; +#endif /* !_STRUCT_TIMESPEC */ + #include #endif -- 2.43.5