Description of problem: Our requirement is that mlock should work for normal users. Other OS like Solaris support this. Version-Release number of selected component (if applicable): RHEL 4. How reproducible: Always Steps to Reproduce: 1. #include <unistd.h> #include <sys/shm.h> main() { int id; key_t key; char proc_id = 'C'; int size = 0x5000; int flags = 0664 | IPC_CREAT; /* read-only for others */ int mlock_status; int shmdt_status; void *addr; int shmctl_status; struct shmid_ds foo; key = ftok ("~creator/ipckey", proc_id); id = shmget (key, size, flags); addr = shmat(id, (const void *) NULL, (int) 0); /*shmctl_status = shmctl( id, SHM_LOCK, &foo);*/ if ( (mlock( (const void *)addr, (size_t) size)) != 0) printf("mlock failed!"); shmdt_status = shmdt( (const void *) addr); shmctl (id, IPC_RMID, NULL); } 2.run this program as a non root users. 3. Actual results: Expected results: Additional info:
redhat-release is not the correct component for this. Perhaps you meant 'kernel'?
hmmm, you can set user limits in the shell using the 'ulimit' command up to the hard limit which is 32 kb by default for mlock. HOwever, the administrator can up thish limit per-user vi /etc/security/limits.conf file.