diff --git a/opal/mca/shmem/sysv/shmem_sysv_component.c b/opal/mca/shmem/sysv/shmem_sysv_component.c index 956fd829ef..e202fea1f4 100644 --- a/opal/mca/shmem/sysv/shmem_sysv_component.c +++ b/opal/mca/shmem/sysv/shmem_sysv_component.c @@ -9,7 +9,7 @@ * University of Stuttgart. All rights reserved. * Copyright (c) 2004-2005 The Regents of the University of California. * All rights reserved. - * Copyright (c) 2007-2010 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2007-2013 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2010-2011 Los Alamos National Security, LLC. * All rights reserved. * Copyright (c) 2011 NVIDIA Corporation. All rights reserved. @@ -44,6 +44,9 @@ #if HAVE_SYS_SHM_H #include #endif /* HAVE_SYS_SHM_H */ +#if HAVE_SYS_STAT_H +#include +#endif /* HAVE_SYS_STAT_H */ #include "opal/constants.h" #include "opal/util/show_help.h" @@ -170,7 +173,7 @@ sysv_runtime_query(mca_base_module_t **module, int *priority, const char *hint) ); if (-1 == (shmid = shmget(IPC_PRIVATE, (size_t)(getpagesize()), - IPC_CREAT | IPC_EXCL | SHM_R | SHM_W))) { + IPC_CREAT | IPC_EXCL | S_IRWXU ))) { goto out; } else if ((void *)-1 == (addr = shmat(shmid, NULL, 0))) { diff --git a/opal/mca/shmem/sysv/shmem_sysv_module.c b/opal/mca/shmem/sysv/shmem_sysv_module.c index 1d8389c938..75c4fa144e 100644 --- a/opal/mca/shmem/sysv/shmem_sysv_module.c +++ b/opal/mca/shmem/sysv/shmem_sysv_module.c @@ -9,7 +9,7 @@ * University of Stuttgart. All rights reserved. * Copyright (c) 2004-2005 The Regents of the University of California. * All rights reserved. - * Copyright (c) 2007-2010 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2007-2013 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2008 Sun Microsystems, Inc. All rights reserved. * Copyright (c) 2010-2012 Los Alamos National Security, LLC. * All rights reserved. @@ -42,6 +42,9 @@ #if HAVE_SYS_SHM_H #include #endif /* HAVE_SYS_SHM_H */ +#if HAVE_SYS_STAT_H +#include +#endif /* HAVE_SYS_STAT_H */ #ifdef HAVE_STRING_H #include #endif /* HAVE_STRING_H */ @@ -194,7 +197,7 @@ segment_create(opal_shmem_ds_t *ds_buf, * real_size here */ if (-1 == (ds_buf->seg_id = shmget(IPC_PRIVATE, real_size, - IPC_CREAT | IPC_EXCL | SHM_R | SHM_W))) { + IPC_CREAT | IPC_EXCL | S_IRWXU))) { int err = errno; char hn[MAXHOSTNAMELEN]; gethostname(hn, MAXHOSTNAMELEN - 1);