This is the mail archive of the newlib@sourceware.cygnus.com mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

sim won't set time()'s pointer argument


Since the sim simply ignores the time_t* it is given in the time
syscall, we'd better arrange for our implementation of time() to do
it.  Here's a patch that fixes the mn10300 implementation.  Ok to
install?

Index: libgloss/ChangeLog
from  Alexandre Oliva  <aoliva@cygnus.com>

	* mn10300/time.c (time): Set *tloc, since the sim doesn't.

Index: libgloss/mn10300/time.c
===================================================================
RCS file: /cvs/cvsfiles/devo/libgloss/mn10300/time.c,v
retrieving revision 1.2
diff -u -r1.2 time.c
--- libgloss/mn10300/time.c	1998/02/23 19:56:37	1.2
+++ libgloss/mn10300/time.c	2000/05/24 12:40:36
@@ -7,5 +7,9 @@
 time_t
 time (time_t *tloc)
 {
-  return TRAP0 (SYS_time, tloc, 0, 0);
+  time_t res;
+  res = TRAP0 (SYS_time, 0, 0, 0);
+  if (tloc)
+    *tloc = res;
+  return res;
 }

-- 
Alexandre Oliva    Enjoy Guaranį, see http://www.ic.unicamp.br/~oliva/
Cygnus Solutions, a Red Hat company        aoliva@{redhat, cygnus}.com
Free Software Developer and Evangelist    CS PhD student at IC-Unicamp
oliva@{lsd.ic.unicamp.br, gnu.org}   Write to mailing lists, not to me

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]