mirror of
https://https.git.savannah.gnu.org/git/bash.git
synced 2026-07-09 05:00:49 +02:00
commit bash-20210305 snapshot
This commit is contained in:
@@ -58,4 +58,33 @@ struct timeval
|
||||
extern int gettimeofday PARAMS((struct timeval *, void *));
|
||||
#endif
|
||||
|
||||
/* These exist on BSD systems, at least. */
|
||||
#if !defined (timerclear)
|
||||
# define timerclear(tvp) do { (tvp)->tv_sec = 0; (tvp)->tv_usec = 0; } while (0)
|
||||
#endif
|
||||
#if !defined (timerisset)
|
||||
# define timerisset(tvp) ((tvp)->tv_sec || (tvp)->tv_usec)
|
||||
#endif
|
||||
#if !defined (timercmp)
|
||||
# define timercmp(a, b, CMP) \
|
||||
(((a)->tv_sec == (b)->tv_sec) ? ((a)->tv_usec CMP (b)->tv_usec) \
|
||||
: ((a)->tv_sec CMP (b)->tv_sec))
|
||||
#endif
|
||||
|
||||
/* These are non-standard. */
|
||||
#if !defined (timerunset)
|
||||
# define timerunset(tvp) ((tvp)->tv_sec == 0 && (tvp)->tv_usec == 0)
|
||||
#endif
|
||||
#if !defined (timerset)
|
||||
# define timerset(tvp, s, u) do { tvp->tv_sec = s; tvp->tv_usec = u; } while (0)
|
||||
#endif
|
||||
|
||||
#ifndef TIMEVAL_TO_TIMESPEC
|
||||
# define TIMEVAL_TO_TIMESPEC(tv, ts) \
|
||||
do { \
|
||||
(ts)->tv_sec = (tv)->tv_sec; \
|
||||
(ts)->tv_nsec = (tv)->tv_usec * 1000; \
|
||||
} while (0)
|
||||
#endif
|
||||
|
||||
#endif /* _POSIXTIME_H_ */
|
||||
|
||||
@@ -46,6 +46,7 @@ typedef struct _shtimer
|
||||
#define SHTIMER_LONGJMP 0x04
|
||||
|
||||
#define SHTIMER_SIGSET 0x100
|
||||
#define SHTIMER_ALRMSET 0x200
|
||||
|
||||
extern sh_timer *shtimer_alloc (void);
|
||||
extern void shtimer_flush (sh_timer *);
|
||||
|
||||
Reference in New Issue
Block a user