Rob Somers
2006-06-13 22:41:57 UTC
First of all, I must apologise for using Google to post this message.
I am having a bit of trouble with the news service from my ISP, and so
this is what I have ended up resorting to..
In my manual page for the time function - man (2) time, I read:
"On success, the value of time in seconds since the Epoch is
returned. On error, ((time_t)-1) is returned, and errno is set
appropriately."
Now I understand that the *NIX man pages are not the C standard, but if
I believe, this is the standard behaviour for time anyhow. The thing
that makes me wonder is the return value [(time_t) -1] if there is an
error. I have read in a couple of different places, by reputable
authors, that time_t could be signed, or unsigned. If time_t is
unsigned though, would that not break a lot of existing *NIX
implementations? How could the time function return (time_t) -1 if it
is unsigned?
I am having a bit of trouble with the news service from my ISP, and so
this is what I have ended up resorting to..
In my manual page for the time function - man (2) time, I read:
"On success, the value of time in seconds since the Epoch is
returned. On error, ((time_t)-1) is returned, and errno is set
appropriately."
Now I understand that the *NIX man pages are not the C standard, but if
I believe, this is the standard behaviour for time anyhow. The thing
that makes me wonder is the return value [(time_t) -1] if there is an
error. I have read in a couple of different places, by reputable
authors, that time_t could be signed, or unsigned. If time_t is
unsigned though, would that not break a lot of existing *NIX
implementations? How could the time function return (time_t) -1 if it
is unsigned?