Mail Archives: djgpp-workers/1998/03/10/21:02:02
> >> BTW, does anyone whether know whether assigning to errno by a user
> >> program is portable behaviour? From what I have read, errno could even
> >> be the result of a function call (i.e. an r-value)
> >
> >Yes, errno doesn't have to be an lvalue. A case in point is a
> >multi-threaded environment, where you'd like each thread to have its own
> >errno.
>
> *Really?* But I believe there are cases where there's no other option. This
The ANSI spec states that errno must be a modifiable lvalue. That
doesn't mean it can't be the result of a function. It could be thus:
#define errno (*get_errno_pointer())
- Raw text -