* Re: Use PATH_MAX for pathname char arrays.
@ 2008-04-04 14:17 Samuel Thibault
2008-04-04 14:30 ` Keir Fraser
0 siblings, 1 reply; 3+ messages in thread
From: Samuel Thibault @ 2008-04-04 14:17 UTC (permalink / raw)
To: xen-devel
Hello,
Using PATH_MAX is not a good idea: POSIX says that that definition
is facultative, in case the system does not impose any limit on path
length. Some systems may also set PATH_MAX to a quite high value, and
we would hence consume a lot of stack.
Samuel
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Re: Use PATH_MAX for pathname char arrays.
2008-04-04 14:17 Use PATH_MAX for pathname char arrays Samuel Thibault
@ 2008-04-04 14:30 ` Keir Fraser
2008-04-04 14:51 ` Samuel Thibault
0 siblings, 1 reply; 3+ messages in thread
From: Keir Fraser @ 2008-04-04 14:30 UTC (permalink / raw)
To: Samuel Thibault, xen-devel
If there are better alternatives I'd be happy to use them instead. But we
already use PATH_MAX elsewhere in the tools, so this might be a
wider-ranging cleanup than you think. The original impetus for this change
was due to bugchecks applied in some cases by glibc's realpath()
implementation. But actually is realpath() deprecated anyway?
-- Keir
On 4/4/08 15:17, "Samuel Thibault" <samuel.thibault@eu.citrix.com> wrote:
> Hello,
>
> Using PATH_MAX is not a good idea: POSIX says that that definition
> is facultative, in case the system does not impose any limit on path
> length. Some systems may also set PATH_MAX to a quite high value, and
> we would hence consume a lot of stack.
>
> Samuel
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xensource.com
> http://lists.xensource.com/xen-devel
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Re: Use PATH_MAX for pathname char arrays.
2008-04-04 14:30 ` Keir Fraser
@ 2008-04-04 14:51 ` Samuel Thibault
0 siblings, 0 replies; 3+ messages in thread
From: Samuel Thibault @ 2008-04-04 14:51 UTC (permalink / raw)
To: Keir Fraser; +Cc: xen-devel
Keir Fraser, le Fri 04 Apr 2008 15:30:52 +0100, a écrit :
> If there are better alternatives I'd be happy to use them instead. But we
> already use PATH_MAX elsewhere in the tools, so this might be a
> wider-ranging cleanup than you think.
That's possible indeed, I'm just making sure we try to avoid adding
others :)
> The original impetus for this change was due to bugchecks applied in
> some cases by glibc's realpath() implementation.
> But actually is realpath() deprecated anyway?
Ah, right, realpath has a bad semantic indeed. The intent of SUS is to
have it allocate the string if NULL is given, but that's not necessarily
implemented yet. In the wild, I only know GNU/Hurd which doesn't have
any PATH_MAX limit, and it happens that that one has the allocation
behavior.
Samuel
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2008-04-04 14:51 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-04 14:17 Use PATH_MAX for pathname char arrays Samuel Thibault
2008-04-04 14:30 ` Keir Fraser
2008-04-04 14:51 ` Samuel Thibault
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.