summaryrefslogtreecommitdiff
path: root/hurd/porting
diff options
context:
space:
mode:
authorThomas Schwinge <thomas@schwinge.name>2012-01-28 15:08:18 +0100
committerThomas Schwinge <thomas@schwinge.name>2012-01-28 15:08:18 +0100
commit88ade4a03928041ad710594f3281b883528bc8ec (patch)
treeabcad593d20ed333f647e284bbb4fcf8502dcd6f /hurd/porting
parent365b5d122adfff11f979c47874fe36260c6e7ef3 (diff)
parent6f3a380f3c1bc602b1b86dec307abf27f71bfef4 (diff)
Merge remote-tracking branch 'fp/master'
Conflicts: open_issues/dbus.mdwn
Diffstat (limited to 'hurd/porting')
-rw-r--r--hurd/porting/guidelines.mdwn6
1 files changed, 4 insertions, 2 deletions
diff --git a/hurd/porting/guidelines.mdwn b/hurd/porting/guidelines.mdwn
index 03ce9e19..e47d4408 100644
--- a/hurd/porting/guidelines.mdwn
+++ b/hurd/porting/guidelines.mdwn
@@ -1,5 +1,5 @@
-[[!meta copyright="Copyright © 2002, 2003, 2005, 2007, 2008, 2009, 2010, 2011
-Free Software Foundation, Inc."]]
+[[!meta copyright="Copyright © 2002, 2003, 2005, 2007, 2008, 2009, 2010, 2011,
+2012 Free Software Foundation, Inc."]]
[[!meta license="""[[!toggle id="license" text="GFDL 1.2+"]][[!toggleable
id="license" text="Permission is granted to copy, distribute and/or modify this
@@ -112,6 +112,8 @@ 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`, `_POSIX_PATH_MAX`</a>
+<http://pubs.opengroup.org/onlinepubs/009695399/basedefs/limits.h.html>
+
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.
Note: constants such as `_POSIX_PATH_MAX` are only the minimum required value