summaryrefslogtreecommitdiff
path: root/libpthread/nptl/sem_open.c
diff options
context:
space:
mode:
authorChristophe Lyon <christophe.lyon@st.com>2018-07-04 17:55:35 +0200
committerWaldemar Brodkorb <wbrodkorb@conet.de>2018-08-10 16:02:45 +0200
commita20c0b71dc29e1e2d5637366426e7b9ae058f15b (patch)
treec40553c41bd5f7485c71d0cf9e789ea6a1a0a48b /libpthread/nptl/sem_open.c
parent7f07872b8aea16611890865700fbfefd586bc1fb (diff)
nptl: Allow sem_open to work on MMU-less systems
Allow both tmpfs and ramfs for shm devices. * libpthread/nptl/linux_fsinfo.h (SHMFS_SUPER_MAGIC_WITH_MMU): Define. (SHMFS_SUPER_MAGIC_WITHOUT_MMU): Define. * libpthread/nptl/sem_open.c (__where_is_shmfs): Add support for SHMFS_SUPER_MAGIC_WITHOUT_MMU. Signed-off-by: Mickaël Guêné <mickael.guene@st.com> Signed-off-by: Christophe Lyon <christophe.lyon@st.com>
Diffstat (limited to 'libpthread/nptl/sem_open.c')
-rw-r--r--libpthread/nptl/sem_open.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/libpthread/nptl/sem_open.c b/libpthread/nptl/sem_open.c
index d811ec503..2746da1b7 100644
--- a/libpthread/nptl/sem_open.c
+++ b/libpthread/nptl/sem_open.c
@@ -72,7 +72,9 @@ __where_is_shmfs (void)
/* The canonical place is /dev/shm. This is at least what the
documentation tells everybody to do. */
- if (__statfs (defaultmount, &f) == 0 && f.f_type == SHMFS_SUPER_MAGIC)
+ if (__statfs (defaultmount, &f) == 0
+ && (f.f_type == SHMFS_SUPER_MAGIC_WITH_MMU
+ || f.f_type == SHMFS_SUPER_MAGIC_WITHOUT_MMU))
{
/* It is in the normal place. */
mountpoint.dir = (char *) defaultdir;
@@ -106,7 +108,9 @@ __where_is_shmfs (void)
/* First make sure this really is the correct entry. At least
some versions of the kernel give wrong information because
of the implicit mount of the shmfs for SysV IPC. */
- if (__statfs (mp->mnt_dir, &f) != 0 || f.f_type != SHMFS_SUPER_MAGIC)
+ if (__statfs (mp->mnt_dir, &f) != 0
+ || (f.f_type != SHMFS_SUPER_MAGIC_WITH_MMU
+ && f.f_type != SHMFS_SUPER_MAGIC_WITHOUT_MMU))
continue;
namelen = strlen (mp->mnt_dir);