Skip to content

Commit

Permalink
Use System.currentTimeMillis for now for gettimeofday. See #98.
Browse files Browse the repository at this point in the history
  • Loading branch information
headius committed Apr 19, 2017
1 parent 09c8904 commit f3f5ce8
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/main/java/jnr/posix/WindowsPOSIX.java
Original file line number Diff line number Diff line change
Expand Up @@ -834,4 +834,16 @@ public int mkfifo(String filename, int mode) {

return -1;
}

public Timeval allocateTimeval() {
return new DefaultNativeTimeval(getRuntime());
}

// TODO: Replace with Win32 calls. See jnr/jnr-posix#98.
public int gettimeofday(Timeval tv) {
long currentMillis = System.currentTimeMillis();
tv.sec(currentMillis / 1000);
tv.usec(currentMillis % 1000 * 1000);
return 0;
}
}

0 comments on commit f3f5ce8

Please sign in to comment.