2 * Routines which may be missing on some machines
8 #if !defined __amigaos4__ && !defined __AROS__
10 memmove(void *d
, const void *s
, size_t n
)
12 char *dp
= (char *) d
, *sp
= (char *) s
;
38 # include "ksh_time.h"
39 # include "ksh_times.h"
40 # include <sys/timeb.h>
43 ksh_times(struct tms
*tms
)
45 static INT32 base_sec
;
47 /* Assume times() available, but always returns 0
48 * (also assumes ftime() available)
53 if (times(tms
) == (INT32
) -1)
58 rv
= (tb
.time
- base_sec
) * CLK_TCK
;
59 rv
+= tb
.millitm
* CLK_TCK
/ 1000;
68 dup2(int oldd
, int newd
)
72 if (fcntl(oldd
, F_GETFL
, 0) == -1)
73 return -1; /* errno == EBADF */
80 close(newd
); /* in case its open */
84 return fcntl(oldd
, F_DUPFD
, newd
);