Refactor gettimeofday()

This commit is contained in:
Justine Tunney 2022-08-05 02:13:41 -07:00
parent 4238e4def9
commit af3df0893b
11 changed files with 195 additions and 36 deletions

View file

@ -16,18 +16,17 @@
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
*/
#include "libc/calls/struct/timeval.h"
#include "libc/calls/internal.h"
#include "libc/fmt/conv.h"
#include "libc/nt/struct/filetime.h"
#include "libc/nt/struct/systemtime.h"
#include "libc/nt/synchronization.h"
#include "libc/str/str.h"
#include "libc/time/struct/timezone.h"
textwindows int sys_gettimeofday_nt(struct timeval *tv, struct timezone *tz) {
textwindows axdx_t sys_gettimeofday_nt(struct timeval *tv, struct timezone *tz,
void *wut) {
struct NtFileTime ft;
GetSystemTimeAsFileTime(&ft);
if (tv) *tv = FileTimeToTimeVal(ft);
if (tz) bzero(tz, sizeof(*tz));
return 0;
return (axdx_t){0, 0};
}