Undefined reference to 'S_ISLINK'

G

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?
 
K

Kenny McCormack

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:
 
M

Mark Bluemel

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>
 
J

Jens Thoms Toerring

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
 
R

Richard

Mark Bluemel said:
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".
 
M

Mark Bluemel

Jens said:
<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)
 
M

Martin Ambuhl

Richard said:
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
< It is incredibly childish and suggests that you
need to find something, anything, positive to do with your life.
 
K

Kenny McCormack

^^
an interesting missing comma

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

Oh, the complete irony...
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,534
Members
45,007
Latest member
OrderFitnessKetoCapsules

Latest Threads

Top