[cs631apue] Confusing with header files

Jan Schaumann jschauma at stevens.edu
Wed Sep 25 11:39:18 EDT 2013

kwang9 <kwang9 at stevens.edu> wrote:

> I solved this issue by using macros:

While using the macros is a perfectly fine way to check for a file type,
you should nevertheless be able to use S_IFMT as a bitmask.

Try to isolate the error by writing a five-line standalone program that
calls stat(2) and then uses S_IFMT.

> But there is another strange thing on linux-lab when using strmode, even  
> if I include <bsd/string.h>, BOMB!:
> undefined reference to `strmode'

It's a good idea to copy the full commands you ran as well as their
output when trying to get help.  That makes it easier for others to
identify the problem you might be seeing.


More information about the cs631apue mailing list