1 /* 2 * Copyright (c) 1995 3 * The Regents of the University of California. All rights reserved. 4 * 5 * %sccs.include.redist.c% 6 */ 7 8 /* 9 * Auxillary functions to aid portability to other systems. 10 * These are 4.4BSD routines that are often not found on other systems. 11 * 12 * !!!USE THIS FILE ONLY IF YOU ARE NOT RUNNING 4.4BSD!!! 13 */ 14 15 #ifdef PREPOSIX 16 #define dirent direct 17 extern int errno; 18 #endif 19 20 #ifdef NO_RINDEX 21 #define index strchr 22 #define rindex strrchr 23 #endif 24 25 #ifdef BSDWAIT 26 #define WAITARG_T(a) ((int *)(a)) 27 #else 28 #define WAITARG_T(a) (a) 29 #endif 30 31 #ifdef SETPGID 32 #define setpgrp(a, b) setpgid((pid_t)(a), (pid_t)(b)) 33 #endif 34 35 #ifndef FD_COPY 36 #define FD_COPY(f, t) memcpy((char *)t, (char *)f, sizeof(*(f))) 37 #endif 38 39 #ifdef NO_SNPRINTF 40 int snprintf __P((char *str, size_t n, const char *fmt, ...)); 41 #endif 42