Changeset 582a0b8 in mainline for uspace/lib/c/generic/time.c
- Timestamp:
- 2017-05-08T19:20:39Z (8 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- d2c8533
- Parents:
- 73db198
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/time.c
r73db198 r582a0b8 49 49 #include <ctype.h> 50 50 #include <assert.h> 51 #include <unistd.h>52 51 #include <loc.h> 53 52 #include <device/clock_dev.h> 54 53 #include <malloc.h> 54 #include <thread.h> 55 55 56 56 #define ASCTIME_BUF_LEN 26 … … 685 685 } 686 686 687 /** Wait unconditionally for specified number of microseconds688 *689 */690 int usleep(useconds_t usec)691 {692 (void) __SYSCALL1(SYS_THREAD_USLEEP, usec);693 return 0;694 }695 696 687 void udelay(useconds_t time) 697 688 { 698 689 (void) __SYSCALL1(SYS_THREAD_UDELAY, (sysarg_t) time); 699 }700 701 702 /** Wait unconditionally for specified number of seconds703 *704 */705 unsigned int sleep(unsigned int sec)706 {707 /*708 * Sleep in 1000 second steps to support709 * full argument range710 */711 712 while (sec > 0) {713 unsigned int period = (sec > 1000) ? 1000 : sec;714 715 usleep(period * 1000000);716 sec -= period;717 }718 719 return 0;720 690 } 721 691
Note:
See TracChangeset
for help on using the changeset viewer.