Skip to content

Getting current time in libuinet. nanotime/microtime always writes tv_sec=1 #40

Description

@joerango

I am trying to make some changes to congestion control in libuinet. I need to track the current time (or up time). I have tried using the nanotime/microtime and nanouptime/microuptime functions in sys/time.h but the timespec/timeval struct returned always has tv_sec=1. It does not change.

A simple test to replicate this issue would be to add the following lines at the top of the cc_ack_received function in sys/netinet/tcp_input.c:

struct timespec ts;
getnanotime(&ts);
printf("Time= %ld\n", ts.tv_sec);

I tried to trace the function calls in the sys/ folder as well as the uinet_kern_*.c files but I can't figure out why the tv_sec value is always equal to 1.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions