projects
/
bootcensus
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
foo
[bootcensus]
/
src
/
libc
/
unistd.c
diff --git
a/src/libc/unistd.c
b/src/libc/unistd.c
index
1fc0542
..
7da132f
100644
(file)
--- a/
src/libc/unistd.c
+++ b/
src/libc/unistd.c
@@
-19,6
+19,8
@@
along with this program. If not, see <https://www.gnu.org/licenses/>.
#include <errno.h>
#include "unistd.h"
#include "fs.h"
#include <errno.h>
#include "unistd.h"
#include "fs.h"
+#include "timer.h"
+#include "asmops.h"
int chdir(const char *path)
{
int chdir(const char *path)
{
@@
-59,3
+61,13
@@
int rmdir(const char *path)
fs_close(fsn);
return 0;
}
fs_close(fsn);
return 0;
}
+
+int usleep(unsigned long usec)
+{
+ unsigned long wait_ticks = MSEC_TO_TICKS(usec / 1000ul);
+ unsigned long start_ticks = nticks;
+ while(nticks - start_ticks < wait_ticks) {
+ halt_cpu();
+ }
+ return 0;
+}