Skip to content

Rename some runtime functions to kernel_*.#1342

Merged
sunfishcode merged 1 commit intomainfrom
sunfishcode/kernel
Feb 21, 2025
Merged

Rename some runtime functions to kernel_*.#1342
sunfishcode merged 1 commit intomainfrom
sunfishcode/kernel

Conversation

@sunfishcode
Copy link
Copy Markdown
Member

To help avoid confusion with functions that have the same name as libc functions but have behavior that differs from similarly-named libc functions, rename runtime::fork and similar to runtime::kernel_fork and similar. Also rename types such as Sigaction and similar to KernelSigaction and similar. And rename SIGRTMIN/SIGRTMAX to
KERNEL_SIGRTMIN/KERNEL_SIGRTMAX.

These make it easier to keep these are the kernel items straight from the similarly-named libc structures.

To help avoid confusion with functions that have the same name as libc
functions but have behavior that differs from similarly-named libc functions,
rename `runtime::fork` and similar to `runtime::kernel_fork` and similar.
Also rename types such as `Sigaction` and similar to `KernelSigaction` and
similar. And rename `SIGRTMIN`/`SIGRTMAX` to
`KERNEL_SIGRTMIN`/`KERNEL_SIGRTMAX`.

These make it easier to keep these are the kernel items straight from the
similarly-named libc structures.
@sunfishcode
Copy link
Copy Markdown
Member Author

For example, rustix::runtime::fork differs from libc::fork in that it doesn't invoke the pthread_atfork handlers. That's a significant behavioral difference, so renaming it to rustix::runtime::kernel_fork makes it more clear that it isn't the same thing.

@sunfishcode sunfishcode merged commit e48b93c into main Feb 21, 2025
@sunfishcode sunfishcode deleted the sunfishcode/kernel branch February 21, 2025 23:04
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