Changeset bd41ac52 in mainline for uspace/lib/c/include/fibril_synch.h


Ignore:
Timestamp:
2018-08-25T22:21:25Z (6 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
cca80a2
Parents:
e2625b1a
Message:

Get rid of sys/time.h

This commit moves the POSIX-like time functionality from libc's
sys/time.h to libposix and introduces C11-like or HelenOS-specific
interfaces to libc.

Specifically, use of sys/time.h, struct timeval, suseconds_t and
gettimeofday is replaced by time.h (C11), struct timespec (C11), usec_t
(HelenOS) and getuptime / getrealtime (HelenOS).

Also attempt to fix the implementation of clock() to return microseconds
(clocks) rather than processor cycles and move it to libc.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/include/fibril_synch.h

    re2625b1a rbd41ac52  
    3939#include <adt/list.h>
    4040#include <tls.h>
    41 #include <sys/time.h>
     41#include <time.h>
    4242#include <stdbool.h>
    4343
     
    138138        fid_t handler_fid;
    139139
    140         suseconds_t delay;
     140        usec_t delay;
    141141        fibril_timer_fun_t fun;
    142142        void *arg;
     
    181181extern void fibril_condvar_initialize(fibril_condvar_t *);
    182182extern errno_t fibril_condvar_wait_timeout(fibril_condvar_t *, fibril_mutex_t *,
    183     suseconds_t);
     183    usec_t);
    184184extern void fibril_condvar_wait(fibril_condvar_t *, fibril_mutex_t *);
    185185extern void fibril_condvar_signal(fibril_condvar_t *);
     
    188188extern fibril_timer_t *fibril_timer_create(fibril_mutex_t *);
    189189extern void fibril_timer_destroy(fibril_timer_t *);
    190 extern void fibril_timer_set(fibril_timer_t *, suseconds_t, fibril_timer_fun_t,
     190extern void fibril_timer_set(fibril_timer_t *, usec_t, fibril_timer_fun_t,
    191191    void *);
    192 extern void fibril_timer_set_locked(fibril_timer_t *, suseconds_t,
     192extern void fibril_timer_set_locked(fibril_timer_t *, usec_t,
    193193    fibril_timer_fun_t, void *);
    194194extern fibril_timer_state_t fibril_timer_clear(fibril_timer_t *);
     
    198198extern void fibril_semaphore_up(fibril_semaphore_t *);
    199199extern void fibril_semaphore_down(fibril_semaphore_t *);
    200 extern errno_t fibril_semaphore_down_timeout(fibril_semaphore_t *, suseconds_t);
     200extern errno_t fibril_semaphore_down_timeout(fibril_semaphore_t *, usec_t);
    201201extern void fibril_semaphore_close(fibril_semaphore_t *);
    202202
     
    205205extern void mpsc_destroy(mpsc_t *);
    206206extern errno_t mpsc_send(mpsc_t *, const void *);
    207 extern errno_t mpsc_receive(mpsc_t *, void *, const struct timeval *);
     207extern errno_t mpsc_receive(mpsc_t *, void *, const struct timespec *);
    208208extern void mpsc_close(mpsc_t *);
    209209
Note: See TracChangeset for help on using the changeset viewer.