Repository navigation
Conversation
gettimeofday() override and use
Make it similar to how we handle `snprintf()`. Drop unused `sys/time.h` headers.
It was MSVC-specific before.
vszakats
force-pushed
the
simplify-gettimeofday
branch
from
April 25, 2023 18:35
b49d2b1 to
f89af02
Compare
gettimeofday() override and usegettimeofday() fallback and use
vszakats
added a commit
that referenced
this pull request
Mar 29, 2024
In AIX, `time.h` header file doesn't have definitions like `fd_set`, `struct timeval`, which are found in `sys/time.h`. Add `sys/time.h` to files affected when available. Regression from e53aae0 #1001. Reported-by: shubhamhii on GitHub Assisted-by: shubhamhii on GitHub Fixes #1334 Fixes #1335 Closes #1340
agreppin
pushed a commit
to agreppin/libssh2
that referenced
this pull request
Jul 14, 2024
Simplify the way we handle `gettimeofday()` fallback for platforms without native support or without any support. Make it similar to how we handle `snprintf()`. In case of no native `gettimeofday()` support and a non-Windows platform, our local fallback returns zero in `tv_usec` and `tv_sec`, ending up with a zero `timeout_remaining` in `session.c`, same as before this patch. Also: - drop unused `sys/time.h` headers. - fix our fallback code to compile with any Windows compilers (not just MSVC) - delete unnecessary casts. Closes libssh2#1001
agreppin
pushed a commit
to agreppin/libssh2
that referenced
this pull request
Jul 14, 2024
In AIX, `time.h` header file doesn't have definitions like `fd_set`, `struct timeval`, which are found in `sys/time.h`. Add `sys/time.h` to files affected when available. Regression from e53aae0 libssh2#1001. Reported-by: shubhamhii on GitHub Assisted-by: shubhamhii on GitHub Fixes libssh2#1334 Fixes libssh2#1335 Closes libssh2#1340
vszakats
added a commit
to vszakats/libssh2
that referenced
this pull request
Apr 15, 2026
Reported-by: nnarayanamurthy on github Fixes libssh2#1792 Follow-up to e53aae0 libssh2#1001
vszakats
added a commit
to vszakats/libssh2
that referenced
this pull request
Apr 15, 2026
Reported-by: nnarayanamurthy on github Fixes libssh2#1792 Follow-up to e53aae0 libssh2#1001
vszakats
added a commit
that referenced
this pull request
Apr 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Simplify the way we handle
gettimeofday()fallback for platformswithout native support or without any support. Make it similar to
how we handle
snprintf().In case of no native
gettimeofday()support and a non-Windowsplatform, our local fallback returns zero in
tv_usecandtv_sec,ending up with a zero
timeout_remaininginsession.c, same asbefore this patch.
Also:
sys/time.hheaders.(not just MSVC)
Closes #1001
It does: https://ci.appveyor.com/project/libssh2org/libssh2/builds/46884850/job/loix9k3t0trrvdc8#L141