Path: utzoo!attcan!uunet!longway!std-unix From: std-unix@longway.TIC.COM (Moderator, John S. Quarterman) Newsgroups: comp.std.unix Subject: Re: Query about Message-ID: <441@longway.TIC.COM> Date: 24 Nov 89 10:30:00 GMT References: <437@longway.TIC.COM> <438@longway.TIC.COM> Reply-To: Andy Tanenbaum Organization: VU Informatica, Amsterdam Lines: 26 Approved: jsq@longway.tic.com (Moderator, John S. Quarterman) From: Andy Tanenbaum 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 ). 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 but not in 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 in ? Andy Tanenbaum (ast@cs.vu.nl) Volume-Number: Volume 17, Number 69