OSDN Git Service

2013.10.24
[uclinux-h8/uClinux-dist.git] / user / l2tpd / osport.h
1 /*
2  * Layer Two Tunnelling Protocol Daemon
3  * Copyright (C) 1998 Adtran, Inc.
4  * Copyright (C) 2002 Jeff McAdams
5  *
6  * Mark Spencer
7  *
8  * This software is distributed under the terms
9  * of the GPL, which you should have received
10  * along with this source.
11  *
12  * OS Portability header file. try to map some
13  * "standard" routines into OS-specific routines.
14  *
15  */
16
17 #ifndef _OSPORT_H_
18 #define _OSPORT_H_
19
20 #if defined(SOLARIS)
21
22 # define index(x, y)        strchr(x, y)
23 # define bcopy(S1, S2, LEN) ((void)memmove(S2, S1, LEN))
24 # define bzero(S1, LEN)     ((void)memset(S1,  0, LEN))
25 # define bcmp(S1,S2,LEN)    ((memcmp(S2, S1, LEN)==0)?0:1)
26
27 /* pre 2.6 solaris didn't include random(), etc prototypes 
28  * <stdlib.h> (as of 2.6) has the correct prototypes.
29  */
30
31 # if SOLARIS < 260
32 #  define random(X)          ((int)rand(X))
33 #  define srandom(X)         ((void)srand(X))
34 # endif /* SOLARIS < 260 */
35
36 #endif /* defined(SOLARIS) */
37
38 #endif /* _OSPORT_H_ */