Hmmmm. EFAULT is a really strange error code for it to give you.
Your name looks correct, as man mq_overview demands it, to wit, "a null-terminated string of up to NAME_MAX (i.e., 255) characters consisting of an initial slash, followed by one or more characters, none of which are slashes."
Your permissions and flags also look sane.
What's left? buf. Try opening with NULL instead of &buf.
mq_attr has at least four members:
...but you don't set mq_flags could contain garbage. mq_curmsgs probably doesn't care what's in it but to be sure I'd just blank the whole thing with memset(&buf, 0, sizeof(buf)); then set the things I want.
Well, it looks like you are following an example, so perhaps there is a permission or name collision problem with PATH. Try flags 0 if it exists. Chapter 6. Message Queues
Hi All,
Thanks for your time and valuable suggestions. For the last few days i was out of station. So could not reply to your post. Sorry for the delay in my response.
@Corona688 : I tried using NULL and also with tried clearing buf with memset. But it is giving the same old error.
Is there any other hidden problems? It is a critical part of my project. Please help me out.
Regards,
Parvathy
It doesn't give you the sizes you want but it does go... Try it in a .c file by itself like above. I'm beginning to suspect the problem isn't related to message queues but an error somewhere else in the larger part of your code (the part we of course haven't seen).
Hi,
@Corona688: Yes you are ryt. when i tried in a seperate it is working perfectly fine. So now how can i debug it. it is code base of more than 500 classes. So can you please suggest some insights for me to start with.
On reflection, I think EFAULT implies you have memory corruption somewhere that's causing things to get fed invalid pointers. Check every pointer and reference (including class pointers and references) in the call chain leading up to mqopen2 to make sure they're all sane.
I'm learning SED command. And while doing that i got to this place where i'm taking a copy of my existing file. The code i used is -
sed -n '/Storm/ w Storm.txt' books.txt
As expected, the file 'books.txt' is read , and lines with 'Storm' is put in to the new file 'Storm.txt'. However, it also... (4 Replies)
Hi ,
One of my zone went down and when i booted it up i could see the pool in degraded state with some check sum errors . we have brought the pool online after scrubbing. But few files are showing this error
Bad exchange descriptor
Please let me know how to remove these files (2 Replies)
Hi All
I have a dedicated backup server running ubuntu 10.04, which has recently been rebuilt (same OS, just different h/w)
This is used to receive ufsdump output from a number of Solaris servers, using the following syntax:
ufsdump 1uf :/path/to/backup/file /fs/to/be/backed/up
This has... (1 Reply)
I need to write a script that can find a bad record (for example: there is date field colom but value provided in the file for this field is N/A) then script shoud searches this pattern and then insert the whole record into the bad file.
Example:
File1
Name designation dateOfJoining... (2 Replies)
I need to write a script that can find a bad record (for example: there is date field colom but value provided in the file for this field is N/A) then script shoud searches this pattern and then insert the whole record into the bad file.
Example:
File1
Name designation dateOfJoining... (1 Reply)
Hi,
Is there any system call which changes the time of symbolic link apart from utime? or if tere is no system call any other option of how to do it?
Thanks (4 Replies)
Ok, I'm sure this is a total newbie question, but I think I'm in the right place, no?
I'm trying to call a perl module from a cgi script - Mail::Sendmail - and my web host installed the module in a directory that doesn't seem to be accessible, at least not the way I'm trying. But I thought you... (1 Reply)