Patch for Cygwin support: Use S_IRWXU for shmget() and include
<sys/stat.h>. Thanks to Marco Atzeri for reporting the issue and providing an initial patch. This commit was SVN r28060.
Этот коммит содержится в:
родитель
fde6207fe1
Коммит
acefc1588e
@ -9,7 +9,7 @@
|
|||||||
* University of Stuttgart. All rights reserved.
|
* University of Stuttgart. All rights reserved.
|
||||||
* Copyright (c) 2004-2005 The Regents of the University of California.
|
* Copyright (c) 2004-2005 The Regents of the University of California.
|
||||||
* All rights reserved.
|
* 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.
|
* Copyright (c) 2010-2011 Los Alamos National Security, LLC.
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
* Copyright (c) 2011 NVIDIA Corporation. All rights reserved.
|
* Copyright (c) 2011 NVIDIA Corporation. All rights reserved.
|
||||||
@ -44,6 +44,9 @@
|
|||||||
#if HAVE_SYS_SHM_H
|
#if HAVE_SYS_SHM_H
|
||||||
#include <sys/shm.h>
|
#include <sys/shm.h>
|
||||||
#endif /* HAVE_SYS_SHM_H */
|
#endif /* HAVE_SYS_SHM_H */
|
||||||
|
#if HAVE_SYS_STAT_H
|
||||||
|
#include <sys/stat.h>
|
||||||
|
#endif /* HAVE_SYS_STAT_H */
|
||||||
|
|
||||||
#include "opal/constants.h"
|
#include "opal/constants.h"
|
||||||
#include "opal/util/show_help.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()),
|
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;
|
goto out;
|
||||||
}
|
}
|
||||||
else if ((void *)-1 == (addr = shmat(shmid, NULL, 0))) {
|
else if ((void *)-1 == (addr = shmat(shmid, NULL, 0))) {
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
* University of Stuttgart. All rights reserved.
|
* University of Stuttgart. All rights reserved.
|
||||||
* Copyright (c) 2004-2005 The Regents of the University of California.
|
* Copyright (c) 2004-2005 The Regents of the University of California.
|
||||||
* All rights reserved.
|
* 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) 2008 Sun Microsystems, Inc. All rights reserved.
|
||||||
* Copyright (c) 2010-2012 Los Alamos National Security, LLC.
|
* Copyright (c) 2010-2012 Los Alamos National Security, LLC.
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
@ -42,6 +42,9 @@
|
|||||||
#if HAVE_SYS_SHM_H
|
#if HAVE_SYS_SHM_H
|
||||||
#include <sys/shm.h>
|
#include <sys/shm.h>
|
||||||
#endif /* HAVE_SYS_SHM_H */
|
#endif /* HAVE_SYS_SHM_H */
|
||||||
|
#if HAVE_SYS_STAT_H
|
||||||
|
#include <sys/stat.h>
|
||||||
|
#endif /* HAVE_SYS_STAT_H */
|
||||||
#ifdef HAVE_STRING_H
|
#ifdef HAVE_STRING_H
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#endif /* HAVE_STRING_H */
|
#endif /* HAVE_STRING_H */
|
||||||
@ -194,7 +197,7 @@ segment_create(opal_shmem_ds_t *ds_buf,
|
|||||||
* real_size here
|
* real_size here
|
||||||
*/
|
*/
|
||||||
if (-1 == (ds_buf->seg_id = shmget(IPC_PRIVATE, real_size,
|
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;
|
int err = errno;
|
||||||
char hn[MAXHOSTNAMELEN];
|
char hn[MAXHOSTNAMELEN];
|
||||||
gethostname(hn, MAXHOSTNAMELEN - 1);
|
gethostname(hn, MAXHOSTNAMELEN - 1);
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user