Re: time returns -1
Thanks for the pointers James. It was a big help. I probably should have
thought of errno on my own. The man page on time is very cryptic. The
only technical information it provides is:
If t is not null, the return value is also stored in the memory pointed
to by t.
What it fails to tell you is, if you pass time a null pointer (t) it will
return an error instead of the time.
This routine worked fine in ancient times (Debian R2) the way I originaly
used it. Some time between R2 and R6 the routine changed its response to
a null pointer, but the man page was not updated to reflect the change in
behavior. I hope there aren't too many other gopher holes waiting out
there to be stepped in.
I have heard that GNU is no longer going to support man pages on their
products, making all updates to the info pages in stead. I can understand
the point of view, but I don't have to like it. Leaving incorrect or
misleading documentation is sometimes worse than not having the
documentation at all.
Thanks again for the nudge in the right direction.
YHS,
Dale
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ +
+ Can someone help deal with all these unreported errors? +
+ +
+ Avco 1984 +
+ +
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
On Wed, 8 Nov 1995, James W. Lynch wrote:
> --------- Received message begins Here ---------
>
> > From @mongo.pixar.com:debian-user-request@Pixar.com Wed Nov 8 08:18 EST 1995
> > when I run the program, using the area of code that I modified, I
> > discovered that the time function was returning -1 (error?).
> Time will return a -1 if it encounters an error. Check errno for the
> reason.
> > Is anyone else using the time function? Has anyone else had this problem?
> No my apps work ok with time.
> > Does anyone have any ideas?
> Print errno out and see if it helps you. Be sure that the parameter
> passed to time is a pointer to a time_t or long variable.
>
> Is the date/time on your machine right?
> >
> > Thanks,
> >
> > Dale
> >
> > ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> > + +
> > + Sex is like computer documentation. When it's good, it's +
> > + very very good, when it's bad, it's better than nothing. +
> > + +
> > + Anonymous +
> > + +
> > ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> >
> >
>
> ------------------------------------------------------------------------
> Jim Lynch, Sales Analyst, Cray Research, Inc. / ARS: K4GVO
> Southeast District, Phone: (770) 631-2254, Email: jwl@cray.com
> Suite 270, 200 Westpark Drive, Peachtree City, GA 30269
>
>
>
Reply to: