Re: gettimeofday problem

Brad Hards
2002-06-25T11:53:08Z

On Tue, 25 Jun 2002 21:45, Richard B. Johnson wrote:
> On Tue, 25 Jun 2002, Brad Hards wrote:
> > On Tue, 25 Jun 2002 10:37, Christian Robert wrote:
> > > gettimeofday (&tv, NULL);
> >
> > How about checking the return value of the function call?
> >
> > Brad
> > --
> > http://conf.linux.org.au. 22-25Jan2003. Perth, Australia. Birds in Black.
>
> I think the only possible error returned would relate to the time-zone
> being invalid. The time-zone pointer being a NULL is valid so it isn't
> going to return EINVAL.
It was just a thought - it just seemed a reasonable thing to test for, since
the call can fail.

I didn't check the lib code, so I imagined that their might be some glibc
munging of the syscall output. man gettimeofday sez, inter alia:
EINVAL Timezone (or something else) is invalid.

EFAULT One of tv or tz pointed outside your accessible
address space.

As you pointed out, EINVAL doesn't seem too likely, and I can't see a pointer
problem. So it looks like something else.

Brad

--
http://conf.linux.org.au. 22-25Jan2003. Perth, Australia. Birds in Black.