删除消息队列的进程需要什么权限
我创建了一个消息队列,然后把他的权限设为0000,但是进程还是有办法删除消息队列。请问能删除消息队列的进程究竟有什么特别的权限呢?代码如下:
#include<stdio.h>#include<sys/msg.h>//#include"common.h"int main(){ int msgid,ret; struct msqid_ds buf; msgid = msgget(111,0666 | IPC_CREAT); if(msgid >= 0) { printf("Created a message queue.\n"); ret = msgctl(msgid,IPC_STAT,&buf); if(ret == 0) printf("Mode is %o.\n",buf.msg_perm.mode); buf.msg_perm.mode = 0000; ret = msgctl(msgid,IPC_SET,&buf); if(ret == 0) printf("After changed mode is %o.\n",buf.msg_perm.mode); ret = msgctl(msgid,IPC_RMID,NULL); if(ret == 0) printf("Removed a message queue.\n"); } return 0;}