From Bugzilla Helper: User-Agent: Mozilla/4.72 [en] (X11; U; Linux 2.2.14-5.0 i686) shm_open does not work w/ glibc 2.2 and Linux 2.4.2 (presumably any 2.4.x series). The problem is in glibc-2.2.2/sysdeps/unix/sysv/linux/linux_fsinfo.h, which defines SHMEM_SUPER_MAGIC to be 0x02011994. linux-2.4.2/fs/shmem.c defines SHMEM_MAGIC to be 0x01021994. Thus the fix is pretty simple. I guess this isn't really a RH7.0 problem since it doesn't ship with the 2.4.x kernels, but it is a glibc problem for the current batch of kernels. Thus I'm filing it under "enhancement" since this perhaps is just a fix applicable for the next release of RedHat. Reproducible: Always Steps to Reproduce: Write a simple program: cat << EOF > foo.c #include <sys/mman.h> #include <sys/stat.h> #include <sys/types.h> #include <fcntl.h> #include <stdlib.h> #include <stdio.h> int main(int argc, char * const * argv) { int fd; fd = shm_open("/blargh", O_RDWR|O_CREAT, 0644); if (fd < 0) { printf("ERRORERROR!\n"); abort(); } else { printf("YAY!\n"); return 0; } } EOF cc -D_GNU_SOURCE foo.c -lrt -o foo ./foo Actual Results: Prints the error message and dumps core. Expected Results: Should have printed yay and returned with 0 exit status. Also a good idea to add a "none /dev/shm shm defaults 0 0" entry to /etc/fstab upon installation of a 2.4.x kernel, and mkdir /dev/shm.
Created attachment 13883 [details] Fixes the problem hopefully.
Guess what is in glibc-2.2.2-4 and above. As for why is the shm line missing in /etc/fstab, I'll check out.