benilla-re systems structs docs

__set_errno

function · crt · boundary

Address
0x40ceea · 40 bytes, up to 0x40cf11
Signature
void __cdecl (int32_t type)
Meaning
Stores 33 in errno for error type 1 and 34 for types 2 and 3
Confidence
verified, proof one
Name from
the community database (idb)
Finding
crt/math#math-error-flags
Test
crt::crt_frexp_difftest

Finding: Math error flags in crt: math routines

The error exits of these routines set errno and return the value they hold; none calls a _matherr hook. 0x831ac8 holds 0x2694 and nothing writes it, which is what skips the hook; 0x883918, written only by the unreached 0x409a61, stays 0, so the dispatcher's exit reports every error. 0x88391c, set at start-up from 0x40b425, is the processor's FDIV erratum answer, 1 only on a flawed Pentium, so a current CPU runs fprem. __87except takes an error type: 1 marks the masked invalid operation through __handle_exc and 7, a quiet NaN, becomes 1 and skips the marking; __set_errno stores 33 for type 1 and 34 for 2 and 3.

The derivation is in the doc.

Callers 4

Callees 1

Calls and jumps by a bare address, from tables/calls.tsv.