Date: Thu, 18 Jan 2001 13:32:37 -0800 (PST) From: =?ISO-8859-1?Q?Mikko_Ty=F6l=E4j=E4rvi?= <mikko@dynas.se> To: Michal Zapasnik <bigstar@astercity.net> Cc: freebsd-questions@freebsd.org Subject: Re: System functions in BSD and others *nix systems. Message-ID: <Pine.BSF.4.21.0101181326190.40739-100000@explorer.rsa.com> In-Reply-To: <Pine.BSF.4.21.0101182219430.1262-100000@BS.home.astercity.net>
next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, 18 Jan 2001, Michal Zapasnik wrote: > On Thu, 18 Jan 2001, Mikko Tyolajarvi wrote: > [...] > > You don't check the return values of any of the msg* function calls, > > which may have failed for various reasons. If you do that, you may be > > able to find out what is going wrong. > > > I do as you say , > [...] > if (msgrcv(q, &msg, sizeof(msg), 0, 0) == -1) > { > perror("msgrcv"); > exit(0); > } > > And i have > msgrcv: Invalid argument > > I check in manual that is the flag [EINVAL] > 'msqid is not a valid message queue identifier.' > > But if why it work on other OS and on FBSD not?, and what is vaild > in my queue identifer. Which obviously then caused you to check the return value of msgget(), right? :-) Do it. The problem could be any one of the stupid limits associated with System V IPCs (a really tragic piece of engineering...), or, more likelty as you are using ftok(), the path to the file in ftok() is wrong. Or maybe you are running with a kernel without SysV IPCs. Just for the hell of it, I compiled your code and ran it. Works as expected (bunch of fives). This is on FreeBSD 4.2. But I did change the pathname used with ftok() first... /Mikko Mikko Työläjärvi_______________________________________mikko@rsasecurity.com RSA Security To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.21.0101181326190.40739-100000>