diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2009-03-28 20:40:32 +0100 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2009-03-28 20:40:32 +0100 |
commit | e9e35680bf651139ee6ce153e0aaa7308ab01ca5 (patch) | |
tree | fd4d301363b58ff01cafb20ae9fb61b3223f713e | |
parent | df30411cae3015b064c70c6dc98d75da33688e32 (diff) |
provide more details for PATH_MAX
-rw-r--r-- | unsorted/PortingIssues.mdwn | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/unsorted/PortingIssues.mdwn b/unsorted/PortingIssues.mdwn index ff63bda3..03980ef3 100644 --- a/unsorted/PortingIssues.mdwn +++ b/unsorted/PortingIssues.mdwn @@ -51,15 +51,15 @@ If you get Bad File Descriptor error when trying to read from a file (or accessi ## <a name="PATH_MAX_tt_MAX_PATH_tt_MAXPATHL"> `PATH_MAX` / `MAX_PATH` / `MAXPATHLEN` </a> -Every unconditionalized use of `PATH_MAX`, `MAX_PATH` or `MAXPATHLEN` is a POSIX incompatibility. If there is no upper limit on the length of a path (as its the case for GNU), this symbol is not defined in any header file. Instead, you need to either use a different implementation that does not rely on the length of a string or use `sysconf()` to query the length at runtime. If `sysconf()` returns -1, you have to use `realloc()` to allocate the needed memory dynamically. +Every unconditionalized use of `PATH_MAX`, `MAX_PATH` or `MAXPATHLEN` is a POSIX incompatibility. If there is no upper limit on the length of a path (as its the case for GNU), this symbol is not defined in any header file. Instead, you need to either use a different implementation that does not rely on the length of a string or use `sysconf()` to query the length at runtime. If `sysconf()` returns -1, you have to use `realloc()` to allocate the needed memory dynamically. Usually it is thus simpler to just use dynamic allocation. Sometimes the amount is actually known. Else, a geometrically growing loop can be used: for instance, see [Alioth patch](http://alioth.debian.org/tracker/download.php/30628/410472/303735/1575/cpulimit-path-max-fix.patch). Note that in some cases there are GNU extensions that just work fine: when the `__GLIBC__` macro is defined, `getcwd()` calls can be just replaced by `get_current_dir_name()` calls. ## <a name="ARG_MAX"> `ARG_MAX` </a> -Same as `PATH_MAX`. There is no limit on the number of arguments. +Same rationale as `PATH_MAX`. There is no limit on the number of arguments. ## <a name="IOV_MAX"> `IOV_MAX` </a> -Same as `PATH_MAX`. There is no limit on the number of iovec items. +Same rationale as `PATH_MAX`. There is no limit on the number of iovec items. ## <a name="MAXHOSTNAMELEN_tt_"> `MAXHOSTNAMELEN` </a> |