From owner-freebsd-amd64@FreeBSD.ORG Tue Mar 1 01:41:39 2005 Return-Path: Delivered-To: freebsd-amd64@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id ADEB216A4CE for ; Tue, 1 Mar 2005 01:41:39 +0000 (GMT) Received: from odin.ac.hmc.edu (Odin.AC.HMC.Edu [134.173.32.75]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4B19543D5C for ; Tue, 1 Mar 2005 01:41:34 +0000 (GMT) (envelope-from brdavis@odin.ac.hmc.edu) Received: from odin.ac.hmc.edu (localhost.localdomain [127.0.0.1]) by odin.ac.hmc.edu (8.13.0/8.13.0) with ESMTP id j211fBKG011942; Mon, 28 Feb 2005 17:41:11 -0800 Received: (from brdavis@localhost) by odin.ac.hmc.edu (8.13.0/8.13.0/Submit) id j211fBqp011941; Mon, 28 Feb 2005 17:41:11 -0800 Date: Mon, 28 Feb 2005 17:41:11 -0800 From: Brooks Davis To: "David C. Myers" Message-ID: <20050301014111.GA6907@odin.ac.hmc.edu> References: <4222A870.2090500@aedifice.net> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="C7zPtVaVf+AK4Oqc" Content-Disposition: inline In-Reply-To: <4222A870.2090500@aedifice.net> User-Agent: Mutt/1.4.1i X-Virus-Scanned: by amavisd-new X-Spam-Status: No, hits=0.0 required=8.0 tests=none autolearn=no version=2.63 X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on odin.ac.hmc.edu cc: freebsd-amd64@freebsd.org Subject: Re: VNC on amd64: SIOCGIFCONF problems X-BeenThere: freebsd-amd64@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Porting FreeBSD to the AMD64 platform List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Mar 2005 01:41:39 -0000 --C7zPtVaVf+AK4Oqc Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Feb 27, 2005 at 09:13:20PM -0800, David C. Myers wrote: >=20 >=20 > VNC-3.3.7 in ports looks like it doesn't work because of 64-bit=20 > alignment issues with SIOCGIFCONF. The offending code is in=20 > Xvnc/programs/Xserver/os/access.c: >=20 > if (ifioctl (fd, (int) SIOCGIFCONF, (pointer) &ifc) < 0) > Error ("Getting interface configuration (4)"); >=20 > which comes out in the trace file as: >=20 > 28138 Xvnc CALL bind(0x1,0x7fffffffe670,0x13) > 28138 Xvnc NAMI "/tmp/.X11-unix/X1" > 28138 Xvnc RET bind 0 > 28138 Xvnc CALL listen(0x1,0x80) > 28138 Xvnc RET listen 0 > 28138 Xvnc CALL umask(0x12) > 28138 Xvnc RET umask 0 > 28138 Xvnc CALL ioctl(0,0xffffffffc0106924 ,0x7fffffffe030) > 28138 Xvnc RET ioctl -1 errno 6 Device not configured > 28138 Xvnc CALL writev(0x2,0x7fffffffd790,0x4) > 28138 Xvnc GIO fd 2 wrote 59 bytes > "Getting interface configuration (4): Device not configured > " >=20 >=20 > (Actually, the very first error you'll get is a "Could not open default= =20 > font 'fixed'" message, but you can make that go away by running a font=20 > server and passing its address to Xvnc...) >=20 > Is there a quick solution to this? A 32-bit compatibility shim? =20 > Judging from Google, issues with this ioctl go back years, on all kinds= =20 > of platforms. getifaddrs() is the right way to do this on BSD? You need to copy the misaligned element(s) into properly aligned temporary storage or use getifaddrs instead. SIOCGIFCONF is a really crappy inteface. -- Brooks --=20 Any statement of the form "X is the one, true Y" is FALSE. PGP fingerprint 655D 519C 26A7 82E7 2529 9BF0 5D8E 8BE9 F238 1AD4 --C7zPtVaVf+AK4Oqc Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQFCI8g3XY6L6fI4GtQRAg70AJ0bjutnUGvavO9rLhs4XMKgNO8xFQCeO+5w OFqDt7hAzGAR0rtn3aJILro= =xElg -----END PGP SIGNATURE----- --C7zPtVaVf+AK4Oqc--