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:
Jeff Johnston 2002-07-22 19:24:53 +00:00
parent 5e7d0a5510
commit e964bca8a8
4 changed files with 47 additions and 3 deletions

View File

@ -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.

View File

@ -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@

View File

@ -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)

View 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;
}