errno related question
Ishav
ishavd@yahoo.com
Wed Feb 5 00:29:00 GMT 2003
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
More information about the Libc-alpha
mailing list