IRIX does not use a BSD or GNU-style libc, so this page aims to document differences, limitations, considerations and more when developing an application or porting to IRIX.
IRIX 6.5.22 and up are mostly C99/C++98 compliant, and can handle most properly formatted C and C++ code written to these specifications. Later versions of C and C++ may not have proper library support baked in.
IRIX's mmap() is notable because it lacks the flag MAP_ANON. The flag 0x1000 uses MAP_SGI_ANYADDR and that does NOT create an anonymous mapping.
The following example from sudo's code is an example of how to get around it:
static void *
mmap_anon(void *addr, size_t len, int prot, int flags, off_t offset)
return mmap(addr, len, prot, flags | MAP_ANON, -1, offset);
if ((fd = open("/dev/zero", O_RDWR)) == -1)
addr = mmap(addr, len, prot, flags, fd, offset);
The entire commit for this is located here: https://github.com/sudo-project/sudo/commit/9d69c4a0220cd8ea27d407c3525f32bfdadff6a9