c - shm_open() function no such file or directory -


i'm trying create new shared memory file using shm_open(), i'm getting errno 2 (no such file or directory).

shm_open ("/diag_public", o_creat | o_rdwr, s_iwusr | s_irusr | s_iwgrp | s_irgrp | s_iroth); 

i've tried creating own standalone app run shm_open same name , options, , is successful...

so checked /dev/shm has drwxrwxrwt permissions , process running actual code has -rwxrwxrwx permissions.

also, mount | grep shm returns:

tmpfs on /dev/shm type tmpfs (rw) 

i'm out of ideas... suggestions on going wrong?

thanks.

make sure passing o_creat. seems giving error.

man page says enoent returned under 2 conditions. shm_open first 1 seems valid though.

man shm_open errors        on failure, errno set indicate cause of error.  values may appear in errno include following:      ...          enoent attempt made shm_open() name did not exist, , o_creat not specified.          enoent attempt made shm_unlink() name not exist. 

Comments

Popular posts from this blog

c# - How Configure Devart dotConnect for SQLite Code First? -

java - Copying object fields -

c++ - Clear the memory after returning a vector in a function -