bug-glibc
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Problems with stat() and lstat() in glibc 2.2


From: Count0
Subject: Problems with stat() and lstat() in glibc 2.2
Date: Tue, 28 Nov 2000 10:26:05 -0200

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 ? Sorry if it
isn't. ;-)

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"



reply via email to

[Prev in Thread] Current Thread [Next in Thread]