S h i v wrote:
> Hi,
> 
> A linux app that I want to build on SX using sunpro uses "struct
> dirent" that has non-standard gcc extensions (ex: d_type) that are not
> available in sunpro.
> I wrote a test program using stat and mask mode S_IFMT as defined
> sys/stat.h to get a substitute(snippet below), but the output does not
> recognize symlinks. Why so?

"man lstat" says:

      The lstat() function  obtains  file  attributes  similar  to
      stat(),  except  when  the named file is a symbolic link; in
      that case lstat() returns information about the link,  while
      stat()  returns  information  about the file the link refer-
      ences.

So if you replace stat() with lstat() you'll probably be good to go. 
Check you also get the behavior you want for non existent links though.

Hugh.
_______________________________________________
opensolaris-code mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/opensolaris-code

Reply via email to