diff --git a/bld/hdr/fdset.sp b/bld/hdr/fdset.sp index 425cacb386..047165c3b7 100644 --- a/bld/hdr/fdset.sp +++ b/bld/hdr/fdset.sp @@ -15,9 +15,8 @@ typedef struct { fd_mask fds_bits[FD_SETSIZE / __NFDBITS]; } fd_set; -/* We don't use `memset' because this would require a prototype and - * the array isn't too big. - */ +:: We don't use `memset' because this would require a prototype and +:: the array isn't too big. #define FD_ZERO(__set) \ do { \ unsigned int __i; \ @@ -25,8 +24,8 @@ typedef struct { for(__i = 0; __i < sizeof(fd_set) / sizeof(fd_mask); ++__i) \ __FDS_BITS(__arr)[__i] = 0; \ } while( 0 ) -#define FD_SET(__d,__set) (__FDS_BITS(__set)[__FDELT (__d)] |= __FDMASK(__d)) -#define FD_CLR(__d,__set) (__FDS_BITS(__set)[__FDELT (__d)] &= ~__FDMASK(__d)) -#define FD_ISSET(__d,__set) (__FDS_BITS(__set)[__FDELT (__d)] & __FDMASK(__d)) +#define FD_SET(__d,__set) (__FDS_BITS(__set)[__FDELT(__d)] |= __FDMASK(__d)) +#define FD_CLR(__d,__set) (__FDS_BITS(__set)[__FDELT(__d)] &= ~__FDMASK(__d)) +#define FD_ISSET(__d,__set) (__FDS_BITS(__set)[__FDELT(__d)] & __FDMASK(__d)) #endif /* !_FDSET_DEFINED */ diff --git a/bld/hdr/watcom/deps.mif b/bld/hdr/watcom/deps.mif index c623464477..7ae08dc984 100644 --- a/bld/hdr/watcom/deps.mif +++ b/bld/hdr/watcom/deps.mif @@ -323,6 +323,8 @@ h/sys/stat.h : $(mh_dir)/sys/stat.mh $(sys_stat_deps) !else ifeq system rdos h/sys/wait.h : $(mh_dir)/sys/wait.mh $(owhdr) $(cplus) ../wait.sp +h/sys/select.h : $(mh_dir)/sys/select.mh $(sys_select_deps) +h/sys/time.h : $(mh_dir)/sys/time.mh $(sys_time_deps) !else ifeq system linux @@ -417,6 +419,7 @@ h/sys/qnxterm.h : $(qnx_mh_dir)/sys/qnxterm.mh $(packll) h/sys/qnx_glob.h : $(qnx_mh_dir)/sys/qnx_glob.mh $(packll) h/sys/sched.h : $(qnx_mh_dir)/sys/sched.mh $(packll) h/sys/seginfo.h : $(qnx_mh_dir)/sys/seginfo.mh $(packll) +#h/sys/select.h : $(qnx_mh_dir)/sys/select.mh $(packll) h/sys/sendmx.h : $(qnx_mh_dir)/sys/sendmx.mh $(packll) h/sys/ser_msg.h : $(qnx_mh_dir)/sys/ser_msg.mh $(packll) h/sys/sidinfo.h : $(qnx_mh_dir)/sys/sidinfo.mh $(packll) diff --git a/bld/hdr/watcom/sys/select.mh b/bld/hdr/watcom/sys/select.mh index a2fe2e4b44..259f40dcc2 100644 --- a/bld/hdr/watcom/sys/select.mh +++ b/bld/hdr/watcom/sys/select.mh @@ -1,5 +1,5 @@ /* - * sys/select.h POSIX [p]select functions with related defines & macros + * sys/select.h POSIX - select types * :include crwatcnt.sp */ @@ -12,32 +12,19 @@ :include cpluspro.sp -:segment LINUX | RDOS :segment LINUX :include lnxkpack.sp :elsesegment :include pshpackl.sp :endsegment -:: Posix requires, that this belongs to sys/select.h and sys/time.h -:: OpenWatcom had it previously only in sys/time.h - +:: it is shared by sys/select.h and sys/time.h :include fdset.sp -:elsesegment -:include pshpackl.sp - -:endsegment - -:segment LINUX -:include time_t.sp -:endsegment - :include timeval.sp -:segment LINUX | RDOS +:: it is shared by sys/select.h and sys/time.h :include select.sp -:endsegment :include poppack.sp diff --git a/bld/hdr/watcom/sys/time.mh b/bld/hdr/watcom/sys/time.mh index a142ac6565..ffd6898559 100644 --- a/bld/hdr/watcom/sys/time.mh +++ b/bld/hdr/watcom/sys/time.mh @@ -47,6 +47,8 @@ struct timezone { #define DST_TUR 9 /* Turkey */ #define DST_AUSTALT 10 /* Australian style with shift in 1986 */ +:: implemented only for Linux +:segment LINUX /* * Structure used by getitimer() and setitimer() system calls. */ @@ -59,13 +61,14 @@ struct itimerval { #define ITIMER_VIRTUAL 1 /* Timers run only when the process is executing. */ #define ITIMER_PROF 2 /* Process or kernel on its behalf is executing. */ +_WCRTLINK extern int getitimer( int __which, struct itimerval *__value ); +_WCRTLINK extern int setitimer( int __which, const struct itimerval *__value, struct itimerval *__ovalue ); +:endsegment :segment LINUX | RDOS :include select.sp :endsegment _WCRTLINK extern int gettimeofday( struct timeval *__tv, struct timezone *__tz ); _WCRTLINK extern int settimeofday( const struct timeval *__tv, const struct timezone *__tz ); -_WCRTLINK extern int getitimer( int __which, struct itimerval *__value ); -_WCRTLINK extern int setitimer( int __which, const struct itimerval *__value, struct itimerval *__ovalue ); ::_WCRTLINK extern int adjtime( struct timeval *__itv, struct timeval *__otv ); ::_WCRTLINK extern int utimes( char *__path, struct timeval *__tvp );