From owner-freebsd-hackers Thu Jul 30 09:58:28 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id JAA20725 for freebsd-hackers-outgoing; Thu, 30 Jul 1998 09:58:28 -0700 (PDT) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from pau-amma.whistle.com (s205m64.whistle.com [207.76.205.64]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id JAA20687 for ; Thu, 30 Jul 1998 09:58:19 -0700 (PDT) (envelope-from dhw@whistle.com) Received: (from dhw@localhost) by pau-amma.whistle.com (8.8.8/8.8.7) id IAA16782; Thu, 30 Jul 1998 08:19:31 -0700 (PDT) (envelope-from dhw) Date: Thu, 30 Jul 1998 08:19:31 -0700 (PDT) From: David Wolfskill Message-Id: <199807301519.IAA16782@pau-amma.whistle.com> To: freebsd-hackers@FreeBSD.ORG, vadim@tversu.ru Subject: Re: negative offset In-Reply-To: <19980730100202.A9992@tversu.ru> Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG >Date: Thu, 30 Jul 1998 10:02:02 +0400 >From: Vadim Kolontsov > FreeBSD (2.2.6, at least) allows to have negative offset in file (for >example, after lseek(fd, -N, SEEK_END) in file which is smaller than N). >What it was intended for? To have a "symmetrical behaviour" for offsets >beyond the end or for some more practical reason? Do any other OSes have >such behavior (for example, Solaris doesn't). Is it POSIX? Why manpages >says nothing about it (am I miss something?) ? >From a Solaris 2.5 "man lseek": On success, lseek() returns the resulting pointer location, as measured in bytes from the beginning of the file. Note that if fildes is a remote file descriptor and offset is negative, lseek() returns the file pointer even if it is negative. Sorry; my Solaris 2.6 machine is at home (where I can't get to it just now). david -- David Wolfskill UNIX System Administrator dhw@whistle.com voice: (650) 577-7158 pager: (650) 371-4621 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message