Repository navigation
Signal drmtest by PID instead of job number and implement IPC namespaces - #49
Merged
Merged
Conversation
The shell session started drmtest in the background and then sent it SIGUSR1 as job %2, assuming the earlier USB mouse step's background job still held %1. When that job had already finished and been reported, the shell numbered drmtest %1 and the step failed with "kill: %2: no such job". Use $! (the last background pid) for the three signals. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Rq8xUwPzGmf9wALtX2i7uM
CLONE_NEWUTS and CLONE_NEWIPC for clone and unshare. A UTS namespace
holds its own host and domain names: uname, sethostname (170) and
setdomainname (171) use the caller's, and changing them needs privilege
over the user namespace that owns it (EPERM before EINVAL, as on Linux).
An IPC namespace holds its own System V objects. Both are owned by the
caller's user namespace (the new one with CLONE_NEWUSER);
CLONE_NEWIPC|CLONE_SYSVSEM is EINVAL. /proc/<pid>/ns/{uts,ipc} name
them.
System V shared memory (ipc.rs, syscall/ipc.rs): shmget (29), shmat
(30), shmctl (31) and shmdt (67). A segment is an unnamed tmpfs file
mapped MAP_SHARED, so fork shares it; the attach count is counted from
the live address spaces, so fork, munmap and exit change it as on Linux.
IPC_RMID frees the key at once and the memory after the last detach.
shmat handles SHM_RND, SHM_REMAP, SHM_RDONLY and SHM_EXEC; shmctl
IPC_STAT, IPC_SET, IPC_RMID, IPC_INFO, SHM_INFO, SHM_STAT(_ANY) and
SHM_LOCK/UNLOCK. Ids are allocated as Linux 6.x does (cyclic indexes,
a sequence number that advances when an index is reused).
/proc/sys/kernel gains hostname and domainname (per UTS namespace),
osrelease, ostype and shmmax/shmall/shmmni; /proc/sysvipc/shm lists
segments in Linux's columns.
userland/tests/sysvipc.c covers both namespaces and shared memory; it
prints the same on Linux, as root or as nobody, and on SegOS. Three
kernel tests cover shmget's rules, id allocation and removal, and the
UTS name rules. The shell session runs BusyBox's `unshare -r -u` with
`hostname`, and attaches one segment twice through glibc from Python's
ctypes. All 36 kernel tests and the full QEMU session pass.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Rq8xUwPzGmf9wALtX2i7uM
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
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.
No description provided.