Re: where did errno go?

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

 



Part of the NPTL work made errno thread-local -- there's one copy of errno for each running thread in a process. For a programmer this means that you *must*

#include <errno.h>

to pick up the correct definition of errno -- it's a macro now instead of a simple integer. The macro definition (you can look it up if you like) is such that

extern int errno;

is harmless. If you're patched up then you _can_ compile on older versions of RH with "extern int errno" instead of the #include and your program will run on RH9 with only a warning. That same program wouldn 't run on an RH9 freshly installed from the original CDs.

I guess I ought to add that the C definition (both C99 and the older ANSI C) said that you should include errno.h instead of using extern int errno as implementations may re-define errno to be a macro ... and now RH9 is enforcing that good practice.

jch

Carlos Villegas wrote:

Hi,

I have a small program I've been using in Psyche without problems, now
when running it on Shrike it says that it needs to be recompiled because
it uses errno, the exact error message is:

Incorrectly built binary which accesses errno, h_errno or _res directly. Needs to be fixed.

The program runs, but it doesn't seem to behave as expected. So
I tried to recompile it, and it won't link, all the objects seem to compile
fine, but when linking I get the following error:


undefined reference to `errno'

Any ideas on this?

Carlos







-- Shrike-list mailing list Shrike-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/shrike-list

[Index of Archives]     [Fedora Users]     [Centos Users]     [Kernel Development]     [Red Hat Install]     [Red Hat Watch]     [Red Hat Development]     [Red Hat Phoebe Beta]     [Yosemite Forum]     [Fedora Discussion]     [Gimp]     [Stuff]     [Yosemite News]

  Powered by Linux