bytevolc...@safe-mail.net wrote: > Yes, it seems to create files with long names (that have nothing to do > with the template I provide) in the /tmp root. > > If it doesn't respect the path or template, what is the point of having > this argument there in the first place, and what is the point of even > having a file on the file system?
The file is the backing for the memory. The path is so that you can refer to the same object. There's no requirement that the path be the name of the file in the filesystem, since you don't use normal file functions to talk to it. > I do not see any promises here. The only promise here is that the shared > memory object will be created atomically. I found it creates long-name > files with mode 0600. If the implementation promises these permissions > for shm_mkstemp(3), then fantastic; it should really be mentioned in the > man page though. "This implementation forces the mode to be 0600" > There's still an issue of the stale files on the file system, should > there be a crash, interruption, signal, or something like that. Even > with close(2), the file remains until shm_unlink(3) is called. That's not unique to shm functions. Everything creating files can do that.