elm 2.5.3 and glibc 2.1.93

H . J . Lu hjl@lucon.org
Fri Sep 22 09:49:00 GMT 2000


On Fri, Sep 22, 2000 at 09:39:54AM -0700, H . J . Lu wrote:
> 
> >From here, I conclude "The glibc functions do not change `errno' when
> they succeed." By not saving/restoring errno, we have changed
> documented glibc behavior. We should be consistent on it.
> 

One possible glibc code may look like:

  if (foo (....) == -1)
    {
      if (bar (...) == -1)
        exit (1);

     switch (errno)
       {
       case xxx:
         break;
       case xxx:
         break;
       default:
         /* Ooops, unknown error. Quit. */
         exit (2);
       }
    }

Since bar () may change errno now, this perfect valid glibc code may
not work right now. I will guess this code will work on most of other
Unixes.


H.J.


More information about the Libc-hacker mailing list