|
View:
New views
3 Messages
—
Rating Filter:
Alert me
|
|
|
query... Hi,
I am Creating a posix message queue using the following code. #include <stdio.h> #include <stdlib.h> #include <mqueue.h> #include <errno.h> #include <string.h> #include <fcntl.h> #include <sys/stat.h> #include <sys/types.h> int main(int argc,char *argv[]) { mqd_t mq_des; mq_des = mq_open(argv[1],O_CREAT | O_RDWR | O_EXCL,S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH , NULL); if(mq_des < 0) { printf("Unable To Create MsgQ\n"); perror("mq_open"); return mq_des; } printf("MsgQ is Opened With Descriptor : %d\n",mq_des); return mq_des; } and I after compiling I am giving ./a.out /root/Desktop/msgq1 But It is giving as unable to create message queue and showing error as 'permission denied' Would you please help me. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@... More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ |
|
|
Re: query...I think it could be root permissions problem. Are you running this
binary as root user ? On 8/9/05, raja <vnagaraju@...> wrote: > Hi, > I am Creating a posix message queue using the following code. > > > #include <stdio.h> > #include <stdlib.h> > #include <mqueue.h> > #include <errno.h> > #include <string.h> > #include <fcntl.h> > #include <sys/stat.h> > #include <sys/types.h> > > int main(int argc,char *argv[]) > { > mqd_t mq_des; > mq_des = mq_open(argv[1],O_CREAT | O_RDWR | O_EXCL,S_IRUSR | S_IWUSR > | S_IRGRP | S_IROTH , NULL); > if(mq_des < 0) > { > printf("Unable To Create MsgQ\n"); > perror("mq_open"); > return mq_des; > } > printf("MsgQ is Opened With Descriptor : %d\n",mq_des); > return mq_des; > } > > > and I after compiling I am giving > > ./a.out /root/Desktop/msgq1 > > > But It is giving as unable to create message queue and showing error as > 'permission denied' > > Would you please help me. > - > To unsubscribe from this list: send the line "unsubscribe linux-kernel" in > the body of a message to majordomo@... > More majordomo info at http://vger.kernel.org/majordomo-info.html > Please read the FAQ at http://www.tux.org/lkml/ > -- Thanks and Regards, Nikhil. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@... More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ |
|
|
RE: query...First -> you hit the wrong ML
Second -> The message queue exists and the permissions specified by oflag are denied, or the message queue does not exist and permission to create the message queue is denied -----Original Message----- From: linux-kernel-owner@... [mailto:linux-kernel-owner@...] On Behalf Of raja Sent: Tuesday, August 09, 2005 3:59 PM To: linux-kernel@... Subject: query... Hi, I am Creating a posix message queue using the following code. #include <stdio.h> #include <stdlib.h> #include <mqueue.h> #include <errno.h> #include <string.h> #include <fcntl.h> #include <sys/stat.h> #include <sys/types.h> int main(int argc,char *argv[]) { mqd_t mq_des; mq_des = mq_open(argv[1],O_CREAT | O_RDWR | O_EXCL,S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH , NULL); if(mq_des < 0) { printf("Unable To Create MsgQ\n"); perror("mq_open"); return mq_des; } printf("MsgQ is Opened With Descriptor : %d\n",mq_des); return mq_des; } and I after compiling I am giving ./a.out /root/Desktop/msgq1 But It is giving as unable to create message queue and showing error as 'permission denied' Would you please help me. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@... More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@... More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ |
| Free embeddable forum powered by Nabble | Forum Help |