I want to create a number of named memory regions in my program, and mmap them somewhere so that other processes can read them. I can't guarantee that only one instance of my program will run at a time. Ideally, I'd like to put the blocks under /proc/self/<blockname> or such. Is this possible? Or is there another place I can put the mapped files? (My program will normally not run as root.)I don't want to use /proc/self/fd or /proc/self/map_files, since that doesn't allow naming them (as far as I know).
Can I add to /proc/self?
proc;mmap
No, you cannot add your structure in a meaningful way to /proc because it is generated (not a real filesystem).  Likewise /sys on some machines.  Changing the structure of /proc isn't straightforward (see for example Creating a folder under /proc and creating a entry under the folder).Further reading:Linux Filesystem Hierarchy:    Chapter 1. Linux Filesystem Hierarchy: 1.14. /procmmap, munmap - map or unmap files or devices into memoryIs it possible to create a directory and file inside /proc/sys?@mark-plotnick suggested POSIX shared memory, which does support names.Further reading:Posix shared memory vs mapped files (versus mmap, for example)shm_overview - overview of POSIX shared memoryshm_open,  shm_unlink  -  create/open  or  unlink POSIX shared memory objects (These are named objects)The operation of shm_open() is analogous to that of open(2).  name  specifies the shared memory object to be created or opened.  For  portable use, a shared memory object should be identified by a name  of the form /somename; that is, a null-terminated string of up to  NAME_MAX (i.e., 255) characters consisting of an initial slash,  followed by one or more characters, none of which are slashes.shm_open - open a shared memory object (REALTIME) (POSIX)