This is the mail archive of the
glibc-linux@ricardo.ecn.wfu.edu
mailing list for the glibc project.
Problems with stat() and lstat() in glibc 2.2
- To: glibc-linux at ricardo dot ecn dot wfu dot edu
- Subject: Problems with stat() and lstat() in glibc 2.2
- From: Count0 <count0 at linuxfreak dot com>
- Date: Mon, 27 Nov 2000 21:22:53 -0400
- References: Failed to connect to host (smtp2.unisys.com.br): Connection refused
- Reply-To: glibc-linux at ricardo dot ecn dot wfu dot edu
Hi there.
I've been experiencing some problems when trying to compile code that uses
stat() and/or lstat().
When I try to compile the following program:
#include <sys/stat.h>
#include <unistd.h>
int main()
{
struct stat *buf;
return stat("blah", buf); /* Could be lstat()... */
}
I get this error :
gcc test.c -o test
/tmp/cc04OuUD.o: In function `main':
/tmp/cc04OuUD.o(.text+0x13): undefined reference to `stat'
collect2: ld returned 1 exit status
I checked <sys/stat.h>, and found out that stat(), lstat(), etc are inline
wrappers to the internal functions __xstat(), __lxstat(), etc. So I passed
'-O' to the compiler and it compiled fine, because it didn't ignore the
inlines.
But it's also said in sys/stat.h that "It is arranged that when not inlined
these function[the wrappers] are always statically linked" (line 289).
Anybody know why isn't it working then ? Is this a bug ?
This is breaking a lot of major builds, such as gcc, and I don't know if I've
done anything wrong.
I'm using glibc 2.2 and gcc 2.95.2.
Please help !
--
-Count Zero-
"On receiving an interrupt,
decrement the counter to zero"