diff --git a/src/libCom/cmdSubr.c b/src/libCom/cmdSubr.c index 4dcbcfa2b..9b682b689 100644 --- a/src/libCom/cmdSubr.c +++ b/src/libCom/cmdSubr.c @@ -69,6 +69,8 @@ # include # include /* for 'select' operations */ # include /* for 'select' operations */ + +# include #endif #include @@ -146,6 +148,7 @@ CX_CMD **ppCxCmd; /* I pointer to pointer to command context */ fd_set fdSet; /* set of fd's to watch with select */ int fdSetWidth; /* width of select bit mask */ struct timeval fdSetTimeout;/* timeout interval for select */ + struct rlimit rlp; #endif CX_CMD *pCxCmd=*ppCxCmd;/* pointer to command context */ int i; @@ -161,7 +164,12 @@ CX_CMD **ppCxCmd; /* I pointer to pointer to command context */ } #ifndef vxWorks +/* MDA - use getrlimit since getdtablesize() is obsolete fdSetWidth = getdtablesize(); +*/ + getrlimit(RLIMIT_NOFILE,&rlp); + fdSetWidth = rlp.rlim_cur; + fdSetTimeout.tv_sec = 0; fdSetTimeout.tv_usec = 0; FD_ZERO(&fdSet); diff --git a/src/libCom/cvtNumbers.c b/src/libCom/cvtNumbers.c index cfe729c73..8ca51eeb1 100644 --- a/src/libCom/cvtNumbers.c +++ b/src/libCom/cvtNumbers.c @@ -61,8 +61,14 @@ #ifdef vxWorks -#define nint(value) (value>=0 ? (int)((value)+.5) : (int)((value)-.5)) -#define exp10(value) (exp(value * log(10.))) +# define nint(value) (value>=0 ? (int)((value)+.5) : (int)((value)-.5)) +# define exp10(value) (exp(value * log(10.))) +#else +/* really nint and exp10 aren't ANSI-C or POSIX */ +# ifndef sun +# define nint(value) (value>=0 ? (int)((value)+.5) : (int)((value)-.5)) +# define exp10(value) (exp(value * log(10.))) +# endif #endif #if 0 diff --git a/src/libCom/ezsSockSubr.c b/src/libCom/ezsSockSubr.c index a89bb186f..9327b9583 100644 --- a/src/libCom/ezsSockSubr.c +++ b/src/libCom/ezsSockSubr.c @@ -519,7 +519,10 @@ int seconds; /* I number of seconds (added to usec) to sleep */ int usec; /* I number of micro-sec (added to sec) to sleep */ { #ifndef vxWorks + sleep((unsigned int)seconds); +/* MDA - usleep isn't POSIX usleep((unsigned)(seconds*1000000 + usec)); +*/ #else int ticks; static int ticksPerSec=0;