The current Linux implementation of shmat() insists on SHMLBA alignment even when shmflg & SHM_RND == 0. This is not consistent with the man pages and the single UNIX spec, which require only a page-aligned address. man page: > If shmaddr isn’t NULL and SHM_RND is asserted in shmflg, the attach > occurs at the address equal to shmaddr rounded down to the nearest mul- > tiple of SHMLBA. Otherwise shmaddr must be a page-aligned address at > which the attach occurs. This is not a problem for many platforms because SHMLBA == PAGE_SIZE. It's also not a problem for 64 bit programs running on 64 bit platforms, because arch_get_unmapped_area() typically guarantees SHMLBA alignment, even when SHM_RND is not asserted. However, for 32 bit compatiblity programs, an innocuous sequence such as: p = shmat(id, 0, shmflg) /* shmflag & SHM_RND == 0 */ /* p is page-aligned, but may not be SHMLBA aligned */ shmdt(p) shmat(id, p, shmflg) == -EINVAL ?? can fail. The attached patch fixes the problem for ia64. Can other arch maintainers confirm that it doesn't break anything for you ? -Arun