From c66e39e126397c4954cbbbe6b969461ba6a2dbcd Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Tue, 31 Mar 2009 21:10:03 +0200 Subject: add pulseaudio patch example --- unsorted/PortingIssues.mdwn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/unsorted/PortingIssues.mdwn b/unsorted/PortingIssues.mdwn index 03980ef3..e26fa710 100644 --- a/unsorted/PortingIssues.mdwn +++ b/unsorted/PortingIssues.mdwn @@ -51,7 +51,7 @@ If you get Bad File Descriptor error when trying to read from a file (or accessi ## `PATH_MAX` / `MAX_PATH` / `MAXPATHLEN` -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. +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) or [Pulseaudio patch](http://bugs.debian.org/cgi-bin/bugreport.cgi?msg=5;filename=patch-pulse;att=1;bug=522100). 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. ## `ARG_MAX` -- cgit v1.2.3