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.
adjust summary and component.
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.
For bugs matching the following conditions: - Status == In Progress - Assignee == "bugs@FreeBSD.org" - Last Modified Year <= 2017 Do - Set Status to "Open"