This is the mail archive of the newlib@sourceware.org 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]
Other format: [Raw text]

Re: Year 2038 problem


I wrote:
> Stefan Heinzmann wrote:
>> Would it not be better to adopt the custom of the system newlib is
>> used with? Maybe it should not be up to the C library to define what
>> time_t should be, but the underlying system's relevant system calls
>> suggest the decision.
>
> Cygwin and Linux have 64-bit system calls.  Practically everything else
> is embedded, where newlib must define what the custom is.

... except that there is some code that uses time_t in the system call
interfaces:

$ grep -rw -e SYS_time -e SYS_gettimeofday -e SYS_utime | grep -v '#define'
libgloss/arm/redboot-syscalls.c:    err = __syscall(SYS_gettimeofday, tp, tzp);
libgloss/bfin/syscalls.c:  tv->tv_sec = do_syscall (SYS_time, 0);
libgloss/d30v/syscalls.c:  result = (time_t) __syscall (time_ptr, 0, 0, 0, SYS_time);
libgloss/d30v/syscalls.c:  return __syscall (filename, packet, 0, 0, SYS_utime);
libgloss/epiphany/gettimeofday.c:  return asm_syscall (tp, tzp, NULL, SYS_gettimeofday);
libgloss/iq2000/gettime.c:  return TRAP0 (SYS_gettimeofday, tp, tzp, 0);
libgloss/iq2000/time.c:  return TRAP0 (SYS_time, tloc, 0, 0);
libgloss/iq2000/utime.c:  return TRAP0 (SYS_utime, path, times, 0);
libgloss/m32r/m32r-stub.c:  SYS_time,
libgloss/m32r/m32r-stub.c:  SYS_utime,
libgloss/m32r/utime.c:  return TRAP0 (SYS_utime, path, times, 0);
libgloss/mn10200/gettime.c:  return TRAP0 (SYS_gettimeofday, tp, tzp, 0);
libgloss/mn10200/time.c:  return TRAP0 (SYS_time, tloc, 0, 0);
libgloss/mn10200/utime.c:  return TRAP0 (SYS_utime, path, times, 0);
libgloss/mn10300/gettime.c:  return TRAP0 (SYS_gettimeofday, tp, tzp, 0);
libgloss/mn10300/time.c:  res = TRAP0 (SYS_time, 0, 0, 0);
libgloss/mn10300/utime.c:  return TRAP0 (SYS_utime, path, times, 0);
libgloss/mt/gettime.c:  return TRAP0 (SYS_gettimeofday, tp, tzp, 0);
libgloss/mt/time.c:  return TRAP0 (SYS_time, tloc, 0, 0);
libgloss/mt/utime.c:  return TRAP0 (SYS_utime, path, times, 0);
libgloss/nds32/_gettimeofday.S: syscall SYS_gettimeofday
libgloss/nds32/_time.S:SYS_WRAPPER _time, SYS_time
libgloss/nds32/_utime.S:SYS_WRAPPER _utime, SYS_utime
libgloss/rs6000/sol-syscall.S:SYSCALL(SYS_gettimeofday,gettimeofday)
libgloss/rs6000/sol-syscall.S:SYSCALL(SYS_time,time)
libgloss/v850/gettime.c:  return TRAP0 (SYS_gettimeofday, tp, tzp, 0);
libgloss/v850/time.c:  return TRAP0 (SYS_time, tloc, 0, 0);
libgloss/v850/utime.c:  return TRAP0 (SYS_utime, path, times, 0);
libgloss/visium/syscalls.c:  status = do_syscall (SYS_gettimeofday, (unsigned) &gtv, 0, 0, 0, &error);
libgloss/xstormy16/syscalls.S:  mov r1,#SYS_gettimeofday
libgloss/xstormy16/syscalls.S:  mov r1,#SYS_time
libgloss/xstormy16/syscalls.S:  mov r1,#SYS_utime
newlib/libc/sys/d10v/trap.S:    ldi     r4, SYS_time
newlib/libc/sys/sh/syscalls.c:  return __trap34 (SYS_utime, path, times);
newlib/libc/sys/sh/syscalls.c:  tv->tv_sec = __trap34 (SYS_time);
newlib/libc/sys/sparc64/utime.S:        defsyscall (utime, SYS_utime)
newlib/libc/sys/sysmec/gettime.c:  return TRAP0 (SYS_gettimeofday, tp, tzp, 0);
newlib/libc/sys/sysmec/time.c:  return TRAP0 (SYS_time, tloc, 0, 0);
newlib/libc/sys/sysmec/utime.c:  return TRAP0 (SYS_utime, path, times, 0);
newlib/libc/sys/sysnecv850/gettime.c:  return TRAP0 (SYS_gettimeofday, tp, tzp, 0);
newlib/libc/sys/sysnecv850/time.c:  return TRAP0 (SYS_time, tloc, 0, 0);
newlib/libc/sys/sysnecv850/utime.c:  return TRAP0 (SYS_utime, path, times, 0);
newlib/libc/sys/w65/syscalls.c:  return _trap3 (SYS_utime, path, times);
newlib/libc/sys/z8ksim/glue.c:  MACRO(SYS_time);

Do we know what code (if any) implements those system calls?
Do we care about breaking it?


Regards,
Clemens


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