macOS platform bindings: Syscall.rux, Platform.rux, and smoke test#5
Open
devsker wants to merge 1 commit into
Open
macOS platform bindings: Syscall.rux, Platform.rux, and smoke test#5devsker wants to merge 1 commit into
devsker wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements the macOS platform bindings for Rux, providing both a low-level raw syscall FFI module (
MacOS) and aPlatformmodule that fulfills the Std library contract.Changes
Src/Syscall.rux— Raw macOS syscall FFI:0x2000000 | number):SYS_READ,SYS_WRITE,SYS_CLOSE,SYS_MMAP,SYS_MUNMAP,SYS_EXIT,SYS_GETPIDMAP_PRIVATE = 0x0002,MAP_ANONYMOUS = 0x1000)externblock via@[Import(lib: "rux-macos")]consuming the__rux_macos_syscall*thunks added in Add __rux_macos_syscall thunks for raw macOS syscall access Rux#182Read,Write,Close,Exit,GetPid,Mmap,Munmap,Syscall0–Syscall6,IsError,ErrnoSrc/Platform.rux— Std library contract implementation:PlatformAlloc/Realloc/Free— mmap-based allocator with 8-byte header trackingPlatformCopy/Fill/Zero/Compare— byte-level utilitiesPlatformReadStdin/PlatformWriteStdout/PlatformWriteStdoutWide— I/O primitivesPlatformExit— process terminationExamples/Smoke/— Smoke test exercising Read, Write, GetPid, Mmap, and Munmap (exit code 0 on success).Notes
nanosleepandclock_gettimeare intentionally omitted — on macOS these are implemented in libSystem, not as raw kernel traps, so they cannot be exposed through this raw syscall interface.pubkeyword on struct fields is parsed but cross-module field access is not yet fully resolved in the compiler, soTimespechelpers were removed from the API surface.Related
Depends on rux-lang/Rux#182 which adds the
__rux_macos_syscall*linker thunks.