[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: robust chdir and openat (works with names longer than PATH_MAX)

From: Jim Meyering
Subject: Re: robust chdir and openat (works with names longer than PATH_MAX)
Date: Mon, 29 Nov 2004 15:29:40 +0100

Paul Eggert <address@hidden> wrote:
> After looking at rpl_chdir's code, one possible simplification
> suggests itself: use an argument of type "char *" (not "char const
> *"), and temporarily modify it by setting '/' to '\0'.  This would
> avoid all the need for storage management within rpl_chdir, and would
> simplify things quite a bit I would think.  It would also remove the
> FIXME about arbitrary limitations.  It would of course require that we
> call the function a name other than "chdir" but I think that's a good
> idea for reasons discussed in my previous email.

IMHO, it is bad practice to modify such parameters, even temporarily,
when it's not too hard to avoid.  But maybe we've reached the `too hard'
or `too ugly' threshold.  I'll look into it.

> One minor point: Solaris 9 doesn't have O_DIRECTORY.

Thanks.  I'll add the usual definition.

>> #  error "use this module only if your system defines PATH_MAX"
> That would be the Hurd, no?  Can't we just fall back to the system
> chdir in this case?

Yes :)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]