From: Mika Pekka Liljeberg (liljeber@klaava.Helsinki.FI)
Date: 08/02/92


From: liljeber@klaava.Helsinki.FI (Mika Pekka Liljeberg)
Subject: Re: Problems with extfs
Date: 2 Aug 1992 09:34:07 GMT

In article <trussell.712725783@cwis> trussell@cwis.unomaha.edu (Tim Russell) wrote:
> liljeber@klaava.Helsinki.FI (Mika Pekka Liljeberg) writes:
>
>>It wouldn't even compile.
>
>>char buff[get_max_name_len()];
>
>>is not a legal C declaration.
>
> No, but you could easily have a shell script create (or update, via sed)
> a header file in /usr/include that contains the max filename length for that
> system.. Of course, this wouldn't work for precompiled stuff, but would
> kick in anytime something was compiled.

Well, it ought to be that way even without the update script. Extfs currently has
the longest file names (255 character) and I doubt we need more. If you'll check out
<limits.h> in GCC 2.2.2 you'll find that NAME_MAX already gets defined with this
value. You can also control this with USE_SHORT_FILENAME and USE_LONG_FILE_NAME.

If you people are really serious about this, I guess the most natural way to implement
file name length detection would be to add a max_file_name_len field to the statfs
structure. It has some empty space reserved for extensions. Even then a program would
have to skim through the mounted file systems, find the one with the longest file name
and reserve its buffers accordingly. Not worth it, IMHO.

> --
> Tim Russell Omaha, NE trussell@unomaha.edu
> "Republicans understand the importance of bondage between a mother and child."
> -- Vice President Dan Quayle

        Mika