--- opal/mca/pmix/pmix112/pmix/src/sm/pmix_mmap.c~ 2017-03-07 10:50:55.000000000 -0800 +++ opal/mca/pmix/pmix112/pmix/src/sm/pmix_mmap.c 2017-03-07 11:15:47.000000000 -0800 @@ -62,15 +62,31 @@ } /* size backing file - note the use of real_size here */ #ifdef HAVE_POSIX_FALLOCATE - if (0 != posix_fallocate(sm_seg->seg_id, 0, size)) { + if (0 != (rc = posix_fallocate(sm_seg->seg_id, 0, size))) { pmix_output_verbose(2, pmix_globals.debug_output, "sys call posix_fallocate(2) fail\n"); - if (ENOSPC == errno) { + if ((ENOTSUP == rc) +#ifdef EOPNOTSUPP + || (EOPNOTSUPP == rc) +#endif + ) { + /* Not supported by OS and/or filesystem. + * Must fall-back to ftruncate(). + */ + if (0 != ftruncate(sm_seg->seg_id, size)) { + pmix_output_verbose(2, pmix_globals.debug_output, + "sys call ftruncate(2) fail\n"); + rc = PMIX_ERROR; + goto out; + } + rc = PMIX_SUCCESS; + } else if (ENOSPC == rc) { rc = PMIX_ERR_OUT_OF_RESOURCE; + goto out; } else { rc = PMIX_ERROR; + goto out; } - goto out; } #else if (0 != ftruncate(sm_seg->seg_id, size)) { Signed-off-by: Paul H. Hargrove