Undefined reference to 'S_ISLINK'

Discussion in 'C Programming' started by gaganpreet.nospam@gmail.com, Jul 24, 2007.

  1. Guest

    Hi all,
    I have to implement ls using system calls. The S_ISREG, S_ISDIR,
    S_ISCHR etc. seem to be working fine. But S_ISLINK Is giving this
    error:

    /tmp/ccWJ1Lbs.o: In function `longls':
    ls.c:(.text+0x354): undefined reference to `S_ISLINK'
    collect2: ld returned 1 exit status

    In man pages it is written that this macro is 'Not in POSIX.1-1996'.
    So does that mean my system isn't POSIX.1-1996? If so, how can I know
    whether the file is a link? Can anyone help me out?
    , Jul 24, 2007
    #1
    1. Advertising

  2. In article <>,
    <> wrote:
    >Hi all,
    >I have to implement ls using system calls. The S_ISREG, S_ISDIR,
    >S_ISCHR etc. seem to be working fine. But S_ISLINK Is giving this
    >error:
    >
    >/tmp/ccWJ1Lbs.o: In function `longls':
    >ls.c:(.text+0x354): undefined reference to `S_ISLINK'
    >collect2: ld returned 1 exit status
    >
    >In man pages it is written that this macro is 'Not in POSIX.1-1996'.
    >So does that mean my system isn't POSIX.1-1996? If so, how can I know
    >whether the file is a link? Can anyone help me out?
    >


    Please do. Allow me to be the first in the feeding frenzy:

    Off topic. Not portable. Cant discuss it here. Blah, blah, blah.

    Useful clc-related links:
    --
    http://en.wikipedia.org/wiki/Aspergers
    http://en.wikipedia.org/wiki/Clique
    http://en.wikipedia.org/wiki/C_programming_language
    Kenny McCormack, Jul 24, 2007
    #2
    1. Advertising

  3. Mark Bluemel Guest

    wrote:
    > Hi all,
    > I have to implement ls using system calls. The S_ISREG, S_ISDIR,
    > S_ISCHR etc. seem to be working fine. But S_ISLINK Is giving this
    > error:
    >
    > /tmp/ccWJ1Lbs.o: In function `longls':
    > ls.c:(.text+0x354): undefined reference to `S_ISLINK'
    > collect2: ld returned 1 exit status


    Of course this is not about C but about un*x facilities,
    so it would be better addressed somewhere like
    comp.unix.programmer, really. However ...

    <OT>
    On my linux system this is S_ISLNK, with only one 'I'... I suspect
    that's your problem...
    </OT>
    Mark Bluemel, Jul 24, 2007
    #3
  4. wrote:
    > I have to implement ls using system calls. The S_ISREG, S_ISDIR,
    > S_ISCHR etc. seem to be working fine. But S_ISLINK Is giving this
    > error:


    > /tmp/ccWJ1Lbs.o: In function `longls':
    > ls.c:(.text+0x354): undefined reference to `S_ISLINK'
    > collect2: ld returned 1 exit status


    > In man pages it is written that this macro is 'Not in POSIX.1-1996'.
    > So does that mean my system isn't POSIX.1-1996? If so, how can I know
    > whether the file is a link? Can anyone help me out?


    You better ask these kinds of questions in a UNIX newsgroup, e.g.
    comp.unix.programmer, since these macros aren't part of the C but
    of the POSIX standard, which isn't the same;-)

    <OT>
    Perhaps you should read the man page again and check if 'S_ISLINK'
    is really spelled that way and not perhaps 'S_ISLNK' instead...
    </OT>
    Regards, Jens
    --
    \ Jens Thoms Toerring ___
    \__________________________ http://toerring.de
    Jens Thoms Toerring, Jul 24, 2007
    #4
  5. Richard Guest

    Mark Bluemel <> writes:

    > wrote:
    >> Hi all,
    >> I have to implement ls using system calls. The S_ISREG, S_ISDIR,
    >> S_ISCHR etc. seem to be working fine. But S_ISLINK Is giving this
    >> error:
    >>
    >> /tmp/ccWJ1Lbs.o: In function `longls':
    >> ls.c:(.text+0x354): undefined reference to `S_ISLINK'
    >> collect2: ld returned 1 exit status

    >
    > Of course this is not about C but about un*x facilities,
    > so it would be better addressed somewhere like
    > comp.unix.programmer, really. However ...
    >
    > <OT>
    > On my linux system this is S_ISLNK, with only one 'I'... I suspect
    > that's your problem...
    > </OT>


    Please guys, stop with the <OT> tags. It is just *so* pathetic and
    "jobsworth".
    Richard, Jul 24, 2007
    #5
  6. Mark Bluemel Guest

    Jens Thoms Toerring wrote:
    > wrote:
    >
    >>I have to implement ls using system calls. The S_ISREG, S_ISDIR,
    >>S_ISCHR etc. seem to be working fine. But S_ISLINK Is giving this
    >>error:

    >
    > <OT>
    > Perhaps you should read the man page again and check if 'S_ISLINK'
    > is really spelled that way and not perhaps 'S_ISLNK' instead...
    > </OT>


    According to Brian Kernighan and Rob Pike: Ken Thompson was once asked
    what he would do differently if he were redesigning the UNIX System.
    His reply: "I'd spell creat with an e." (as related in a footnote in
    "The UNIX Programming Environment" by K&P)
    Mark Bluemel, Jul 24, 2007
    #6
  7. Richard wrote:

    > Please guys, stop with the <OT> tags. It is just *so* pathetic and

    ^^
    an interesting missing comma
    > "jobsworth".


    Please, Richard, stop your inane attempts to destroy the topicality of
    <news:comp.lang.c>. It is incredibly childish and suggests that you
    need to find something, anything, positive to do with your life.
    Martin Ambuhl, Jul 24, 2007
    #7
  8. In article <>,
    Martin Ambuhl <> wrote:
    >Richard wrote:
    >
    >> Please guys, stop with the <OT> tags. It is just *so* pathetic and

    > ^^
    > an interesting missing comma
    >> "jobsworth".

    >
    >Please, Richard, stop your inane attempts to destroy the topicality of
    ><news:comp.lang.c>. It is incredibly childish and suggests that you
    >need to find something, anything, positive to do with your life.


    Oh, the complete irony...
    Kenny McCormack, Jul 25, 2007
    #8
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Felipe
    Replies:
    3
    Views:
    432
    Felipe
    Jul 16, 2004
  2. Lu
    Replies:
    1
    Views:
    544
    Roel Schroeven
    Jul 10, 2003
  3. Mantorok Redgormor
    Replies:
    70
    Views:
    1,712
    Dan Pop
    Feb 17, 2004
  4. VK
    Replies:
    45
    Views:
    564
    Dr John Stockton
    Sep 12, 2006
  5. -Lost
    Replies:
    13
    Views:
    350
    Richard Cornford
    Jan 31, 2007
Loading...

Share This Page