networking · beginner · ~15 min
Split milliseconds into the seconds field.
SO_RCVTIMEO uses a struct timeval. Implement long ms_to_sec(long ms) returning the whole-seconds part of ms.
long ms_to_sec(long ms) {
/* TODO */
return 0;
}
Solve this exercise in the browser editor — compile and run against the test harness, no setup required.