Skip to content

feat(c/sys): restore native select and time functions - #49

Draft
MeteorsLiu wants to merge 6 commits into
goplus:mainfrom
MeteorsLiu:codex/c-sys-pub-types
Draft

MeteorsLiu wants to merge 6 commits into
goplus:mainfrom
MeteorsLiu:codex/c-sys-pub-types

Conversation

@MeteorsLiu

@MeteorsLiu MeteorsLiu commented Oct 19, 2026 •

Copy link
Copy Markdown
Member

Restore native select and time APIs with compatible public names.

The implementation includes:

  • Classify the macOS 14 and glibc 2.24 declarations for the three supported targets.
  • Use the generated Select declaration under the existing shared entry point, preserving its FdSet and Timeval parameters on every target.
  • Keep methods off the non-local Timeval alias, and retain existing FD macros and platform declarations.
  • Pass native Timeval layout, zero-timeout Select, and Gettimeofday checks with GC and nogc on all three targets.

The package retains its public calling convention and C symbol coverage.

@MeteorsLiu

MeteorsLiu commented Oct 19, 2026 •

Copy link
Copy Markdown
Member Author

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 Native prefix.

The combined prerequisite snapshot passes llgo build and executed llgo test runs on macOS arm64, Linux amd64 and Linux arm64, both with GC and -tags=nogc (54 package test runs and 6 complete builds). Generation uses unmodified llcppg main da227ff4, macOS SDK 14.0 and Bootlin glibc 2.24 headers. The earlier Timeval receiver and Signal layout failures are resolved.

These PRs remain draft for review. Documented generator/ABI failures and previously approved va_list exclusions remain; there are zero handwritten-retention exclusions.

@fennoai fennoai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 FdSet and T timeval Timeval match the exported FdSet/Timeval types in c/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 .pub files that list types only.
  • Format & convention. Uses the newer D/T prefix style, consistent with c/llcppg.pub, c/time, c/os, c/types, and c/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.

@MeteorsLiu MeteorsLiu changed the title feat(c/sys): publish existing system type mappings feat(c/sys): generate native select bindings Oct 19, 2026
@MeteorsLiu MeteorsLiu changed the title feat(c/sys): generate native select bindings feat(c/sys): publish native select dependencies Oct 19, 2026
@MeteorsLiu MeteorsLiu changed the title feat(c/sys): publish native select dependencies feat(c/sys): add classified system time declarations Oct 19, 2026
@MeteorsLiu MeteorsLiu changed the title feat(c/sys): add classified system time declarations feat(c/sys): restore native select and time functions Oct 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant