| Previous | Next |
| EAFNOSUPPORT | EADDRINUSE |
ENOSR
This page examines UCRT compatibility status: no stream resources. The runtime returned the POSIX-supplement ENOSR value rather than a Win32 system error directly.
What the wording actually tells you
Microsoft C runtime compatibility: Ucrt compatibility status: no stream resources is exposed by the Microsoft CRT compatibility layer. _doserrno and the immediately preceding CRT call can preserve the Win32 or runtime condition summarized by errno. The wording attached to ENOSR is a clue to the original interface, not proof that a similarly named modern subsystem returned it.
Microsoft documents that some errno constants exist for UNIX compatibility and that errno is not necessarily the operating-system error code. Preserve both layers during diagnosis.
Evidence before retry
| Evidence | Question it answers |
|---|---|
| CRT call, resource counts, errno, _doserrno, object type, and concurrency. | Ties this error to one live API object instead of a translated message. |
| Thread-local errno captured before another CRT call changes it. | Shows whether this error arose in the caller ABI, wrapper, or provider. |
| Paired Win32 handle/socket state and the actual CRT descriptor conversion. | Preserves the first boundary before errno can be overwritten. |
| Known-good call using the same UCRT build and calling convention. | Provides a same-platform known-good comparison. |
Capture errno immediately after the failing call that produced this error before formatting, tracing, allocation, or cleanup code runs. Retain the function return value as well because many C interfaces signal failure there and use errno only as secondary detail.
Boundary tests
- Release one controlled stream-like resource and repeat. Record whether the control reaches the same syscall or runtime boundary as this error.
- Log errno with _get_errno and _doserrno at the immediate failure site. A changed errno after this test is a new boundary, not another spelling of this error.
- Verify the numeric value against the target UCRT header rather than a Unix table. Repeat the original operation after the control so the result remains relevant to this error.
Two observations are especially discriminating here: CRT call, resource counts, errno, _doserrno, object type, and concurrency. Use this control for comparison: release one controlled stream-like resource and repeat. Those two observations separate a stale identifier or unsupported request from a provider-wide failure without broad changes to the host.
Do not translate it blindly
| Tempting assumption | Safer interpretation |
|---|---|
| The English phrase is assumed to be portable | this error belongs to Microsoft C runtime compatibility; verify the target headers and returning API before applying another platform's errno table |
| A retry succeeded and erased the original evidence | The retry can replace this error with a different state; preserve the first call, numeric value, and object generation beforehand |
If a wrapper converts this error to an exception or Boolean, instrument below that wrapper. The decisive record is the syscall, ioctl, CRT function, or compatibility entry point that first exposed the value.
Proving the fix
Targeted correction. Bound resource use and inspect the underlying OS error before assuming UNIX STREAMS internals on Windows.
Regression proof. Resource pressure recovers and the caller reports both CRT and OS layers correctly. Verify one supported boundary case and one deliberate negative case so handling of this error remains explicit.
Technical references
References for Microsoft C runtime compatibility ENOSR on the deployed platform version.
- Microsoft: errno constants — defines the status namespace used.
- Microsoft: _get_errno — documents the API or lifecycle boundary behind this error.
- Microsoft: _doserrno and errno — provides ABI, implementation, or protocol context.
- The Open Group: errno.h — supports the portability and verification limits.
Looking for a different code? Search another status or error code.
