Changeset 0c09f2b in mainline


Ignore:
Timestamp:
2007-11-19T16:34:25Z (17 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
bc50fc42
Parents:
2e51969
Message:

usleep() should return int. Non-void functions really should return a value, so
fix sleep() to always return 0.

Location:
uspace/lib/libc
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/libc/generic/time.c

    r2e51969 r0c09f2b  
    188188
    189189/** Wait unconditionally for specified number of microseconds */
    190 void usleep(unsigned long usec)
     190int usleep(unsigned long usec)
    191191{
    192192        atomic_t futex = FUTEX_INITIALIZER;
     
    194194        futex_initialize(&futex, 0);
    195195        futex_down_timeout(&futex, usec, 0);
     196        return 0;
    196197}
    197198
     
    211212                seconds -= period;
    212213        }
     214        return 0;
    213215}
    214216
  • uspace/lib/libc/include/unistd.h

    r2e51969 r0c09f2b  
    4646extern void _exit(int status);
    4747extern void *sbrk(ssize_t incr);
    48 extern void usleep(unsigned long usec);
     48extern int usleep(unsigned long usec);
    4949extern unsigned int sleep(unsigned int seconds);
    5050
Note: See TracChangeset for help on using the changeset viewer.