net: preserve socket errors across syscall boundaries - #460
Conversation
|
build_prs |
|
Job is started, see https://github.com/vivoblueos/kernel/actions/runs/32947049817. |
|
✅ All jobs completed successfully, see https://github.com/vivoblueos/kernel/actions/runs/32947049817. |
|
build_prs |
|
Job is started, see https://github.com/vivoblueos/kernel/actions/runs/34338254658. |
|
❌ Job failed. Failed jobs: build_and_check_boards (failure), see https://github.com/vivoblueos/kernel/actions/runs/34338254658. |
|
build_prs |
|
Job is started, see https://github.com/vivoblueos/kernel/actions/runs/34340874163. |
|
❌ Job failed. Failed jobs: build_and_check_boards (failure), see https://github.com/vivoblueos/kernel/actions/runs/34340874163. |
|
build_prs |
|
Job is started, see https://github.com/vivoblueos/kernel/actions/runs/34355167076. |
|
❌ Job failed. Failed jobs: build_and_check_boards (failure), see https://github.com/vivoblueos/kernel/actions/runs/34355167076. |
Summary
ConnectionErrorandSocketErrorvariants to specific negative POSIX errno values.-1.code::ERROR.Motivation
The BlueOS network stack already distinguishes conditions such as timeout, would-block, invalid file descriptor, queue exhaustion, and address conflicts. The socket syscall and VFS boundaries previously collapsed these failures to a generic
-1, losing the original reason before it reached libc.For example, a timeout should leave the kernel as
-ETIMEDOUT, allowing the libc wrapper to return-1witherrno = ETIMEDOUT. Returning a bare-1from the kernel instead makes the libc layer interpret the error number as1or observe stale errno.This complements vivoblueos/librs#38, which converts negative kernel errno results to the POSIX libc
-1pluserrnoconvention.This PR only preserves reported errors. It does not implement socket timeout enforcement or change network operation behavior.
POSIX references
errnosend()recv()Testing
rustfmt --check kernel/src/net/connection_err.rs kernel/src/net/socket/socket_err.rs kernel/src/net/syscalls.rs kernel/src/vfs/sockfs.rsgit diff --check