Home | History | Annotate | Line # | Download | only in librumpuser
rumpuser_port.h revision 1.1
      1  1.1  pooka /*	$NetBSD: rumpuser_port.h,v 1.1 2012/07/27 09:09:05 pooka Exp $	*/
      2  1.1  pooka 
      3  1.1  pooka /*
      4  1.1  pooka  * Portability header for non-NetBSD platforms.
      5  1.1  pooka  * Quick & dirty.
      6  1.1  pooka  * Maybe should try to use the infrastructure in tools/compat instead?
      7  1.1  pooka  */
      8  1.1  pooka 
      9  1.1  pooka /*
     10  1.1  pooka  * XXX:
     11  1.1  pooka  * There is currently no errno translation for the error values reported
     12  1.1  pooka  * by the hypercall layer.
     13  1.1  pooka  */
     14  1.1  pooka 
     15  1.1  pooka #ifndef _LIB_LIBRUMPUSER_RUMPUSER_PORT_H_
     16  1.1  pooka #define _LIB_LIBRUMPUSER_RUMPUSER_PORT_H_
     17  1.1  pooka 
     18  1.1  pooka #ifdef __NetBSD__
     19  1.1  pooka #include <sys/cdefs.h>
     20  1.1  pooka #endif
     21  1.1  pooka 
     22  1.1  pooka #ifdef __linux__
     23  1.1  pooka #define _XOPEN_SOURCE 600
     24  1.1  pooka #define _BSD_SOURCE
     25  1.1  pooka #define _FILE_OFFSET_BITS 64
     26  1.1  pooka #define _GNU_SOURCE
     27  1.1  pooka #include <features.h>
     28  1.1  pooka #endif
     29  1.1  pooka 
     30  1.1  pooka #include <sys/types.h>
     31  1.1  pooka #include <sys/param.h>
     32  1.1  pooka 
     33  1.1  pooka #ifndef __RCSID
     34  1.1  pooka #define __RCSID(a)
     35  1.1  pooka #endif
     36  1.1  pooka 
     37  1.1  pooka #ifndef INFTIM
     38  1.1  pooka #define INFTIM (-1)
     39  1.1  pooka #endif
     40  1.1  pooka 
     41  1.1  pooka #ifndef _DIAGASSERT
     42  1.1  pooka #define _DIAGASSERT(_p_)
     43  1.1  pooka #endif
     44  1.1  pooka 
     45  1.1  pooka #ifdef __linux__
     46  1.1  pooka #define SA_SETLEN(a,b)
     47  1.1  pooka #else /* BSD */
     48  1.1  pooka #define SA_SETLEN(_sa_, _len_) ((struct sockaddr *)_sa_)->sa_len = _len_
     49  1.1  pooka #endif
     50  1.1  pooka 
     51  1.1  pooka #ifndef __predict_true
     52  1.1  pooka #define __predict_true(a) a
     53  1.1  pooka #define __predict_false(a) a
     54  1.1  pooka #endif
     55  1.1  pooka 
     56  1.1  pooka #ifndef __dead
     57  1.1  pooka #define __dead
     58  1.1  pooka #endif
     59  1.1  pooka 
     60  1.1  pooka #ifndef __printflike
     61  1.1  pooka #define __printflike(a,b)
     62  1.1  pooka #endif
     63  1.1  pooka 
     64  1.1  pooka #ifndef __arraycount
     65  1.1  pooka #define __arraycount(_ar_) (sizeof(_ar_)/sizeof(_ar_[0]))
     66  1.1  pooka #endif
     67  1.1  pooka 
     68  1.1  pooka #ifndef __UNCONST
     69  1.1  pooka #define __UNCONST(_a_) ((void *)(unsigned long)(const void *)(_a_))
     70  1.1  pooka #endif
     71  1.1  pooka 
     72  1.1  pooka #ifdef __linux__
     73  1.1  pooka #define arc4random() random()
     74  1.1  pooka #endif
     75  1.1  pooka 
     76  1.1  pooka #endif /* _LIB_LIBRUMPUSER_RUMPUSER_PORT_H_ */
     77