import std ffi.struct export type timeval = native ffi "long" "seconds" "unsigned int" "microseconds" export type timezone = native ffi "int" "minutes_greenwich" "int" "dst_time" func gettimeofday(value, tz) native ffi "c" "int gettimeofday(struct timeval*, struct timezone*)" export func main() { let time = ffiStructAllocate(timeval) let zone = ffiStructAllocate(timezone) let result = gettimeofday(time, zone) let seconds = ffiStructValue(timeval, "seconds", time) println("Result:", result) println("Seconds:", seconds) }