-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[build error]gettimeofday is undefined #20
Comments
OK, care to send one MR? BTW, not trigger in my test environment(fedora). thanks, |
Looks it is better to use system_clock of libstdc++, given qcow2 is basically |
Fixed by c4995da ("qcow2: replace gettimeofday with std::chrono::system_clock::now()") |
Thanks for the fix, the build succeeds now! |
eqcow2/qcow2.cpp: In constructor ‘MetaFlushingState::MetaFlushingState(Qcow2TopTable&, bool)’:
qcow2/qcow2.cpp:917:2: error: ‘gettimeofday’ was not declared in this scope; did you mean ‘SYS_gettimeofday’?
917 | gettimeofday(&last_flush, NULL);
| ^~~~~~~~~~~~
| SYS_gettimeofday
qcow2/qcow2.cpp: In member function ‘void MetaFlushingState::__done(Qcow2State&, ublksrv_queue*)’:
qcow2/qcow2.cpp:1121:2: error: ‘gettimeofday’ was not declared in this scope; did you mean ‘SYS_gettimeofday’?
1121 | gettimeofday(&last_flush, NULL);
| ^~~~~~~~~~~~
| SYS_gettimeofday
qcow2/qcow2.cpp: In member function ‘bool MetaFlushingState::__need_flush(int)’:
qcow2/qcow2.cpp:1324:3: error: ‘gettimeofday’ was not declared in this scope; did you mean ‘SYS_gettimeofday’?
1324 | gettimeofday(&t, NULL);
| ^~~~~~~~~~~~
| SYS_gettimeofday
make[2]: *** [Makefile:750: ublk-qcow2.o] Error 1
make[2]: Leaving directory '/root/work/ubdsrv'
make[1]: *** [Makefile:828: all-recursive] Error 1
make[1]: Leaving directory '/root/work/ubdsrv'
make: *** [Makefile:476: all] Error 2
Maybe we should include <sys/time.h> in qcow2/qcow2.h? I did so and it succeeded.
The text was updated successfully, but these errors were encountered: