The portable for for SHM shared memory is: shm_open, ftruncate, mmap. In APR, apr_file_truncate is used for ftruncate, but it introduces an lseek() that fails on at least AIX. AIX lseek manual: If the FileDescriptor parameter refers to a shared memory object, the lseek subroutine fails with EINVAL. ... EINVAL The resulting offset would be greater than the maximum offset allowed for the file or device associated with FileDescriptor. The lseek subroutine was used with a file descriptor obtained from a call to the shm_open subroutine. For now, the decision to prefer APR_USE_SHMEM_MMAP_SHM is overridden in configure.in, but ideally it would work on AIX and somehow forego or ignore the lseek error.
It looks unnecessary to use an apr_file_t wrapper there at all, how about: https://github.com/apache/apr/pull/38 ?
(In reply to Joe Orton from comment #1) > It looks unnecessary to use an apr_file_t wrapper there at all, how about: > https://github.com/apache/apr/pull/38 looks simpler and maybe saves another unknown platform. Works for me w/ the configure.in override removed.