Commit 0fe9f3f
fix(abi): ustat/vtimes/sprofil are live glibc calls, not ENOSYS stubs (bd-86hcwh)
Resolves the last 3 of the 5 divergences bd-r71n1b's relit target exposed, plus
2 more that only became visible once the first of them stopped failing early.
Each was MEASURED against live glibc 2.42 before deciding which side was wrong,
and they did not all go the same way:
ustat fl WRONG. fl returned a blanket ENOSYS on the premise that Linux 4.18
removed the syscall. It did not; only glibc's header exposure went.
Kernel probe: ustat(0,buf) -1/EINVAL, ustat(dev(/),buf) 0,
ustat(dev(/),NULL) -1/EFAULT. Now issues SYS_USTAT (x86_64; the
aarch64 generic ABI really has no ustat, so ENOSYS stays there).
vtimes fl WRONG. glibc keeps it as a live getrusage wrapper returning 0.
Layout derived by measurement: 10 words, of which vm_ixrss and
vm_maxrss are declared but never assigned. The unit is 1/60 s, not
the 1/HZ its own header claims - 84 successive carry points of
vm_utime were bracketed against getrusage and every one landed on
k*1000000/60 us, ruling out the 16667- and 16666-per-unit variants.
sprofil fl WRONG. glibc succeeds and writes the sampling period into tvp
({0, 1000000/__profile_frequency()}) whatever profcnt says. fl now
matches that contract; it still does not deliver samples, and neither
does profil next door - that gap is filed as bd-br5a1b rather than
papered over.
inet6_opt_init THE TEST was wrong. It asserted the call ZEROES the first two
header bytes. Measured: ip6h_nxt is left to the caller and ip6h_len
is set from the BUFFER length (extlen=16 -> 1, 2040 -> 254), while
0/15/-8/2056 are rejected without writing and a NULL extbuf reports 2
for any extlen. fl already agreed with the host on all of it.
profil THE TEST was wrong. It seeded the HOST's errno with EAGAIN and then
CLEARED fl's, so it compared a survived sentinel against a zero it
had written itself. Both sides leave errno alone; seed both.
Tests are differentials against the live host, not constants: ustat compares
kernel-zeroed struct bytes and asserts EINVAL on an unmounted device (which a
stub cannot fake without issuing the syscall); vtimes sandwiches each fl call
between two host calls and requires every monotone counter to land inside that
bracket, which is what pins the time unit; sprofil asserts the period written
to tvp, which a bare `return 0` fails.
glibc_internal_abi_test: 264 passed / 5 failed at relight, now 272 / 0.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>1 parent 063fc04 commit 0fe9f3f
3 files changed
Lines changed: 469 additions & 53 deletions
File tree
- crates
- frankenlibc-abi
- src
- tests
- frankenlibc-core/src/syscall
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5224 | 5224 | | |
5225 | 5225 | | |
5226 | 5226 | | |
5227 | | - | |
| 5227 | + | |
| 5228 | + | |
| 5229 | + | |
| 5230 | + | |
| 5231 | + | |
| 5232 | + | |
| 5233 | + | |
| 5234 | + | |
| 5235 | + | |
| 5236 | + | |
| 5237 | + | |
| 5238 | + | |
5228 | 5239 | | |
5229 | 5240 | | |
5230 | 5241 | | |
5231 | 5242 | | |
5232 | 5243 | | |
5233 | 5244 | | |
5234 | 5245 | | |
5235 | | - | |
5236 | | - | |
5237 | | - | |
| 5246 | + | |
| 5247 | + | |
| 5248 | + | |
| 5249 | + | |
| 5250 | + | |
| 5251 | + | |
| 5252 | + | |
5238 | 5253 | | |
5239 | | - | |
| 5254 | + | |
5240 | 5255 | | |
5241 | 5256 | | |
5242 | 5257 | | |
| |||
7691 | 7706 | | |
7692 | 7707 | | |
7693 | 7708 | | |
7694 | | - | |
| 7709 | + | |
| 7710 | + | |
| 7711 | + | |
| 7712 | + | |
| 7713 | + | |
| 7714 | + | |
| 7715 | + | |
| 7716 | + | |
| 7717 | + | |
| 7718 | + | |
| 7719 | + | |
| 7720 | + | |
7695 | 7721 | | |
7696 | | - | |
7697 | | - | |
7698 | | - | |
7699 | | - | |
| 7722 | + | |
| 7723 | + | |
| 7724 | + | |
| 7725 | + | |
| 7726 | + | |
7700 | 7727 | | |
| 7728 | + | |
| 7729 | + | |
| 7730 | + | |
| 7731 | + | |
| 7732 | + | |
| 7733 | + | |
| 7734 | + | |
| 7735 | + | |
| 7736 | + | |
| 7737 | + | |
| 7738 | + | |
| 7739 | + | |
| 7740 | + | |
7701 | 7741 | | |
7702 | 7742 | | |
7703 | 7743 | | |
| |||
7756 | 7796 | | |
7757 | 7797 | | |
7758 | 7798 | | |
7759 | | - | |
| 7799 | + | |
| 7800 | + | |
| 7801 | + | |
| 7802 | + | |
| 7803 | + | |
| 7804 | + | |
| 7805 | + | |
| 7806 | + | |
| 7807 | + | |
| 7808 | + | |
| 7809 | + | |
| 7810 | + | |
| 7811 | + | |
| 7812 | + | |
| 7813 | + | |
| 7814 | + | |
| 7815 | + | |
| 7816 | + | |
| 7817 | + | |
| 7818 | + | |
| 7819 | + | |
| 7820 | + | |
| 7821 | + | |
| 7822 | + | |
| 7823 | + | |
| 7824 | + | |
7760 | 7825 | | |
7761 | 7826 | | |
7762 | | - | |
7763 | | - | |
7764 | | - | |
| 7827 | + | |
| 7828 | + | |
| 7829 | + | |
| 7830 | + | |
| 7831 | + | |
| 7832 | + | |
| 7833 | + | |
| 7834 | + | |
| 7835 | + | |
| 7836 | + | |
| 7837 | + | |
| 7838 | + | |
| 7839 | + | |
| 7840 | + | |
| 7841 | + | |
| 7842 | + | |
| 7843 | + | |
| 7844 | + | |
| 7845 | + | |
| 7846 | + | |
| 7847 | + | |
| 7848 | + | |
| 7849 | + | |
| 7850 | + | |
| 7851 | + | |
| 7852 | + | |
| 7853 | + | |
| 7854 | + | |
| 7855 | + | |
| 7856 | + | |
| 7857 | + | |
| 7858 | + | |
| 7859 | + | |
| 7860 | + | |
| 7861 | + | |
| 7862 | + | |
| 7863 | + | |
| 7864 | + | |
| 7865 | + | |
| 7866 | + | |
| 7867 | + | |
| 7868 | + | |
| 7869 | + | |
| 7870 | + | |
7765 | 7871 | | |
7766 | | - | |
7767 | 7872 | | |
7768 | 7873 | | |
7769 | 7874 | | |
| |||
0 commit comments