Bug 190912

Summary: [libc] shmctl(2) get shared memory state returning error attached process number
Product: Base System Reporter: fausten <fausten>
Component: kernAssignee: freebsd-bugs (Nobody) <bugs>
Status: Open ---    
Severity: Affects Only Me CC: jilles
Priority: ---    
Version: 10.0-RELEASE   
Hardware: Any   
OS: Any   

Description fausten 2014-06-10 23:41:46 UTC
When I call shmctl, like, shmctl(shmid, SHM_STAT, &shmseg) to return the state of the shared memory. the shmseg.shm_nattch is not correct.
Comment 1 Mark Linimon freebsd_committer freebsd_triage 2014-06-15 04:54:49 UTC
adjust summary and component.
Comment 2 Jilles Tjoelker freebsd_committer freebsd_triage 2014-06-29 22:11:31 UTC
When called through the FreeBSD ABI, shmctl(SHM_STAT) will always fail with [EINVAL]. The SHM_STAT cmd is really only intended for Linux's ipcs tool, allowing it to iterate over all shared memory segments in the system. It is probably a bug that the <sys/shm.h> header exposes SHM_STAT and a few other unsupported cmd values to applications.

To request the state of a shared memory segment, use IPC_STAT.
Comment 3 Eitan Adler freebsd_committer freebsd_triage 2018-05-20 23:52:37 UTC
For bugs matching the following conditions:
- Status == In Progress
- Assignee == "bugs@FreeBSD.org"
- Last Modified Year <= 2017

Do
- Set Status to "Open"