From owner-freebsd-audit Wed Jul 18 2:26:52 2001 Delivered-To: freebsd-audit@freebsd.org Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by hub.freebsd.org (Postfix) with ESMTP id AA53237B401 for ; Wed, 18 Jul 2001 02:26:48 -0700 (PDT) (envelope-from bde@zeta.org.au) Received: from bde.zeta.org.au (bde.zeta.org.au [203.2.228.102]) by mailman.zeta.org.au (8.9.3/8.8.7) with ESMTP id TAA06582; Wed, 18 Jul 2001 19:26:24 +1000 Date: Wed, 18 Jul 2001 19:24:11 +1000 (EST) From: Bruce Evans X-Sender: bde@besplex.bde.org To: Dag-Erling Smorgrav Cc: Peter Pentchev , Mike Barcroft , David Malone , audit@FreeBSD.ORG Subject: Re: inetd(8) warns patch In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On 17 Jul 2001, Dag-Erling Smorgrav wrote: > Peter Pentchev 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 #include 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