Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 20 Jan 2000 07:05:17 -0500 (EST)
From:      Omachonu Ogali <oogali@intranova.net>
To:        Suresh Kumar Satapati <sks1974@cs.tamu.edu>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: C question
Message-ID:  <Pine.BSF.4.10.10001200704340.5682-100000@hydrant.intranova.net>
In-Reply-To: <Pine.SOL.4.10.10001190920530.29574-100000@dilbert>

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.10.10001200704340.5682-100000>