I am working on a problem where a certain file must be placed on a tmpfs and not on a regular filesystem (such as ext4, xfs etc.) The background for the requirement is that the file will be used for shared memory mapping to which DMA will be made, and regular Linux filesystems do not support this situation, causing data corruptions or even kernel panics.
The software will be deployed on various Linux x86_64 configurations, possibly multiple distributions. Instead of requiring the users to create and provide a dedicated tmpfs mountpoint (one more configuration step for them to remember about), I am considering to put the aforementioned file on /dev/shm
, which is already a tmpfs
used to implement POSIX shared memory.
One doubt I have with it is that presence and properties of this mountpoint may be an implementation detail, not a requirement of any standard that GNU/Linux adheres to.
In other words, there might be distributions that do not have /dev/shm
but still are considered compliant. If that is true, then I will not be able to assume/require the /dev/shm
presence.
What is the case here? Does any part of POSIX, SUS or any other standard say anything about the subject?