Re: [hatari-devel] FILENAME_MAX size?

[ Thread Index | Date Index | More Archives ]


On 22.5.2022 9.56, Nicolas Pomarède wrote:
Le 22/05/2022 à 01:31, Eero Tamminen a écrit :
According to Glibc docs, FILENAME_MAX should not be used:

But it's used by Hatari for all configuration file paths...

Any idea whether the documented issue only specific to GNU/Hurd, or can FILENAME_MAX be set to something like MAX_INT also on other platforms?

I'm not aware of such issue, but in that case if we want to be safe, maybe we could just replace FILENAME_MAX by PATH_MAX ?

That would be fine with me, but PATH_MAX ia POSIX, while FILENAME_MAX is in C standard, so I'd rather not change it, unless there actually is a real problem with FILENAME_MAX.

Has anybody tried Hurd, and building Hatari for it?

As PATH_MAX seems to not have this MAX_INT problem, it could solve this issue (PATH_MAX contains the path and the filename, so its size should be enough)

My Glibc headers define both as 4096.

Or we could just set HATARI_FILENAME_MAX = 4096 and use it everywhere.

It could e.g. be fallback if PATH_MAX is missing.

see this page for example for more detailled  informations :

	- Eero

Mail converted by MHonArc 2.6.19+