diff options
Diffstat (limited to 'hurd')
-rw-r--r-- | hurd/porting/guidelines.mdwn | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/hurd/porting/guidelines.mdwn b/hurd/porting/guidelines.mdwn index aabf0345..d28a777e 100644 --- a/hurd/porting/guidelines.mdwn +++ b/hurd/porting/guidelines.mdwn @@ -189,21 +189,21 @@ To `config.h.in`, you need to add: Then something like: - #ifndef HAVE_STRERROR - static char * - private_strerror (errnum) - int errnum; - { - extern char *sys_errlist[]; - extern int sys_nerr; - - if (errnum > 0 && errnum <= sys_nerr) - return sys_errlist[errnum]; - - return "Unknown system error"; - } - #define strerror private_strerror - #endif /* HAVE_STRERROR */ + #ifndef HAVE_STRERROR + static char * + private_strerror (errnum) + int errnum; + { + extern char *sys_errlist[]; + extern int sys_nerr; + + if (errnum > 0 && errnum <= sys_nerr) + return sys_errlist[errnum]; + + return "Unknown system error"; + } + #define strerror private_strerror + #endif /* HAVE_STRERROR */ You can for example look in the latest coreutils (the above is a simplified version of what I found there.) Patches should of course be sent to upstream maintainers, this is very useful even for systems with a working `sys_errlist[]`. @@ -214,11 +214,11 @@ Of course, if you don't care about broken systems (like MS-DOG) not supporting ` On the Hurd, `error_t` is an enumeration of the `E*` constants. However, C++ does not like `E*` integer macros being directly assigned to that enumeration. In short, replace - error_t err = EINTR; + error_t err = EINTR; by - error_t err = error_t(EINTR); + error_t err = error_t(EINTR); ## <a name="Missing_termio_h_tt_"> Missing `termio.h` </a> @@ -356,7 +356,7 @@ With Python, you can use the [`errno` module](http://docs.python.org/library/err ## <a name="libdl"> undefined reference to `dlopen`, `dlsym`, `dlclose` </a> -Configure script often hardcode the library that contains dlopen & such (`-ldl'), and only for Linux. Simply add the other GNU OS cases: replace `linux*' with `linux*|gnu*|k*bsd*-gnu` +Configure script often hardcode the library that contains dlopen & such (`-ldl`), and only for Linux. Simply add the other GNU OS cases: replace `linux*` with `linux*|gnu*|k*bsd*-gnu*` ## <a name="linux_headers"> Missing `linux/types.h`, `asm/types.h`, `linux/limits.h`, `asm/byteorder.h`, `sys/endian.h`, `asm/ioctl.h`, `asm/ioctls.h`, `linux/soundcard.h` </a> |