diff --git a/src/mca/io/romio/romio-dist/adio/ad_nfs/ad_nfs_iwrite.c b/src/mca/io/romio/romio-dist/adio/ad_nfs/ad_nfs_iwrite.c index cf2a7c8eb5..0d9aa5a990 100644 --- a/src/mca/io/romio/romio-dist/adio/ad_nfs/ad_nfs_iwrite.c +++ b/src/mca/io/romio/romio-dist/adio/ad_nfs/ad_nfs_iwrite.c @@ -200,13 +200,21 @@ int error_code, this_errno; aiocbp->aio_nbytes = len; if (wr) { ADIOI_WRITE_LOCK(fd, offset, SEEK_SET, len); +#if !defined(_AIO_AIX_SOURCE) && !defined(_NO_PROTO) + err = aio_write(aiocbp); +#else err = aio_write(fd_sys, aiocbp); +#endif this_errno = errno; ADIOI_UNLOCK(fd, offset, SEEK_SET, len); } else { ADIOI_READ_LOCK(fd, offset, SEEK_SET, len); +#if !defined(_AIO_AIX_SOURCE) && !defined(_NO_PROTO) + err = aio_read(aiocbp); +#else err = aio_read(fd_sys, aiocbp); +#endif this_errno = errno; ADIOI_UNLOCK(fd, offset, SEEK_SET, len); } @@ -219,13 +227,21 @@ int error_code, this_errno; ADIOI_Complete_async(&error_code); if (wr) { ADIOI_WRITE_LOCK(fd, offset, SEEK_SET, len); +#if !defined(_AIO_AIX_SOURCE) && !defined(_NO_PROTO) + err = aio_write(aiocbp); +#else err = aio_write(fd_sys, aiocbp); +#endif this_errno = errno; ADIOI_UNLOCK(fd, offset, SEEK_SET, len); } else { ADIOI_READ_LOCK(fd, offset, SEEK_SET, len); +#if !defined(_AIO_AIX_SOURCE) && !defined(_NO_PROTO) + err = aio_read(aiocbp); +#else err = aio_read(fd_sys, aiocbp); +#endif this_errno = errno; ADIOI_UNLOCK(fd, offset, SEEK_SET, len); } @@ -236,13 +252,21 @@ int error_code, this_errno; sleep(1); if (wr) { ADIOI_WRITE_LOCK(fd, offset, SEEK_SET, len); +#if !defined(_AIO_AIX_SOURCE) && !defined(_NO_PROTO) + err = aio_write(aiocbp); +#else err = aio_write(fd_sys, aiocbp); +#endif this_errno = errno; ADIOI_UNLOCK(fd, offset, SEEK_SET, len); } else { ADIOI_READ_LOCK(fd, offset, SEEK_SET, len); +#if !defined(_AIO_AIX_SOURCE) && !defined(_NO_PROTO) + err = aio_read(aiocbp); +#else err = aio_read(fd_sys, aiocbp); +#endif this_errno = errno; ADIOI_UNLOCK(fd, offset, SEEK_SET, len); } diff --git a/src/mca/io/romio/romio-dist/adio/ad_nfs/ad_nfs_wait.c b/src/mca/io/romio/romio-dist/adio/ad_nfs/ad_nfs_wait.c index c3bb8be412..8fcd8ea494 100644 --- a/src/mca/io/romio/romio-dist/adio/ad_nfs/ad_nfs_wait.c +++ b/src/mca/io/romio/romio-dist/adio/ad_nfs/ad_nfs_wait.c @@ -69,7 +69,11 @@ void ADIOI_NFS_ReadComplete(ADIO_Request *request, ADIO_Status *status, int *err /* IBM */ if ((*request)->queued) { do { +#if !defined(_AIO_AIX_SOURCE) && !defined(_NO_PROTO) + err = aio_suspend((*request)->handle,1,NULL); +#else err = aio_suspend(1, (struct aiocb **) &((*request)->handle)); +#endif } while ((err == -1) && (errno == EINTR)); tmp1 = (struct aiocb *) (*request)->handle; diff --git a/src/mca/io/romio/romio-dist/adio/ad_ufs/ad_ufs_iwrite.c b/src/mca/io/romio/romio-dist/adio/ad_ufs/ad_ufs_iwrite.c index fa677835c9..b18c2390d6 100644 --- a/src/mca/io/romio/romio-dist/adio/ad_ufs/ad_ufs_iwrite.c +++ b/src/mca/io/romio/romio-dist/adio/ad_ufs/ad_ufs_iwrite.c @@ -169,8 +169,13 @@ int ADIOI_UFS_aio(ADIO_File fd, void *buf, int len, ADIO_Offset offset, aiocbp->aio_offset = offset; aiocbp->aio_buf = buf; aiocbp->aio_nbytes = len; +#if !defined(_AIO_AIX_SOURCE) && !defined(_NO_PROTO) + if (wr) err = aio_write(aiocbp); + else err = aio_read(aiocbp); +#else if (wr) err = aio_write(fd_sys, aiocbp); else err = aio_read(fd_sys, aiocbp); +#endif if (err == -1) { if (errno == EAGAIN) { @@ -178,15 +183,25 @@ int ADIOI_UFS_aio(ADIO_File fd, void *buf, int len, ADIO_Offset offset, complete all previous async. requests and try again. */ ADIOI_Complete_async(&error_code); +#if !defined(_AIO_AIX_SOURCE) && !defined(_NO_PROTO) + if (wr) err = aio_write(aiocbp); + else err = aio_read(aiocbp); +#else if (wr) err = aio_write(fd_sys, aiocbp); else err = aio_read(fd_sys, aiocbp); +#endif while (err == -1) { if (errno == EAGAIN) { /* sleep and try again */ sleep(1); +#if !defined(_AIO_AIX_SOURCE) && !defined(_NO_PROTO) + if (wr) err = aio_write(aiocbp); + else err = aio_read(aiocbp); +#else if (wr) err = aio_write(fd_sys, aiocbp); else err = aio_read(fd_sys, aiocbp); +#endif } else { FPRINTF(stderr, "Unknown errno %d in ADIOI_UFS_aio\n", errno); diff --git a/src/mca/io/romio/romio-dist/adio/ad_ufs/ad_ufs_wait.c b/src/mca/io/romio/romio-dist/adio/ad_ufs/ad_ufs_wait.c index 537274888c..044151b039 100644 --- a/src/mca/io/romio/romio-dist/adio/ad_ufs/ad_ufs_wait.c +++ b/src/mca/io/romio/romio-dist/adio/ad_ufs/ad_ufs_wait.c @@ -69,7 +69,11 @@ void ADIOI_UFS_ReadComplete(ADIO_Request *request, ADIO_Status *status, int *err /* IBM */ if ((*request)->queued) { do { +#if !defined(_AIO_AIX_SOURCE) && !defined(_NO_PROTO) + err = aio_suspend((*request)->handle,1,NULL); +#else err = aio_suspend(1, (struct aiocb **) &((*request)->handle)); +#endif } while ((err == -1) && (errno == EINTR)); tmp1 = (struct aiocb *) (*request)->handle;