Changeset 22e6802 in mainline for uspace/lib
- Timestamp:
- 2009-12-03T17:49:01Z (16 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 65c1778, fbcfc4da
- Parents:
- 4924675
- Location:
- uspace/lib/libc
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/libc/generic/time.c
r4924675 r22e6802 31 31 */ 32 32 /** @file 33 */ 33 */ 34 34 35 35 #include <sys/time.h> … … 189 189 190 190 /** Wait unconditionally for specified number of microseconds */ 191 int usleep(u nsigned longusec)192 { 193 (void) __SYSCALL1(SYS_THREAD_USLEEP, usec); 191 int usleep(useconds_t usec) 192 { 193 (void) __SYSCALL1(SYS_THREAD_USLEEP, usec); 194 194 return 0; 195 195 } 196 196 197 197 /** Wait unconditionally for specified number of seconds */ 198 unsigned int sleep(unsigned int sec onds)198 unsigned int sleep(unsigned int sec) 199 199 { 200 200 /* Sleep in 1000 second steps to support 201 201 full argument range */ 202 while (sec onds> 0) {203 unsigned int period = (sec onds > 1000) ? 1000 : seconds;202 while (sec > 0) { 203 unsigned int period = (sec > 1000) ? 1000 : sec; 204 204 205 205 usleep(period * 1000000); 206 sec onds-= period;206 sec -= period; 207 207 } 208 208 return 0; -
uspace/lib/libc/include/unistd.h
r4924675 r22e6802 51 51 #endif 52 52 53 typedef uint32_t useconds_t; 54 53 55 extern int dup2(int oldfd, int newfd); 54 56 … … 68 70 69 71 extern void _exit(int status) __attribute__ ((noreturn)); 70 extern int usleep(u nsigned long usec);71 extern unsigned int sleep(unsigned int se conds);72 extern int usleep(useconds_t uses); 73 extern unsigned int sleep(unsigned int se); 72 74 73 75 #endif
Note:
See TracChangeset
for help on using the changeset viewer.