This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

errno related question


I compiled and run the following program using
glibc-3.2.1 (on RedHat 8.1) with non-TLS support 
(by setting the LD_ASSUME_KERNEL=2.2.5).
All the functions except stat() is calling the local
__errno_location(). Why the stat() is not calling it?
I know this doesnt work with TLS support, but for
non-TLS, it should work same as glibc-2.2.x.

Thanks,
ishav

=============
#include <sys/stat.h>
#include <errno.h>
int myerrno = 0;
int *__errno_location(){return &myerrno;}
main()
{
        struct stat stbuf;
        close(555);
        printf("myerrno=%d\n", myerrno);
        errno = 1;
        printf("myerrno=%d\n", myerrno);
        stat("nofile", &stbuf);
        printf("myerrno=%d\n", myerrno);
        read(5, &stbuf, sizeof(struct stat));
        printf("myerrno=%d\n", myerrno);
        kill(50000, 1);
        printf("myerrno=%d\n", myerrno);
}


__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]