From owner-freebsd-hackers Fri Jun 16 10:39:39 1995 Return-Path: hackers-owner Received: (from majordom@localhost) by freefall.cdrom.com (8.6.10/8.6.6) id KAA00262 for hackers-outgoing; Fri, 16 Jun 1995 10:39:39 -0700 Received: from cs.weber.edu (cs.weber.edu [137.190.16.16]) by freefall.cdrom.com (8.6.10/8.6.6) with SMTP id KAA00253 for ; Fri, 16 Jun 1995 10:39:37 -0700 Received: by cs.weber.edu (4.1/SMI-4.1.1) id AA12315; Fri, 16 Jun 95 11:32:23 MDT From: terry@cs.weber.edu (Terry Lambert) Message-Id: <9506161732.AA12315@cs.weber.edu> Subject: Re: penalty of using off_t for arithmatic with gcc's long To: ache@astral.msk.su (=?KOI8-R?Q?=E1=CE=C4=D2=C5=CA_=FE=C5=D2=CE=CF=D7?= aka) Date: Fri, 16 Jun 95 11:32:22 MDT Cc: hackers@FreeBSD.org, peter@haywire.DIALix.COM In-Reply-To: from "=?KOI8-R?Q?=E1=CE=C4=D2=C5=CA_=FE=C5=D2=CE=CF=D7?= aka" at Jun 16, 95 03:47:42 pm X-Mailer: ELM [version 2.4dev PL52] Sender: hackers-owner@FreeBSD.org Precedence: bulk > 1) fseek argument: it is "long" per POSIX standard. You can't > read > 2GB in POSIX enviroment in any case with 4bytes longs > using fseek. This is not true. The off_t typedef "must be an atomic type" per POSIX. Now because of calling convention, on a machine with 32 bit ints and 64 bit longs (instead of "long long", which is not an atomic type), you will continue to have stack passing problems because of the calling conventions when using an unprototyped lseek/fseek. The only real soloution is the preamble the calling conventions (like VMS or OSF/1 does). This is a terifically *ugly* fix, and must be done in the compiler. > If you include , you don't need to cast lseek() argument to off_t. Because the prototype hides the bogosity from you ...a bad thing if you move the code between non-POSIX/non-ANSI 100% compliant systems -- like BSD. BSD just doesn't have this particular non-compliance bogosity, which doesn't guarantee that it doesn't have others. Terry Lambert terry@cs.weber.edu --- Any opinions in this posting are my own and not those of my present or previous employers.