Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 1165a419 in mainline


Ignore:
Timestamp:
2017-05-31T09:37:04Z (5 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master
Children:
78188e5
Parents:
316795c
Message:

libposix: add sleep() function (needed by GCC)

Location:
uspace/lib/posix
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/posix/include/posix/unistd.h

    r316795c r1165a419  
    5757/* Environment */
    5858extern char **__POSIX_DEF__(environ);
     59
     60/* Sleeping */
     61extern unsigned int __POSIX_DEF__(sleep)(unsigned int);
    5962
    6063/* Login Information */
  • uspace/lib/posix/source/unistd.c

    r316795c r1165a419  
    4545
    4646#include "libc/task.h"
     47#include "libc/thread.h"
    4748#include "libc/stats.h"
    4849#include "libc/malloc.h"
     
    5657char **posix_environ = NULL;
    5758char *posix_optarg;
     59
     60/**
     61 * Sleep for the specified number of seconds.
     62 *
     63 * Note that POSIX allows this call to be interrupted and then the return
     64 * value represents remaining seconds for the sleep. HelenOS does not offer
     65 * such functionality and thus always the whole sleep is taken.
     66 *
     67 * @param seconds Number of seconds to sleep.
     68 * @return Always 0 on HelenOS.
     69 */
     70unsigned int posix_sleep(unsigned int seconds)
     71{
     72        return thread_sleep(seconds);
     73}
    5874
    5975/**
Note: See TracChangeset for help on using the changeset viewer.