Bug 190912 - [libc] shmctl(2) get shared memory state returning error attached process number
Summary: [libc] shmctl(2) get shared memory state returning error attached process number
Status: Open
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 10.0-RELEASE
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-06-10 23:41 UTC by fausten
Modified: 2018-05-20 23:52 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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"