From owner-freebsd-hackers Wed Jul 29 23:04:05 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id XAA07789 for freebsd-hackers-outgoing; Wed, 29 Jul 1998 23:04:05 -0700 (PDT) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from tversu.ru (mail.tversu.ru [62.76.80.2]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id XAA07732 for ; Wed, 29 Jul 1998 23:03:33 -0700 (PDT) (envelope-from vadim@gala.tversu.ru) Received: from gala.tversu.ru (vadim@gala.tversu.ru [62.76.80.10]) by tversu.ru (8.8.8/8.8.8) with ESMTP id KAA25978 for ; Thu, 30 Jul 1998 10:02:07 +0400 (MSD) Received: (from vadim@localhost) by gala.tversu.ru (8.8.8/8.8.8) id KAA10053 for freebsd-hackers@freebsd.org; Thu, 30 Jul 1998 10:02:03 +0400 (MSD) Message-ID: <19980730100202.A9992@tversu.ru> Date: Thu, 30 Jul 1998 10:02:02 +0400 From: Vadim Kolontsov To: freebsd-hackers@FreeBSD.ORG Subject: negative offset Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.93i Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Hello, 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?) ? It can broke some programs that expects EINVAL on such lseek() and just ignores it, assuming that if N is bigger than filesize, the offset will remain zero (I dislike such practice, but..). Actually, it brokes xlogmaster 1.4.1 (author promised to fix it in a next release). And what is N = filesize + 1? FreeBSD's lseek() returns -1, and now I have to analyze errno to understand if it was an error or just a simple negative offset.. Regards, V. -- Vadim Kolontsov Tver Internet Center NOC To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message