Re: [PATCH] avoid assuming MAXPATHLEN in config(8)
On Thu, 2011-07-07 at 13:12:03 +0200, Robert Millan wrote:
> 2011/7/7 Ed Schouten <firstname.lastname@example.org>:
> > Even though it is good to make our code conform to standards as much as
> > possible, do keep in mind that your patch also causes a lot of
> > regressions in that area. The code now uses asprintf(), which is not
> > part of POSIX. I also think the use of __GLIBC__ is frowned upon.
> Uhm... you're right. Actually I knew asprintf() is not part of POSIX,
> it just didn't occur to me that this contradicted my point about
> MAXPATHLEN .
>  Btw, POSIX itself is quite contradictory too: it doesn't let you
> assume MAXPATHLEN, but it doesn't give you the facilities you need in
> case it isn't present (e.g. asprintf and canonicalize_file_name but
> gethostname and getline / fgetln come to mind too).
Well, canonicalize_file_name() has been standardized in POSIX.1-2008
as realpath(path, NULL), which GNU/* and FreeBSD have supported for
a long time. getline() is also part of POSIX.1-2008.