Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Johnston <jjohnstn@redhat.com>2005-12-01 02:37:14 +0300
committerJeff Johnston <jjohnstn@redhat.com>2005-12-01 02:37:14 +0300
commit7c15164f1772f7b0e093ff5dd1027051cddc764a (patch)
tree66b1a8fe4d12caf0f7c3fc1fe40559be5a7cd943 /libgloss/arm/libcfunc.c
parent1740d2580bf09d3451e55d3762ae63f71e10852f (diff)
2005-11-30 Shaun Jackman <sjackman@gmail.com>
* arm/libcfunc.c (clock, sleep, usleep): New functions. * arm/syscalls.c (_clock): New function. (_times): Call _clock.
Diffstat (limited to 'libgloss/arm/libcfunc.c')
-rw-r--r--libgloss/arm/libcfunc.c32
1 files changed, 31 insertions, 1 deletions
diff --git a/libgloss/arm/libcfunc.c b/libgloss/arm/libcfunc.c
index f28f527b2..ffad2e7e0 100644
--- a/libgloss/arm/libcfunc.c
+++ b/libgloss/arm/libcfunc.c
@@ -43,6 +43,13 @@ alarm (unsigned seconds)
return 0;
}
+clock_t _clock(void);
+clock_t __attribute__((weak))
+clock(void)
+{
+ return _clock();
+}
+
int _isatty(int fildes);
int __attribute__((weak))
isatty(int fildes)
@@ -51,8 +58,31 @@ isatty(int fildes)
}
int __attribute__((weak))
-pause (void)
+pause(void)
{
errno = ENOSYS;
return -1;
}
+
+#include <sys/types.h>
+#include <time.h>
+
+unsigned __attribute__((weak))
+sleep(unsigned seconds)
+{
+ clock_t t0 = _clock();
+ clock_t dt = seconds * CLOCKS_PER_SEC;
+
+ while (_clock() - t0 < dt);
+ return 0;
+}
+
+int __attribute__((weak))
+usleep(useconds_t useconds)
+{
+ clock_t t0 = _clock();
+ clock_t dt = useconds / (1000000/CLOCKS_PER_SEC);
+
+ while (_clock() - t0 < dt);
+ return 0;
+}