head 1.5; access; symbols pkgsrc-2019Q4:1.4.0.138 pkgsrc-2019Q4-base:1.4 pkgsrc-2019Q3:1.4.0.134 pkgsrc-2019Q3-base:1.4 pkgsrc-2019Q2:1.4.0.132 pkgsrc-2019Q2-base:1.4 pkgsrc-2019Q1:1.4.0.130 pkgsrc-2019Q1-base:1.4 pkgsrc-2018Q4:1.4.0.128 pkgsrc-2018Q4-base:1.4 pkgsrc-2018Q3:1.4.0.126 pkgsrc-2018Q3-base:1.4 pkgsrc-2018Q2:1.4.0.124 pkgsrc-2018Q2-base:1.4 pkgsrc-2018Q1:1.4.0.122 pkgsrc-2018Q1-base:1.4 pkgsrc-2017Q4:1.4.0.120 pkgsrc-2017Q4-base:1.4 pkgsrc-2017Q3:1.4.0.118 pkgsrc-2017Q3-base:1.4 pkgsrc-2017Q2:1.4.0.114 pkgsrc-2017Q2-base:1.4 pkgsrc-2017Q1:1.4.0.112 pkgsrc-2017Q1-base:1.4 pkgsrc-2016Q4:1.4.0.110 pkgsrc-2016Q4-base:1.4 pkgsrc-2016Q3:1.4.0.108 pkgsrc-2016Q3-base:1.4 pkgsrc-2016Q2:1.4.0.106 pkgsrc-2016Q2-base:1.4 pkgsrc-2016Q1:1.4.0.104 pkgsrc-2016Q1-base:1.4 pkgsrc-2015Q4:1.4.0.102 pkgsrc-2015Q4-base:1.4 pkgsrc-2015Q3:1.4.0.100 pkgsrc-2015Q3-base:1.4 pkgsrc-2015Q2:1.4.0.98 pkgsrc-2015Q2-base:1.4 pkgsrc-2015Q1:1.4.0.96 pkgsrc-2015Q1-base:1.4 pkgsrc-2014Q4:1.4.0.94 pkgsrc-2014Q4-base:1.4 pkgsrc-2014Q3:1.4.0.92 pkgsrc-2014Q3-base:1.4 pkgsrc-2014Q2:1.4.0.90 pkgsrc-2014Q2-base:1.4 pkgsrc-2014Q1:1.4.0.88 pkgsrc-2014Q1-base:1.4 pkgsrc-2013Q4:1.4.0.86 pkgsrc-2013Q4-base:1.4 pkgsrc-2013Q3:1.4.0.84 pkgsrc-2013Q3-base:1.4 pkgsrc-2013Q2:1.4.0.82 pkgsrc-2013Q2-base:1.4 pkgsrc-2013Q1:1.4.0.80 pkgsrc-2013Q1-base:1.4 pkgsrc-2012Q4:1.4.0.78 pkgsrc-2012Q4-base:1.4 pkgsrc-2012Q3:1.4.0.76 pkgsrc-2012Q3-base:1.4 pkgsrc-2012Q2:1.4.0.74 pkgsrc-2012Q2-base:1.4 pkgsrc-2012Q1:1.4.0.72 pkgsrc-2012Q1-base:1.4 pkgsrc-2011Q4:1.4.0.70 pkgsrc-2011Q4-base:1.4 pkgsrc-2011Q3:1.4.0.68 pkgsrc-2011Q3-base:1.4 pkgsrc-2011Q2:1.4.0.66 pkgsrc-2011Q2-base:1.4 pkgsrc-2011Q1:1.4.0.64 pkgsrc-2011Q1-base:1.4 pkgsrc-2010Q4:1.4.0.62 pkgsrc-2010Q4-base:1.4 pkgsrc-2010Q3:1.4.0.60 pkgsrc-2010Q3-base:1.4 pkgsrc-2010Q2:1.4.0.58 pkgsrc-2010Q2-base:1.4 pkgsrc-2010Q1:1.4.0.56 pkgsrc-2010Q1-base:1.4 pkgsrc-2009Q4:1.4.0.54 pkgsrc-2009Q4-base:1.4 pkgsrc-2009Q3:1.4.0.52 pkgsrc-2009Q3-base:1.4 pkgsrc-2009Q2:1.4.0.50 pkgsrc-2009Q2-base:1.4 pkgsrc-2009Q1:1.4.0.48 pkgsrc-2009Q1-base:1.4 pkgsrc-2008Q4:1.4.0.46 pkgsrc-2008Q4-base:1.4 pkgsrc-2008Q3:1.4.0.44 pkgsrc-2008Q3-base:1.4 cube-native-xorg:1.4.0.42 cube-native-xorg-base:1.4 pkgsrc-2008Q2:1.4.0.40 pkgsrc-2008Q2-base:1.4 cwrapper:1.4.0.38 pkgsrc-2008Q1:1.4.0.36 pkgsrc-2008Q1-base:1.4 pkgsrc-2007Q4:1.4.0.34 pkgsrc-2007Q4-base:1.4 pkgsrc-2007Q3:1.4.0.32 pkgsrc-2007Q3-base:1.4 pkgsrc-2007Q2:1.4.0.30 pkgsrc-2007Q2-base:1.4 pkgsrc-2007Q1:1.4.0.28 pkgsrc-2007Q1-base:1.4 pkgsrc-2006Q4:1.4.0.26 pkgsrc-2006Q4-base:1.4 pkgsrc-2006Q3:1.4.0.24 pkgsrc-2006Q3-base:1.4 pkgsrc-2006Q2:1.4.0.22 pkgsrc-2006Q2-base:1.4 pkgsrc-2006Q1:1.4.0.20 pkgsrc-2006Q1-base:1.4 pkgsrc-2005Q4:1.4.0.18 pkgsrc-2005Q4-base:1.4 pkgsrc-2005Q3:1.4.0.16 pkgsrc-2005Q3-base:1.4 pkgsrc-2005Q2:1.4.0.14 pkgsrc-2005Q2-base:1.4 pkgsrc-2005Q1:1.4.0.12 pkgsrc-2005Q1-base:1.4 pkgsrc-2004Q4:1.4.0.10 pkgsrc-2004Q4-base:1.4 pkgsrc-2004Q3:1.4.0.8 pkgsrc-2004Q3-base:1.4 pkgsrc-2004Q2:1.4.0.6 pkgsrc-2004Q2-base:1.4 pkgsrc-2004Q1:1.4.0.4 pkgsrc-2004Q1-base:1.4 pkgsrc-2003Q4:1.4.0.2 pkgsrc-2003Q4-base:1.4 netbsd-1-6-1:1.3.0.2 netbsd-1-6-1-base:1.3 netbsd-1-6:1.2.0.8 netbsd-1-6-RELEASE-base:1.2 pkgviews:1.2.0.4 pkgviews-base:1.2 buildlink2:1.2.0.2 buildlink2-base:1.2 netbsd-1-5-PATCH003:1.1; locks; strict; comment @# @; 1.5 date 2020.03.12.18.52.58; author wiz; state dead; branches; next 1.4; commitid 8a7VwTfybmAFY80C; 1.4 date 2003.08.29.06.48.08; author martti; state Exp; branches; next 1.3; 1.3 date 2003.01.19.13.48.19; author wiz; state Exp; branches; next 1.2; 1.2 date 2002.04.25.12.17.05; author agc; state Exp; branches; next 1.1; 1.1 date 2002.03.22.11.26.05; author agc; state Exp; branches; next ; desc @@ 1.5 log @ORBit: remove Long replaced by ORBit2 @ text @$NetBSD: patch-an,v 1.4 2003/08/29 06:48:08 martti Exp $ --- src/IIOP/giop-msg-buffer.c.orig 2002-03-11 14:40:02.000000000 +0200 +++ src/IIOP/giop-msg-buffer.c 2003-08-29 08:48:27.000000000 +0300 @@@@ -210,7 +210,11 @@@@ res = writev (fd, curvec, MIN (nvecs, MAX_LIMITED_IOVECS)); /* fprintf (stderr, "wrote %ld bytes [%d]\n", res, (int) errno); */ #else +#ifndef __NetBSD__ res = writev (fd, curvec, nvecs); +#else + res = writev (fd, curvec, MIN(nvecs, IOV_MAX)); +#endif #endif } while (res < 0 && errno == EINTR); @ 1.4 log @Use the IOV_MAX fix only in NetBSD @ text @d1 1 a1 1 $NetBSD: patch-an,v 1.3 2003/01/19 13:48:19 wiz Exp $ @ 1.3 log @Replace wrap_writev with a simpler solution (old one had some problems). Fixes endless loop problems. Report and suggestion by Greg Troxel gdt at ir bbn com in private mail; some comments by Alistair Crooks; patch reviewed and okayed by Jaromir Dolecek. Bump PKGREVISION to 3. @ text @d1 1 a1 1 $NetBSD$ d3 3 a5 3 --- src/IIOP/giop-msg-buffer.c.orig Mon Mar 11 13:40:02 2002 +++ src/IIOP/giop-msg-buffer.c @@@@ -210,7 +210,7 @@@@ giop_send_buffer_write(GIOPSendBuffer *s d9 3 a11 1 - res = writev (fd, curvec, nvecs); d13 1 @ 1.2 log @Upgrade to version 0.5.15 from 0.5.13nb1 of the ORBit package - diffs provided by Thomas Klausner. Diffs from previous version: 2002-03-20 Michael Meeks * configure.in: copy the autoconf macro into here so we can rely on it not changing across autoconf versions. 2002-03-11 Michael Meeks * src/IIOP/giop-msg-buffer.c kill #define writev mess. (giop_send_buffer_write): handle EINTR, handle EAGAIN correctly, handle short writev's correctly, test thorougly. * src/ORBitutil/compat.c (g_writev): kill this abomination. 2002-02-11 Sebastian Wilhelmi * src/orb/allocators.h, src/orb/allocators.c (ORBit_alloc_2, ORBit_free): Make the free marker really always sit directly in front of the memory block, not at some random lower position. 2002-02-09 Elliot Lee * src/ORBitutil/os-feature-alloca.h: Don't redefine alloca if it is already defined. 2002-01-27 Darin Adler * test/everything/Makefile.am: Added -lm -- can't build without it. 2002-01-25 Mark McLoughlin * configure.in: (AC_CHECK_ALIGNOF): error out if an alignment is found to be zero. Thomas thought that the modification to src/IIOP/giop-msg-buffer.c to "kill #define writev mess" might mean that we could drop the NetBSD-specific wrapper for writev(2), but sadly this isn't so - configure undefines HAVE_LIMITED_WRITEV on NetBSD, and rightly so, since IOV_MAX (1024) iovecs can be written, not 50. However, we still have the basic "attempt to send more than IOV_MAX iovecs and you get EINVAL" problem with our writev(2) implementation. @ text @a1 1 Also handle EINVAL error to writev(2). d5 8 a12 3 @@@@ -165,6 +165,37 @@@@ return msgbuf; } a13 34 +#ifdef __NetBSD__ +/* NetBSD returns EINVAL if we try to send > IOV_MAX iovecs */ +/* wrap writev so that we only ever try to send IOV_MAX at most */ + +#include + +static int +wrap_writev(int fd, const struct iovec *vector, size_t count) +{ + size_t n; + int ret; + int wc; + + ret = 0; + while (count > 0) { + n = MIN(IOV_MAX, count); + if ((wc = writev(fd, vector, n)) < 0) { + break; + } + ret += wc; + vector += n; + count -= n; + } + return ret; +} + +#define writev wrap_writev + +#endif /* __NetBSD__ */ + + gint giop_send_buffer_write(GIOPSendBuffer *send_buffer) { @ 1.1 log @The ORBit code doesn't check the number of iovec structs before it calls writev(2). Some of the applications which use ORBit, such as oaf, can send 1214 iovecs, which is slightly more than IOV_MAX. Add a wrapper for writev(2), to check the number of iovecs passed to writev, and loop, sending MIN(IOV_MAX, count) until the iovecs have all been written. @ text @d2 1 d4 3 a6 5 Also handle EINVAL error to writev(2) --- src/IIOP/giop-msg-buffer.c 2002/03/22 10:43:32 1.1 +++ src/IIOP/giop-msg-buffer.c 2002/03/22 10:44:27 @@@@ -169,6 +169,37 @@@@ @