| Age | Commit message (Collapse) | Author | Lines |
|
|
|
Make TCP connect handle EINTR correctly
According to the [POSIX](https://pubs.opengroup.org/onlinepubs/009695399/functions/connect.html) standard, if connect() is interrupted by a signal that is caught while blocked waiting to establish a connection, connect() shall fail and set errno to EINTR, but the connection request shall not be aborted, and the connection shall be established asynchronously. When the connection has been established asynchronously, select() and poll() shall indicate that the file descriptor for the socket is ready for writing.
The previous implementation differs from the recomendation: in a case of the EINTR we tried to reconnect in a loop and sometimes get EISCONN error (this problem was originally detected on MacOS).
1. More details about the problem in an [article](http://www.madore.org/~david/computers/connect-intr.html).
2. The original [issue](https://git.picodata.io/picodata/picodata/tarantool-module/-/issues/157).
|
|
According to the POSIX standard, if connect() is interrupted by a
signal that is caught while blocked waiting to establish a connection,
connect() shall fail and set errno to EINTR, but the connection
request shall not be aborted, and the connection shall be established
asynchronously.
If asynchronous connection was successfully established after EINTR
and before the next connection attempt, OS returns EISCONN that was
handled as an error before. This behavior is fixed now and we handle
it as success.
The problem affects MacOS users: Linux doesn't return EISCONN in this
case, Windows connect() can not be interrupted without an old-fashoin
WSACancelBlockingCall function that is not used in the library.
So current solution gives connect() as OS specific implementation.
|
|
|
|
|
|
Use std::io::Error::is_interrupted everywhere
In https://github.com/rust-lang/rust/pull/115228 I introduced this helper and started using it, this PR uses it to replace all applicable uses of `std::io::Error::kind`. The justification is the same; for whatever reason LLVM totally flops optimizing `Error::kind` so it's nice to use it less.
FYI ``@mkroening`` I swear the hermit changes look good, but I was so sure about the previous PR.
|
|
|
|
fix(sys/hermit): add is_interrupted
https://github.com/rust-lang/rust/pull/115228 broke compilation for Hermit by not adding a Hermit implementation of is_interrupted.
|
|
Signed-off-by: Martin Kröning <martin.kroening@eonerc.rwth-aachen.de>
|
|
This function does not exist as of hermit-sys 0.4.1 [1].
Once std does not call this function, we can remove it entirely.
[1]: https://github.com/hermitcore/hermit-rs/commit/e38f246e046c3ad50bd2f5e33d8d810d33891cbd#diff-a9b7fa816defab285f0d4fe69d4df4a0cbbcf1c89913000df3273aded949f257R10
Signed-off-by: Martin Kröning <martin.kroening@eonerc.rwth-aachen.de>
|
|
Better Debug for Vars and VarsOs
Display actual vars instead of two dots.
The same was done for Args and ArgsOs in 275f9a04af6191e3aee3852a5a1713.
|
|
Display actual vars instead of two dots.
The same was done for Args and ArgsOs in 275f9a04af6191e3aee3852a5a1713.
|
|
|
|
|
|
On RustyHermit, the function `get_processor_count` returns the
number of activated processors.
|
|
Fix `checked_{add,sub}_duration` incorrectly returning `None` when `other` has more than `i64::MAX` seconds
Use `checked_{add,sub}_unsigned` in `checked_{add,sub}_duration` so that the correct result is returned when adding/subtracting durations with more than `i64::MAX` seconds.
|
|
|
|
|
|
Implement read_buf for RustHermit
In principle, this PR extends rust-lang/rust#108326 for RustyHermit.
|
|
Use random `HashMap` keys on Hermit
Initializing the keys with random data provided by the libOS avoids HashDOS attacks and similar issues.
CC `@stlankes`
|
|
In principle, this PR extends rust-lang/rust#108326 for RustyHermit.
Signed-off-by: Stefan Lankes <slankes@eonerc.rwth-aachen.de>
|
|
|
|
Due to this typo we have to build a workaround for issue
hermitcore/libhermit-rs#191.
RustyHermit is a tier 3 platform and backward compatibility does
not have to be guaranteed.
|
|
|
|
|
|
|
|
|
|
By moving the IO traits, the RustyHermit support is harmonized to
of other operating systems.
|
|
RustHermit publishs a new kernel interface and supports
a common BSD socket layer. By supporting this interface,
the implementation can be harmonized to other operating systems.
To realize this socket layer, the handling of file descriptors
is also harmonized to other operating systems.
|
|
This symbol should be provided by Hermit.
|
|
|
|
|
|
|
|
|
|
has more than `i64::MAX` seconds
|
|
|
|
Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>
|
|
|
|
Fix hermit warnings
This fixes two `unused_imprt` and one `dead_code` warning for hermit.
|
|
Hermit: Add File::set_time stub
This is not supported on hermit yet. This change is required for compiling std.
|
|
Make `ReentrantMutex` movable and `const`
As `MovableMutex` is now `const`, it can be used to simplify the implementation and interface of the internal reentrant mutex type. Consequently, the standard error stream does not need to be wrapped in `OnceLock` and `OnceLock::get_or_init_pin()` can be removed.
|
|
|
|
|
|
This is not supported on hermit yet. This change is required for compiling std.
|
|
|
|
This makes it possible to instruct libstd to never touch the signal
handler for `SIGPIPE`, which makes programs pipeable by default (e.g.
with `./your-program | head -n 1`) without `ErrorKind::BrokenPipe`
errors.
|
|
Signed-off-by: Nick Cameron <nrc@ncameron.org>
|
|
Signed-off-by: Nick Cameron <nrc@ncameron.org>
|
|
|
|
|