1
1

romio: patches from Rob Latham for issue #255

Patches supplied by Rob Latham which fix issue #255.

See
http://git.mpich.org/mpich.git/commit/4e80e1d2b9
http://git.mpich.org/mpich.git/commit/5a10283bf7fd

Signed-off-by: Howard Pritchard <hppritcha@gmail.com>
Этот коммит содержится в:
Howard Pritchard 2015-03-02 15:33:49 -08:00
родитель 375611505b
Коммит 53fd425a6a
7 изменённых файлов: 44 добавлений и 21 удалений

Просмотреть файл

@ -8,11 +8,6 @@
* Copyright (C) 2008 Sun Microsystems, Lustre group
*/
#ifdef _STDC_C99
#define _XOPEN_SOURCE 600
#else
#define _XOPEN_SOURCE 500
#endif
#include <unistd.h>
#include <stdlib.h>

Просмотреть файл

@ -8,11 +8,6 @@
#ifndef AD_XFS_INCLUDE
#define AD_XFS_INCLUDE
#ifdef _STDC_C99
#define _XOPEN_SOURCE 600
#else
#define _XOPEN_SOURCE 500
#endif
#include <unistd.h>
#include <sys/types.h>
#include <fcntl.h>

Просмотреть файл

@ -6,11 +6,6 @@
*/
#ifdef _STDC_C99
#define _XOPEN_SOURCE 600
#else
#define _XOPEN_SOURCE 500
#endif
#include <unistd.h>
#include "adio.h"

Просмотреть файл

@ -6,11 +6,6 @@
*/
#ifdef _STDC_C99
#define _XOPEN_SOURCE 600
#else
#define _XOPEN_SOURCE 500
#endif
#include <unistd.h>
#include "adio.h"

Просмотреть файл

@ -8,7 +8,6 @@
#include <adio.h>
#include <limits.h>
/* utility function for creating large contiguous types: algorithim from BigMPI
* https://github.com/jeffhammond/BigMPI */
@ -78,6 +77,35 @@ int ADIOI_Type_create_hindexed_x(int count,
return ret;
}
/* some systems do not have pread/pwrite, or requrie XOPEN_SOURCE set higher
* than we would like. see #1973 */
#if (HAVE_DECL_PWRITE == 0)
#include <sys/types.h>
#include <unistd.h>
ssize_t pread(int fd, void *buf, size_t count, off_t offset);
ssize_t pwrite(int fd, const void *buf, size_t count, off_t offset);
ssize_t pread(int fd, void *buf, size_t count, off_t offset) {
off_t lseek_ret;
lseek_ret = lseek(fd, offset, SEEK_SET);
if (lseek_ret == -1)
return lseek_ret;
return (read(fd, buf, count));
}
ssize_t pwrite(int fd, const void *buf, size_t count, off_t offset) {
off_t lseek_ret;
lseek_ret = lseek(fd, offset, SEEK_SET);
if (lseek_ret == -1)
return lseek_ret;
return (write(fd, buf, count));
}
#endif
/*
* vim: ts=8 sts=4 sw=4 noexpandtab
*/

Просмотреть файл

@ -1046,3 +1046,10 @@ void *ADIOI_IO_Thread_Func(void *vptr_args);
#endif
#if (HAVE_DECL_PWRITE == 0)
#include <sys/types.h>
#include <unistd.h>
ssize_t pread(int fd, void *buf, size_t count, off_t offset);
ssize_t pwrite(int fd, const void *buf, size_t count, off_t offset);
#endif

Просмотреть файл

@ -1477,6 +1477,14 @@ if test "$ac_cv_header_unistd_h" = "yes" ; then
fi
fi
# pread and pwrite are useful to ROMIO: if implemented well, they help us avoid
# an extra system call. But --enable-strict or CFLAGS="--std=c99" does not
# expose this feature. If we define XOPEN_SOURCE in ROMIO, we cause headaches
# for some versions of lustre, quota.h, and caddr_t. see if we need to provide
# our own pread/pwrite
AC_CHECK_DECLS([pwrite])
####################################################################
# We're about to mess with CC etc. No more feature tests past here,