From: Alan Cox Date: Wed, 21 Oct 2015 11:46:09 +0000 (+0100) Subject: libc: Add usleep X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=1b09ab4ee088658398adb45413abf578ed4ad2d2;p=FUZIX.git libc: Add usleep It's just another mapping onto _pause() --- diff --git a/Library/include/unistd.h b/Library/include/unistd.h index 616d26ee..9f34bdc0 100644 --- a/Library/include/unistd.h +++ b/Library/include/unistd.h @@ -24,6 +24,7 @@ extern int lstat __P((const char *, struct stat *)); extern int readlink __P((const char *, char *, int)); extern unsigned int sleep __P((unsigned int seconds)); +extern int usleep __P((useconds_t usecs)); extern char **environ; diff --git a/Library/libs/Makefile b/Library/libs/Makefile index d5953e9e..51f8b873 100644 --- a/Library/libs/Makefile +++ b/Library/libs/Makefile @@ -41,7 +41,7 @@ SRC_C += stat.c stdio0.c stime.c SRC_C += strcasecmp.c strcasestr.c strdup.c stricmp.c strlcpy.c strncasecmp.c SRC_C += strnlen.c strnicmp.c strsep.c strxfrm.c strcoll.c strsignal.c SRC_C += strtod.c strtol.c system.c time.c tmpfile.c tmpnam.c ttyname.c -SRC_C += tzset.c ungetc.c utent.c utimes.c utsname.c +SRC_C += tzset.c ungetc.c usleep.c utent.c utimes.c utsname.c SRC_C += vfprintf.c vprintf.c wait.c xitoa.c pathconf.c SRC_C += gethostname.c sysconf.c confstr.c memccpy.c getpass.c # ctype diff --git a/Library/libs/Makefile.6502 b/Library/libs/Makefile.6502 index 3a2ddf06..f731c2ef 100644 --- a/Library/libs/Makefile.6502 +++ b/Library/libs/Makefile.6502 @@ -52,7 +52,7 @@ SRC_C += stat.c stdio0.c stime.c SRC_C += strcasecmp.c strcasestr.c strdup.c stricmp.c strlcpy.c strncasecmp.c SRC_C += strnicmp.c strnlen.c strsep.c strsignal.c SRC_C += system.c time.c tmpfile.c tmpnam.c ttyname.c -SRC_C += tzset.c ungetc.c utent.c utimes.c utsname.c +SRC_C += tzset.c ungetc.c usleep.c utent.c utimes.c utsname.c SRC_C += vfprintf.c vprintf.c wait.c xitoa.c pathconf.c SRC_C += gethostname.c sysconf.c confstr.c memccpy.c getpass.c SRC_C += strtol.c diff --git a/Library/libs/Makefile.6809 b/Library/libs/Makefile.6809 index 158ac6f6..38af7f88 100644 --- a/Library/libs/Makefile.6809 +++ b/Library/libs/Makefile.6809 @@ -33,7 +33,7 @@ SRC_C += stat.c stdio0.c stime.c SRC_C += strcasecmp.c strcasestr.c strdup.c stricmp.c strlcpy.c strncasecmp.c SRC_C += strnlen.c strnicmp.c strsep.c strsignal.c strxfrm.c strcoll.c SRC_C += strtod.c strtol.c system.c time.c tmpfile.c tmpnam.c ttyname.c -SRC_C += tzset.c ungetc.c utent.c utimes.c utsname.c +SRC_C += tzset.c ungetc.c usleep.c utent.c utimes.c utsname.c SRC_C += vfprintf.c vprintf.c wait.c xitoa.c pathconf.c SRC_C += gethostname.c sysconf.c confstr.c memccpy.c getpass.c # ctype diff --git a/Library/libs/usleep.c b/Library/libs/usleep.c new file mode 100644 index 00000000..fc13fa68 --- /dev/null +++ b/Library/libs/usleep.c @@ -0,0 +1,11 @@ +/* usleep.c + */ +#include +#include +#include +#include + +int usleep(useconds_t us) +{ + return _pause(us/100000UL); +}