home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / std_unix / volume.17 / text0056.txt < prev    next >
Encoding:
Internet Message Format  |  1990-01-06  |  789 b 

  1. From: Andy Tanenbaum <uunet!cs.vu.nl!ast>
  2.  
  3. The <dirent.h> header is required by P1003.1 to have a field
  4.     d_name []
  5.  
  6. Now the question arises about what size to use there.  One possibility is
  7.     d_name[NAME_MAX+1]
  8.  
  9. However, doing this means that <limits.h> must be included.  As far as I
  10. can see, the following is a conforming application:
  11.  
  12. #include <dirent.h>
  13.  
  14. main()
  15. {
  16.   (void) opendir("/usr");
  17. }
  18.  
  19. If one uses NAME_MAX in <dirent.h>, we have a conforming application that
  20. won't even compile.
  21.  
  22. Another solution is to put
  23.  
  24. #define _NAME_MAX  14
  25.  
  26. in <dirent.h> and use that (assuming the result of the discussion on
  27. name space pollution permits this).  It might work, but it is hardly
  28. elegant.
  29.  
  30. What's an implementer to do?
  31.  
  32. Andy Tanenbaum (ast@cs.vu.nl)
  33.  
  34. Volume-Number: Volume 17, Number 65
  35.  
  36.  
  37.