Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 30 Jul 1998 08:19:31 -0700 (PDT)
From:      David Wolfskill <dhw@whistle.com>
To:        freebsd-hackers@FreeBSD.ORG, vadim@tversu.ru
Subject:   Re: negative offset
Message-ID:  <199807301519.IAA16782@pau-amma.whistle.com>
In-Reply-To: <19980730100202.A9992@tversu.ru>

next in thread | previous in thread | raw e-mail | index | archive | help
>Date: Thu, 30 Jul 1998 10:02:02 +0400
>From: Vadim Kolontsov <vadim@tversu.ru>

>  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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199807301519.IAA16782>