[cs631apue] Question about the strmode

bzhang41 bzhang41 at stevens.edu
Thu Oct 6 22:39:18 EDT 2016

Dear Patrick:

Thanks for you comments for my snap shot.

I took your suggestions to use strmode(3), but I can't pass the cc -Wall 
it shows the following error:

/tmp/ccxcP9Dh.o: In function `lfdisplay':
ls.c:(.text+0xea5): undefined reference to `strmode'
collect2: ld returned 1 exit status

I check the man, and I it says this function should #include 
So I did it, but I still get the above error message.
How can I fix it ?


- Source code readability could use some work (i.e. move comments from 
   files to source files, indentations & brackets)

- No comments.

- 30:32 - closedir(3) may fail
- 149 - atoi(3) is not recommended (i.e. setting `bs` as `BACON`) will 
   atoi(3) to fail); rather, I would recommend strtol(3) then casting the 
   down to an `int` (after checking for overflow and MAX_INT).
- 277:358 - strmode(3) accomplishes filemode too
- 427:499 - please note that some flags may override others
   (i.e. `ls -t -u` == `ls -u`)

- No include. I do not believe this file is being used yet.

- No include. I do not believe this file is being used yet.

- C source code should not be included; rather, the C files are passed 
to the
   compiler (i.e. `gcc ls.c nooptions.c oneoption.c`)

More information about the cs631apue mailing list