From owner-freebsd-stable Mon Jan 1 6:40:20 2001 From owner-freebsd-stable@FreeBSD.ORG Mon Jan 1 06:40:18 2001 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from shark.harmonic.co.il (jupiter.harmonic.co.il [192.116.140.62]) by hub.freebsd.org (Postfix) with ESMTP id DBEB437B400 for ; Mon, 1 Jan 2001 06:40:16 -0800 (PST) Received: from localhost (roman@localhost) by shark.harmonic.co.il (8.9.3/8.9.3) with ESMTP id QAA31530; Mon, 1 Jan 2001 16:40:09 +0200 Date: Mon, 1 Jan 2001 16:40:08 +0200 (IST) From: Roman Shterenzon To: Erich Zigler Cc: stable@FreeBSD.ORG Subject: Re: seekp() In-Reply-To: <20001226142555.A75344@superhero.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Tue, 26 Dec 2000, Erich Zigler wrote: > I'm currently working on porting a program in C++ on 4.2-STABLE. Everytime I > use a seekp() the program compiles fine, but it cores when the seekp() is > called. > > I am working on Gabber, http://gabber.sourceforge.net > > I was wondering if anyone else had similar problems with seekp() in other > programs? seekp() seems to be called correctly at least by every reference > book I can find. From /usr/src/contrib/libio/iostream.cc: ostream& ostream::seekp(streampos pos) { pos = _strbuf->pubseekpos(pos, ios::out); if (pos == streampos(EOF)) set(ios::badbit); return *this; } ostream& ostream::seekp(streamoff off, _seek_dir dir) { streampos pos = _IO_seekoff (_strbuf, off, (int) dir, _IOS_OUTPUT); if (pos == streampos(EOF)) set(ios::badbit); return *this; } Are you sure you're doing it right? --Roman Shterenzon, UNIX System Administrator and Consultant [ Xpert UNIX Systems Ltd., Herzlia, Israel. Tel: +972-9-9522361 ] To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message