As part of a school assignment, I have to analyze a binary and determine what is does and what it takes to cause the various "branches" (if statements) to be triggered.

I performed a strace on the file and the only part that stands out is a gettimeofday call:

gettimeofday({1303744469, 477209}, NULL) = 0

I know that the first number, 1303740709, is the epoch time when I executed the program, and I know that NULL is for the time zone, but what is that second number?

I'm putting this question here because the binary is compiled C++ code, so hopefully someone can help.

Thanks.

strace will do a lot of work for you in terms of beautifying it's output. What you see there is the full details of a struct timeval (indicated by the {} surrounding the values.

A struct timeval has two data members: seconds, and microseconds since the epoch.

struct timeval { 
    unsigned long  tv_sec;   /* seconds since Jan. 1, 1970 */ 
    long           tv_usec;  /* and microseconds */ 
};
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.