Date: Wed, 18 Jul 2001 19:24:11 +1000 (EST) From: Bruce Evans <bde@zeta.org.au> To: Dag-Erling Smorgrav <des@ofug.org> Cc: Peter Pentchev <roam@orbitel.bg>, Mike Barcroft <mike@q9media.com>, David Malone <dwmalone@maths.tcd.ie>, audit@FreeBSD.ORG Subject: Re: inetd(8) warns patch Message-ID: <Pine.BSF.4.21.0107181917150.94866-100000@besplex.bde.org> In-Reply-To: <xzpr8vf1gve.fsf@flood.ping.uio.no>
next in thread | previous in thread | raw e-mail | index | archive | help
On 17 Jul 2001, Dag-Erling Smorgrav wrote:
> Peter Pentchev <roam@orbitel.bg> writes:
> > Basically, the problem is that although writev(2) doesn't need to write
> > to the buffer pointed to in its iov parameter, readv(2) does.
>
> You can work around this by casting the LHS to (const char *):
>
> (const char *)iov[n].iov_base = str;
> iov[n].iov_len = len;
Only if you are not writing in C. E.g., this is just a syntax error
according to TenDRA:
Script started on Wed Jul 18 19:17:01 2001
ttyv2:bde@besplex:/tmp> cat z.c
#include <sys/types.h>
#include <sys/uio.h>
struct iovec iov[1];
char *str;
size_t len;
const int n = 1;
void
test(void)
{
(const char *)iov[n].iov_base = str;
iov[n].iov_len = len;
}
ttyv2:bde@besplex:/tmp> tcc -Ysystem -c z.c
"z.c", line 12: Error:
[Syntax]: Parse error before '='.
[Syntax]: Can't recover from this error.
ttyv2:bde@besplex:/tmp> exit
Script done on Wed Jul 18 19:17:09 2001
Bruce
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-audit" 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.0107181917150.94866-100000>
