Thread: About errno

  1. #1
    Registered User
    Join Date
    Jul 2009
    Posts
    2

    Post About errno

    << split from /usr/bin/ld: errno: TLS definition in /lib/libc.so.6 >>

    Hello Folks,

    thanks you helped me a lot. But I've still got one question: Is there a possibility to test out if I must either import errno or should include the file.

    Something like

    Code:
    #ifdef THIS_IS_THE_DEFINE_I_NEED
    #include <errno.h>
    #else
    extern int errno;
    #endif
    Thanks a lot!

    beachcoder

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,661
    You should always just include errno.h, for the reasons matsp says in the other thread.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #3
    Registered User
    Join Date
    Jul 2009
    Posts
    2
    Hi Salem!

    Thanks for your info. The problem is that I've had this problem on a very old software, which must be backward-compatible and must compile under Linux same as unter AIX, Solaris and NCR and such systems.

    Are you sure it is available on Systems released within the past 10 or 15 years?

    Anyway, I now put the new version on and try to port. If the problem comes up, I will try to find another solution.

    Thanks again,

    beachcoder

  4. #4
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,661
    errno.h has been a C-standard header file for the last 20 years.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. errno function, error TLS/non TLS
    By fran.b in forum C Programming
    Replies: 13
    Last Post: 03-25-2009, 08:06 AM
  2. Replies: 8
    Last Post: 03-10-2008, 11:57 AM
  3. Thread error (errno 11)
    By Magos in forum A Brief History of Cprogramming.com
    Replies: 2
    Last Post: 04-03-2003, 06:12 PM
  4. errno --perror() problem
    By GanglyLamb in forum C Programming
    Replies: 10
    Last Post: 04-01-2003, 02:01 PM
  5. simulate Grep command in Unix using C
    By laxmi in forum C Programming
    Replies: 6
    Last Post: 05-10-2002, 04:10 PM