Sophie

Sophie

distrib > Mageia > cauldron > i586 > by-pkgid > 1ddfe4a48b2b559a00dbca912106d555 > files > 4

dietlibc-0.34-4.mga9.src.rpm

commit 90b465a50e94292afd5e3bc976f39b77d55a03ea
Author: Arnaud Patard <apatard@mandriva.com>
Date:   Thu Jul 9 13:34:14 2009 +0000

    arm eabi: fix time()
    
    NR_time is gone with eabi, use gettimeofday instead.
    [ code taken in the s390x code ]
    
    Signed-off-by: Arnaud Patard <apatard@mandriva.com>

diff --git a/arm/Makefile.add b/arm/Makefile.add
index f6126ec..768eea9 100644
--- a/arm/Makefile.add
+++ b/arm/Makefile.add
@@ -4,6 +4,7 @@ LIBOBJ+=$(OBJDIR)/__fadvise.o $(OBJDIR)/
 CFLAGS+=-Os -fomit-frame-pointer -fstrict-aliasing
 #ifdef __ARM_EABI__
 #CFLAGS+=-mabi=aapcs-linux -mno-thumb-interwork
+#LIBOBJ+=$(OBJDIR)/__time.o
 #endif
 VPATH:=arm:syscalls.s:$(VPATH)
 LIBGMON_OBJS+=$(OBJDIR)/mcount.o
diff --git a/arm/__time.c b/arm/__time.c
new file mode 100644
index 0000000..af935ae
--- /dev/null
+++ b/arm/__time.c
@@ -0,0 +1,10 @@
+#include <time.h>
+#include <sys/time.h>
+
+time_t time(time_t *t) {
+  struct timeval tv;
+  if (gettimeofday(&tv, 0) == -1)
+    tv.tv_sec=-1;
+  if (t) *t=tv.tv_sec;
+  return tv.tv_sec;
+}