From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1696 invoked by alias); 10 Feb 2006 18:05:01 -0000 Received: (qmail 1687 invoked by uid 22791); 10 Feb 2006 18:05:00 -0000 X-Spam-Check-By: sourceware.org Received: from ns.suse.de (HELO mx1.suse.de) (195.135.220.2) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 10 Feb 2006 18:04:58 +0000 Received: from Relay2.suse.de (mail2.suse.de [195.135.221.8]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.suse.de (Postfix) with ESMTP id BC06BEE9E; Fri, 10 Feb 2006 19:04:55 +0100 (CET) From: Andreas Schwab To: David Lecomber Cc: gdb Subject: Re: Whacky ia64: linux_proc_xfer_partial and lseek vs pread64 References: <1139591736.3780.26.camel@cpc2-oxfd8-0-0-cust771.oxfd.cable.ntl.com> X-Yow: Leona, I want to CONFESS things to you.. I want to WRAP you in a SCARLET ROBE trimmed with POLYVINYL CHLORIDE.. I want to EMPTY your ASHTRAYS... Date: Fri, 10 Feb 2006 18:05:00 -0000 In-Reply-To: <1139591736.3780.26.camel@cpc2-oxfd8-0-0-cust771.oxfd.cable.ntl.com> (David Lecomber's message of "Fri, 10 Feb 2006 17:15:36 +0000") Message-ID: User-Agent: Gnus/5.110003 (No Gnus v0.3) Emacs/22.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2006-02/txt/msg00086.txt.bz2 David Lecomber writes: > Dear Dan and all, > > It's great that these days we use file access to get at the memory via > the /proc filesystem - but there's an interesting sighting on the ia64 > (suse 9) in linux_proc_xfer_partial. > > #ifdef HAVE_PREAD64 > if (pread64 (fd, readbuf, len, offset) != len) > #else > if (lseek (fd, offset, SEEK_SET) == -1 || read (fd, readbuf, len) != > len) > #endif > ret = 0; > else > ret = len; > > > So, Mr Itanium has pread64, it calls pread64.. it seems to fail > regularly.. As the strace log shows. pread and lseek with SEEK_SET do not allow negative offsets. lseek on /proc/$$/mem is a special exception. Andreas. -- Andreas Schwab, SuSE Labs, schwab@suse.de SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."