home *** CD-ROM | disk | FTP | other *** search
- From: Andy Tanenbaum <uunet!cs.vu.nl!ast>
-
- In article <438@longway.TIC.COM> gwyn@brl.arpa (Doug Gwyn) writes:
-
- >You, the implementer, could manually replace that NAME_MAX with the
- >appropriate value (perhaps found by inspecting <limits.h>).
-
- It is true I could just put 14 there, or #define it to be _NAME_MAX in that
- file, but that seems poor programming practice. If that constant ever gets
- changed in <limits.h> but not in <dirent.h> disaster will strike.
-
- >What I did in my implementation was to cheat:
- > char d_name[1];
-
- What happens when a program allocates a struct dirent in a program? The
- compiler will not allocate enough storage and it will crash when used.
-
- Is it legal to add a line
-
- #include <limits.h>
-
- in <dirent.h>?
-
- Andy Tanenbaum (ast@cs.vu.nl)
-
- Volume-Number: Volume 17, Number 69
-
-
-