scsh-users
[Top] [All Lists]

Re: scsh vs. time(), mktime(), and errno

To: scsh@zurich.ai.mit.edu
Subject: Re: scsh vs. time(), mktime(), and errno
From: Dave Love <d.love@dl.ac.uk>
Date: 11 Jan 2001 18:28:57 +0000
>>>>> "MS" == Michael Sperber [Mr Preprocessor] 
>>>>> <sperber@informatik.uni-tuebingen.de> writes:

 MS> - errno is not guaranteed to be an lvalue.  

ISO/IEC 9899:1990 (E) says (section 7.1.4) it ``expands to a
modifiable lvalue'' and it ``may be set to nonzero by a library
function call whether or not there is an error, provided the use of
errno is not documented in the description of the function in this
International Standard.''

 MS>   In fact, several Unices define errno to be a macro for a
 MS>   function call.

[Including GNU/Linux, where it's `(*__errno_location ())'.]  Emacs,
for instance, sets errno and still runs on them.

See the footnote in that section of ISO C (or Harbison & Steele, for
instance) concerning zeroing it.

 MS> - The ANSI standard indicates that a -1 return value is the sole and
 MS>   sufficient indicator of an error with time.  

ISO C says just: ``The value (time_t)-1 is returned if the calendar
time is not available.''

[I don't have POSIX.1 beside me.]

<Prev in Thread] Current Thread [Next in Thread>