You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
But the time.now( ) returns always the empty struct value. That is zero, that corresponds to the day zero of 1970 UNIX time.
And the when I run the date command in the shell I see the correct date 2024_12, so it's not a problem of the date inside this computer.
I have seen the code inside time.now() but it calls a
core:time/time_linux.odin
_now :: proc "contextless" () -> Time {
time_spec_now, _ := linux.clock_gettime(.REALTIME)
ns := time_spec_now.time_sec * 1e9 + time_spec_now.time_nsec
return Time{_nsec=i64(ns)}
}
I have substituted .REALTIME with other identifiers without success.
core:sys/linux/sys.odin
/*
Retrieve the time of the specified clock.
Available since Linux 2.6.
*/
clock_gettime :: proc "contextless" (clock: Clock_Id) -> (ts: Time_Spec, err: Errno) {
ret := syscall(SYS_clock_gettime, clock, &ts)
err = Errno(-ret)
return
}
core:sys/linux/sys_call_amd64.odin
SYS_clock_gettime :: uintptr(228)
core:sys/linux/sys_call_arm64.odin
SYS_clock_gettime :: uintptr(113)
/*
Clock IDs for various system clocks.
*/
Clock_Id :: enum {
REALTIME = 0,
MONOTONIC = 1,
PROCESS_CPUTIME_ID = 2,
THREAD_CPUTIME_ID = 3,
MONOTONIC_RAW = 4,
REALTIME_COARSE = 5,
MONOTONIC_COARSE = 6,
BOOTTIME = 7,
REALTIME_ALARM = 8,
BOOTTIME_ALARM = 9,
}
NOTE_0 : I tryed to copy to my program the previous function and change the .REALTIME enum label to others to see if I could make them work, and could not make them work either.
NOTE_1 : If I use the libc.time() and then convert seconds to nanoseconds and fill the time.Time structure (with a transmute ) all my rest program works well. So I believe that there isn't any error on my program.
NOTE_2 : zen3ger on the Odin forum said the following that can also be important:
" zen3ger
I found a couple nvidia forum posts regarding CLOCK_REALTIME, so it could be they have a silently patched libc to get it working. "
Best regards and have a nice day,
Joao Carvalho
The text was updated successfully, but these errors were encountered:
Hello,
I beleave I have found an bug, this is for aarm64 on NVidia Orin 64 GB on Linux Ubuntu from the NVidia.
The Nvidia Orim, each core is similar to a CPU core of a Raspberry Pi 5.
The used version of Odin in this NVidia Orin is :
odin version dev-2024-10
I'm trying to give a date the name of a file and for that I'm using the function time.now() to get the date but it returns the empty struct.
But the time.now( ) returns always the empty struct value. That is zero, that corresponds to the day zero of 1970 UNIX time.
And the when I run the date command in the shell I see the correct date 2024_12, so it's not a problem of the date inside this computer.
I have seen the code inside time.now() but it calls a
NOTE_0 : I tryed to copy to my program the previous function and change the .REALTIME enum label to others to see if I could make them work, and could not make them work either.
NOTE_1 : If I use the libc.time() and then convert seconds to nanoseconds and fill the time.Time structure (with a transmute ) all my rest program works well. So I believe that there isn't any error on my program.
NOTE_2 : zen3ger on the Odin forum said the following that can also be important:
" zen3ger
I found a couple nvidia forum posts regarding CLOCK_REALTIME, so it could be they have a silently patched libc to get it working. "
Best regards and have a nice day,
Joao Carvalho
The text was updated successfully, but these errors were encountered: