Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

150
Vistas
Location of /dev/shm on Mac OS X

I am working on a shared memory assignment on Mac OS X

    #define SHARED_OBJECT_PATH    "/my_shared_memory"

    fd = shm_open(SHARED_OBJECT_PATH, O_CREAT | O_EXCL | O_RDWR, S_IRWXU | S_IRWXG);
    if (fd < 0) {                                                         
        perror("In shm_open()");                                          
        exit(1);                                                          
    }

One of the small snippets in the program is the above.

When I compile and run the program a second time, I would get the error:

In shm_open(): File exists

I am assuming because I need to manually delete using rm [path_to]/my_shared_memory. I know on Linux, the default location is dev/shm, however, this path does not exist on Mac OS X.

Where is the location of my_shared_memory so I can delete it?

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

The simplest solution to your problem is not using

O_EXCL

if you don't want that behaviour.

Generally, shared memory objects do have a name, but it's not really a file name -- you can't generally delete them. It's good POSIX style to display them under /dev/shm, but this depends on your OS:

My best guess would be that you should read what man shm_open says on your machine.

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda