From owner-freebsd-hackers Wed Aug 1 23:44:57 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from snipe.mail.pas.earthlink.net (snipe.mail.pas.earthlink.net [207.217.120.62]) by hub.freebsd.org (Postfix) with ESMTP id B4B8337B41C for ; Wed, 1 Aug 2001 23:44:48 -0700 (PDT) (envelope-from tlambert2@mindspring.com) Received: from mindspring.com (dialup-209.245.131.20.Dial1.SanJose1.Level3.net [209.245.131.20]) by snipe.mail.pas.earthlink.net (EL-8_9_3_3/8.9.3) with ESMTP id XAA21569; Wed, 1 Aug 2001 23:44:45 -0700 (PDT) Message-ID: <3B68F705.9815A930@mindspring.com> Date: Wed, 01 Aug 2001 23:45:25 -0700 From: Terry Lambert Reply-To: tlambert2@mindspring.com X-Mailer: Mozilla 4.7 [en]C-CCK-MCD {Sony} (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: Chirag Kantharia Cc: freebsd-hackers@freebsd.org Subject: Re: Finding filesizes in C++ for files greater than 4gb References: <00b201c11af3$4fef1c10$0a2d2d0a@battleship> <3B68F264.BC1FEE21@mindspring.com> <20010802115844.A29064@epigonaudio.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Chirag Kantharia wrote: > > On Wed, Aug 01, 2001 at 11:25:40PM -0700, Terry Lambert wrote: > | Uh, st_size is an off_t, which is a signed 64 bit value, > | not an unsigned 32 bit vale... > > why should it be `signed' 64 bit and not unsigned? Return value for lseek is off_t. -1 indicates error, therefore the sign bit is reserved. This is a historical UNIX-ism, having to do with functions not taking the addresses of their return values as parameters, so that the actual return value could be a pure success/failure code (e.g. like VMS, where you will get SYS$SUCCESS on success, and the actual error code on an error -- this also does away with the need for an errno, which has historically been a huge pain, particularly in threaded programs). -- Terry To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message