mirror of
git://sourceware.org/git/newlib-cygwin.git
synced 2025-01-30 02:50:25 +08:00
2002-07-19 Aldy Hernandez <aldyh@redhat.com>
* libc/machine/powerpc/time.c: New file. * libc/machine/powerpc/Makefile.am (lib_a_SOURCES): Add time.c. * libc/machine/powerpc/Makefile.in: Regenerated.
This commit is contained in:
parent
5e7d0a5510
commit
e964bca8a8
@ -1,3 +1,10 @@
|
||||
2002-07-19 Aldy Hernandez <aldyh@redhat.com>
|
||||
|
||||
* libc/machine/powerpc/time.c: New file.
|
||||
* libc/machine/powerpc/Makefile.am (lib_a_SOURCES): Add
|
||||
time.c.
|
||||
* libc/machine/powerpc/Makefile.in: Regenerated.
|
||||
|
||||
2002-07-22 Thomas Fitzsimmons <fitzsim@redhat.com>
|
||||
|
||||
* libc/libc.texinfo: Change copyright notices to Red Hat from
|
||||
@ -6,6 +13,7 @@
|
||||
* README: Change docs URL to
|
||||
http://sources.redhat.com/newlib/docs.html.
|
||||
|
||||
>>>>>>> 1.389
|
||||
2002-07-19 Jeff Johnston <jjohnstn@redhat.com>
|
||||
|
||||
* libc/sys/linux/Makefile.am: Add pathconf.c and fpathconf.c.
|
||||
|
@ -6,7 +6,7 @@ INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS)
|
||||
|
||||
noinst_LIBRARIES = lib.a
|
||||
|
||||
lib_a_SOURCES = setjmp.S
|
||||
lib_a_SOURCES = setjmp.S time.c
|
||||
lib_a_LIBADD = @extra_objs@
|
||||
EXTRA_lib_a_SOURCES = @extra_sources@
|
||||
lib_a_DEPENDENCIES = @extra_objs@
|
||||
|
@ -91,7 +91,7 @@ INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS)
|
||||
|
||||
noinst_LIBRARIES = lib.a
|
||||
|
||||
lib_a_SOURCES = setjmp.S
|
||||
lib_a_SOURCES = setjmp.S time.c
|
||||
lib_a_LIBADD = @extra_objs@
|
||||
EXTRA_lib_a_SOURCES = @extra_sources@
|
||||
lib_a_DEPENDENCIES = @extra_objs@
|
||||
@ -110,7 +110,7 @@ LIBRARIES = $(noinst_LIBRARIES)
|
||||
DEFS = @DEFS@ -I. -I$(srcdir)
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
LIBS = @LIBS@
|
||||
lib_a_OBJECTS = setjmp.o
|
||||
lib_a_OBJECTS = setjmp.o time.o
|
||||
CFLAGS = @CFLAGS@
|
||||
COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
|
||||
CCLD = $(CC)
|
||||
|
36
newlib/libc/machine/powerpc/time.c
Normal file
36
newlib/libc/machine/powerpc/time.c
Normal file
@ -0,0 +1,36 @@
|
||||
/* Time support routines for PowerPC.
|
||||
*
|
||||
* Written by Aldy Hernandez.
|
||||
*/
|
||||
|
||||
#include <_ansi.h>
|
||||
#include <reent.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/times.h>
|
||||
#include <sys/resource.h>
|
||||
|
||||
clock_t
|
||||
times (struct tms *tp)
|
||||
{
|
||||
struct rusage usage;
|
||||
union {
|
||||
struct rusage r;
|
||||
/* Newlib's rusage has only 2 fields. We need to make room for
|
||||
when we call the system's rusage. This should be enough. */
|
||||
int filler[32];
|
||||
} host_ru;
|
||||
|
||||
getrusage (RUSAGE_SELF, (void *)&host_ru);
|
||||
|
||||
if (tp)
|
||||
{
|
||||
tp->tms_utime = host_ru.r.ru_utime.tv_sec * 1000
|
||||
+ host_ru.r.ru_utime.tv_usec;
|
||||
tp->tms_stime = host_ru.r.ru_stime.tv_sec * 1000
|
||||
+ host_ru.r.ru_stime.tv_usec;
|
||||
tp->tms_cutime = 0; /* user time, children */
|
||||
tp->tms_cstime = 0; /* system time, children */
|
||||
}
|
||||
|
||||
return tp->tms_utime;
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user