Browse Source

Unix port: add support for the Hurd.

* ports/unix/port/include/arch/cc.h:
        Define LWIP_ERRNO_STDINCLUDE for Linux and Hurd, as defining
        LWIP_ERRNO_INCLUDE doesn't work on these systems.
    * ports/unix/port/sys_arch.c:
        Rename pthread_cond_wait() and pthread_cond_timedwait()
        to use the Hurd's non-portable versions on GNU systems.
master
Joan Lledó 8 years ago committed by Dirk Ziegelmeier
parent
commit
fe1a40db63
  1. 6
      ports/unix/port/include/arch/cc.h
  2. 5
      ports/unix/port/sys_arch.c

6
ports/unix/port/include/arch/cc.h

@ -43,6 +43,8 @@
#define LWIP_UNIX_OPENBSD
#elif defined __CYGWIN__
#define LWIP_UNIX_CYGWIN
#elif defined __GNU__
#define LWIP_UNIX_HURD
#endif
#define LWIP_TIMEVAL_PRIVATE 0
@ -50,6 +52,10 @@
#define LWIP_ERRNO_INCLUDE <errno.h>
#if defined(LWIP_UNIX_LINUX) || defined(LWIP_UNIX_HURD)
#define LWIP_ERRNO_STDINCLUDE 1
#endif
#define LWIP_RAND() ((u32_t)rand())
/* different handling for unit test, normally not needed */

5
ports/unix/port/sys_arch.c

@ -477,6 +477,11 @@ cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex, u32_t timeout)
struct timespec rtime1, rtime2, ts;
int ret;
#ifdef __GNU__
#define pthread_cond_wait pthread_hurd_cond_wait_np
#define pthread_cond_timedwait pthread_hurd_cond_timedwait_np
#endif
if (timeout == 0) {
pthread_cond_wait(cond, mutex);
return 0;

Loading…
Cancel
Save