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