From: Ronnie Sahlberg Date: Sat, 13 Apr 2013 11:13:05 +0000 (-0700) Subject: AROS: implement their weird errno handling X-Git-Tag: upstream/1.9.6^2~224 X-Git-Url: https://git.piment-noir.org/?p=deb_libnfs.git;a=commitdiff_plain;h=f95e1d1108ddb4f40a173139b492bf064d34c4ba AROS: implement their weird errno handling --- diff --git a/aros/aros_compat.c b/aros/aros_compat.c index 6e484f4..c7ff5b3 100644 --- a/aros/aros_compat.c +++ b/aros/aros_compat.c @@ -9,6 +9,8 @@ #include #include #include "aros_compat.h" +#include +#include #undef poll @@ -77,12 +79,23 @@ int minor(int i) struct Library * SocketBase = NULL; +extern int errno; +int h_errno = 0; + + void aros_init_socket(void) { if (!(SocketBase = OpenLibrary("bsdsocket.library", 4))) { printf("NoTCP/IP Stack available"); exit(10); } + if (SocketBaseTags(SBTM_SETVAL(SBTC_ERRNOPTR(sizeof(errno))), + (IPTR)&errno, + SBTM_SETVAL(SBTC_HERRNOLONGPTR), + (IPTR)&h_errno, TAG_DONE)) { + printf("Failed to set ERRNO"); + exit(10); + } } int aros_poll(struct pollfd *fds, unsigned int nfds, int timo)