Changeset bd41ac52 in mainline for uspace/srv


Ignore:
Timestamp:
2018-08-25T22:21:25Z (7 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.

Location:
uspace/srv
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/audio/hound/audio_device.c

    re2625b1a rbd41ac52  
    266266static void device_event_callback(ipc_call_t *icall, void *arg)
    267267{
    268         struct timeval time1;
     268        struct timespec time1;
    269269        errno_t ret;
    270270
     
    286286                            dev->buffer.fragment_size);
    287287                        advance_buffer(dev, dev->buffer.fragment_size);
    288                         struct timeval time2;
     288                        struct timespec time2;
    289289                        getuptime(&time2);
    290                         log_verbose("Time to mix sources: %li\n",
    291                             tv_sub_diff(&time2, &time1));
     290                        log_verbose("Time to mix sources: %lld\n",
     291                            NSEC2USEC(ts_sub_diff(&time2, &time1)));
    292292                        break;
    293293                case PCM_EVENT_CAPTURE_TERMINATED:
  • uspace/srv/net/ethip/atrans.c

    re2625b1a rbd41ac52  
    134134}
    135135
    136 errno_t atrans_lookup_timeout(addr32_t ip_addr, suseconds_t timeout,
     136errno_t atrans_lookup_timeout(addr32_t ip_addr, usec_t timeout,
    137137    addr48_t mac_addr)
    138138{
  • uspace/srv/net/ethip/atrans.h

    re2625b1a rbd41ac52  
    4545extern errno_t atrans_remove(addr32_t);
    4646extern errno_t atrans_lookup(addr32_t, addr48_t);
    47 extern errno_t atrans_lookup_timeout(addr32_t, suseconds_t, addr48_t);
     47extern errno_t atrans_lookup_timeout(addr32_t, usec_t, addr48_t);
    4848
    4949#endif
  • uspace/srv/net/inetsrv/ntrans.c

    re2625b1a rbd41ac52  
    156156 *
    157157 */
    158 errno_t ntrans_wait_timeout(suseconds_t timeout)
     158errno_t ntrans_wait_timeout(usec_t timeout)
    159159{
    160160        fibril_mutex_lock(&ntrans_list_lock);
  • uspace/srv/net/inetsrv/ntrans.h

    re2625b1a rbd41ac52  
    5151extern errno_t ntrans_remove(addr128_t);
    5252extern errno_t ntrans_lookup(addr128_t, addr48_t);
    53 extern errno_t ntrans_wait_timeout(suseconds_t);
     53extern errno_t ntrans_wait_timeout(usec_t);
    5454
    5555#endif
  • uspace/srv/net/tcp/tcp_type.h

    re2625b1a rbd41ac52  
    192192typedef struct {
    193193        link_t link;
    194         suseconds_t delay;
     194        usec_t delay;
    195195        inet_ep2_t epp;
    196196        tcp_segment_t *seg;
Note: See TracChangeset for help on using the changeset viewer.