From owner-freebsd-questions Thu Jan 20 4: 6:37 2000 Delivered-To: freebsd-questions@freebsd.org Received: from intranova.net (blacklisted.intranova.net [209.3.31.70]) by hub.freebsd.org (Postfix) with SMTP id 7A99E153E0 for ; Thu, 20 Jan 2000 04:06:31 -0800 (PST) (envelope-from oogali@intranova.net) Received: (qmail 4518 invoked from network); 20 Jan 2000 07:08:38 -0000 Received: from missnglnk.wants.to-fuck.com (HELO hydrant.intranova.net) (user51319@209.201.95.10) by blacklisted.intranova.net with SMTP; 20 Jan 2000 07:08:38 -0000 Date: Thu, 20 Jan 2000 07:05:17 -0500 (EST) From: Omachonu Ogali To: Suresh Kumar Satapati Cc: freebsd-questions@freebsd.org Subject: Re: C question In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Error check the call: if (write(socketfd, &rtmsg, len) < len) { perror("write()"); return -1; } Omachonu Ogali Intranova Networking Group On Wed, 19 Jan 2000, Suresh Kumar Satapati wrote: > I have a C question. > I have a routing message structure .. > static struct srtmsg {...}rtmsg; > declared as above. Now i have to write a portion of this structure to a > routing socket (PF_ROUTE) using a 'write' call. > My call looks as below: > > write(socketfd, (char*)&rtmsg, len) > > where 'len' is a valid integer. The value of 'len' is less than > sizeof(struct srtmsg). This call fails and gives a Page Fault. > > Please let me know if there is a better way to do this. > > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-questions" in the body of the message > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message