Skip to content

Signal drmtest by PID instead of job number and implement IPC namespaces - #49

Merged
SegMind25 merged 2 commits into
mainfrom
claude/confident-thompson-l42n9z
Dec 6, 2026
Merged

SegMind25 merged 2 commits into
mainfrom
claude/confident-thompson-l42n9z

Conversation

@SegMind25

Copy link
Copy Markdown
Owner

No description provided.

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
@vercel

vercel Bot commented Dec 6, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
seglinux Ready Ready Preview Dec 6, 2026 6:43pm UTC

@SegMind25 SegMind25 left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

nice

@SegMind25
SegMind25 merged commit 2ca4721 into main Dec 6, 2026
2 of 4 checks passed

This branch was successfully deployed

1 active deployment
Preview — d54882fe Deployed Dec 6, 2026 by vercel[bot]
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.

2 participants