Repository navigation
feat(c/sys): restore native select and time functions - #49
MeteorsLiu wants to merge 6 commits into
Conversation
|
Merge order: #45 → #51 → #48 → #49 → #44 → #47 → #46 → #50 → #52. Each draft changes one folder only. This refresh regenerates native APIs without omitting functions merely to preserve handwritten entry points. Existing compatibility APIs remain available; colliding native names use the The combined prerequisite snapshot passes These PRs remain draft for review. Documented generator/ABI failures and previously approved |
There was a problem hiding this comment.
FennoAI Review — PR #49
Scope: one new file, c/sys/llcppg.pub (3 lines), publishing native system type mappings for the llcppg binding generator.
Reviewed across correctness, quality, security, performance, and documentation accuracy. The change is small, well-scoped, and correct.
Verified
- Type mappings are accurate.
T fd_set FdSetandT timeval Timevalmatch the exportedFdSet/Timevaltypes inc/sys/select.go:20-21, which are the only public types in the package. Functions (FD_ZERO/FD_SET/FD_ISSET/Select) are correctly omitted, matching other.pubfiles that list types only. - Format & convention. Uses the newer
D/Tprefix style, consistent withc/llcppg.pub,c/time,c/os,c/types, andc/pthread. Trailing newline present; naming matches the established C→Go convention. - No security, performance, or secret-exposure concerns. It is static generator-time metadata with no runtime behavior.
Minor (non-blocking) — consistency note
c/sys/llcppg.pub:1 declares D github.com/goplus/lib/c. This import is genuinely used (select.go references c.Int in exported signatures), so the line is justified. Worth a quick awareness note: the directly analogous c/os/llcppg.pub maps stat→StatT where StatT = syscall.Stat_t (an alias to c/syscall, mirroring FdSet = syscall.FdSet here) yet declares no D line at all. So the two sibling manifests differ in whether they emit a D line for this pattern.
This is not a defect — the repo precedent (c/llcppg.pub lists D targets that aren't direct Go imports of c.go) indicates D records binding dependencies rather than "the package owning the mapped types," under which D github.com/goplus/lib/c is correct and a D .../c/syscall line is not required (and no .pub in the repo declares one). Flagging only so the author can confirm the intended D semantics match llcppg's expectation and the c/os style.
No changes required. Looks good to merge.
Restore native select and time APIs with compatible public names.
The implementation includes:
Selectdeclaration under the existing shared entry point, preserving itsFdSetandTimevalparameters on every target.Timevalalias, and retain existing FD macros and platform declarations.Timevallayout, zero-timeoutSelect, andGettimeofdaychecks with GC andnogcon all three targets.The package retains its public calling convention and C symbol coverage.