This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
Re: _gettimeofday is not implemented
John,
You are missing a gettimeofday syscall and your code is referencing it. There is no gettimeofday
in the libc/time directory. It is only found in the syscalls directory which then calls
_gettimeofday_r() in the reent dir or if you have reentrant syscalls, your syscall.
The syscalls dir is enabled by specifying syscalls_dir=syscalls
in configure.host for your platform. Since you have created syscalls for read()/write(), I would
advise you to instead simply add a gettimeofday() which calls _gettimeofday().
The link warning is due to libnosys putting in a stub warning since it always returns failure when someone
calls _gettimeofday().
-- Jeff J.
----- Original Message -----
> I have a syscalls.c file with a _gettimeofday() function, and I expected this
> to be used instead of the one in libnosys, but it does not. I get a warning
> from the linker:
>
> warning: _gettimeofday is not implemented and will always fail
>
> If I remove "-llibnosys" I get an undefined symbol error:
>
> undefined reference to `gettimeofday'
>
> My syscalls.c file has read() and write(), and I get those instead of the
> libnosys versions. Why not _gettimeofday()?
>
> Thanks,
> John
>
> --
> John Wilkes | AMD Research | john.wilkes@amd.com | office: +1 425.586.6412
> (x26412)
>
>