diff options
author | Robert Millan <zeratul2@wanadoo.es> | 2002-11-15 18:17:18 +0000 |
---|---|---|
committer | Robert Millan <zeratul2@wanadoo.es> | 2002-11-15 18:17:18 +0000 |
commit | 6a14c07d90f1a50779d0bba964cdd16a0c116495 (patch) | |
tree | 04b7f2e0e3c343e675c9ea6577e12bf539d13177 /Distrib/PortingIssues.mdwn | |
parent | a038a03801d29704a191dc68145def2262bd0fe5 (diff) | |
download | web-6a14c07d90f1a50779d0bba964cdd16a0c116495.tar.gz web-6a14c07d90f1a50779d0bba964cdd16a0c116495.tar.bz2 web-6a14c07d90f1a50779d0bba964cdd16a0c116495.zip |
none
Diffstat (limited to 'Distrib/PortingIssues.mdwn')
-rw-r--r-- | Distrib/PortingIssues.mdwn | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/Distrib/PortingIssues.mdwn b/Distrib/PortingIssues.mdwn index b42b9f51..0e76a811 100644 --- a/Distrib/PortingIssues.mdwn +++ b/Distrib/PortingIssues.mdwn @@ -16,7 +16,7 @@ First of all, see [BtsFiling](http://www.vmlinux.org/twikihttp://LOCATIONHurd/Bt ## <a name="Missing_pthreads"> Missing pthreads </a> -You can try out Neal Walfields implementation of libpthreads. It will server as our pthreads library until "the one pthreads that will rule them all" in [[GLibC]] has native support on the Hurd. Quote is from the mailing lists by Roland [[McGrath]]. +You can try out Neal Walfield's implementation of libpthreads. It will server as our pthreads library until "the one pthreads that will rule them all" in [[GLibC]] has native support on the Hurd. Quote is from the mailing lists by Roland [[McGrath]]. Neal's lastest tar balls of libpthreads is available at: @@ -44,7 +44,15 @@ same as PATH\_MAX ## <a name="MAXHOSTNAMELEN"> </a> MAXHOSTNAMELEN -same as PATH\_MAX. Neal's [xgethostname function](http://ftp.walfield.org/pub/people/neal/xgethostname/) can help. +same as PATH\_MAX. When you find a gethostname() funcion, which acts on a static buffer, you can replace it with Neal's [xgethostname function](http://ftp.walfield.org/pub/people/neal/xgethostname/) which returns the hostname as a dynamic buffer. For example: + +Buggy code: + +char localhost[MAXHOSTNAMELEN]; ... gethostname(localhost, sizeof(localhost)); + +Fixed code: + +#ifndef MAXHOSTNAMELEN #include "xgethostname.h" #endif ... #ifdef MAXHOSTNAMELEN char localhost[MAXHOSTNAMELEN]; #else char \*localhost; #endif ... #ifdef MAXHOSTNAMELEN gethostname(localhost, sizeof(localhost)); #else localhost = xgethostname(); #endif ## <a name="NOFILE"> </a> NOFILE @@ -116,3 +124,7 @@ Formatting and minor grammatical fixes. Added more examples and misc semantical fixes. -- [[Main/RobertMillan]] - 05 Oct 2002 + +Added xgethostname example. + +-- [[Main/RobertMillan]] - 15 Nov 2002 |