provide for Coherent not having gettimeofday(2), imake style (bad, but this is not for others to use without a second thought anyway)

This commit is contained in:
tg
2012-05-04 21:47:04 +00:00
parent 5488e79d3b
commit 7beac6668d
4 changed files with 21 additions and 12 deletions

11
sh.h
View File

@@ -152,7 +152,7 @@
#endif
#ifdef EXTERN
__RCSID("$MirOS: src/bin/mksh/sh.h,v 1.554 2012/05/04 21:15:34 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/sh.h,v 1.555 2012/05/04 21:47:03 tg Exp $");
#endif
#define MKSH_VERSION "R40 2012/04/27"
@@ -349,6 +349,15 @@ extern int __cdecl seteuid(uid_t);
extern int __cdecl setegid(gid_t);
#endif
#if defined(__COHERENT__)
#define mksh_TIME(tv) do { \
(tv).tv_usec = 0; \
(tv).tv_sec = time(NULL); \
} while (/* CONSTCOND */ 0)
#else
#define mksh_TIME(tv) gettimeofday(&(tv), NULL)
#endif
/* remove redundancies */
#if defined(MirBSD) && (MirBSD >= 0x08A8) && !defined(MKSH_OPTSTATIC)