Shared Memory Object filesystem

QNX SDP8.0User's GuideUser

QNX OS provides a simple Shared Memory Object filesystem that allows read/write files to be placed under /dev/shmem.

Note:
This isn't a full-featured filesystem; it's a window onto the shared memory names that has some filesystem characteristics.

Shared memory objects in the /dev/shmem directory are advertised as name-special files (S_IFNAM) instead of regular files (S_IFREG). Utilities that expect files to be advertised as regular files (e.g., the utility more) might not work as expected.

Note:
If you want to use gzip to compress or expand files in /dev/shmem, you need to specify the -f option.

The Shared Memory Object filesystem is mainly used by the shared memory system of procnto. In special situations (e.g., when no other filesystem is available), you can use the Shared Memory Object filesystem to store file data. But be careful: a file could consume all free shared memory, and this could negatively affect other processes.

You can use this filesystem mostly in tiny embedded systems where you need a small, fast, temporary-storage filesystem but you don't need persistent storage across reboots.

The filesystem comes for free with procnto and doesn't require any setup or device driver. You can simply create files under /dev/shmem and grow them to any size (depending on shared memory resources).

Features not included

In order to minimize the size of the Shared Memory Object filesystem code inside the process manager (procnto), this filesystem doesn't include the following features:
  • file locking
  • directories
  • . and .. entries for the current and parent directories
  • hard or soft links
  • protection from overwriting running executables. A filesystem gives an error of EBUSY if you try to overwrite a running executable; however, in /dev/shmem, that protection doesn't exist and the running executable could crash. This is because the purpose of shared memory is to allow simultaneous reads and writes from separate processes without busy checks.
Page updated: