Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6152767
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T19:58:38+00:00 2026-05-23T19:58:38+00:00

In System V shared memory ( shmget() ), it is possible to find out

  • 0

In System V shared memory (shmget()), it is possible to find out how many attached users there are for a segment by using shmctl(... IPC_STAT ...) and reading the field shm_nattch of the resulting data structure.

With POSIX shared memory (shm_open()), is there any way to do something similar, or at least find out whether anyone is attached?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T19:58:40+00:00Added an answer on May 23, 2026 at 7:58 pm

    There is at least one way, somewhat cumbersome and probably not quite portable. You can scan /proc filesystem looking for processes that have this SHM object opened. Use readlink on "/proc/<self-PID>/fd/<shm-FD>" to get the object path, and then scan “/proc/[0-9]+/fd/* symlinks, comparing file names they point to or, better yet, device and inode numbers as returned by stat. Or you can simply delegate this task to fuser utility and parse its output.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Does Windows have the notion of system-wide shared memory segments and is there a
Are there any existing libraries/frameworks/products for a distributed shared memory system implemented in .NET,
I have question regarding shared memory segmentation in c using POSIX system calls. Is
I'm using System V Shared Memory to communicate between my two PHP applications. One
Using the obsolete System.Web.Mail sending email works fine, here's the code snippet: Public Shared
I would keep some data in shared memory, using named semaphores to manage access:
When trying to get shared memory, shmget() often fails because being unable to allocate
I'm going to be writing a multi-threaded shared memory messaging system for ultra high-volume
I have a set of Win32 applications that share information using a shared memory
I am using the combination of shm_open() and mmap() to create a shared memory

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.