Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 1 Jan 2001 16:40:08 +0200 (IST)
From:      Roman Shterenzon <roman@harmonic.co.il>
To:        Erich Zigler <erichz@superhero.org>
Cc:        stable@FreeBSD.ORG
Subject:   Re: seekp()
Message-ID:  <Pine.LNX.4.10.10101011639070.24799-100000@shark.harmonic.co.il>
In-Reply-To: <20001226142555.A75344@superhero.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.LNX.4.10.10101011639070.24799-100000>