From owner-freebsd-hackers@FreeBSD.ORG Thu Dec 30 01:10:55 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 922E816A4CE for ; Thu, 30 Dec 2004 01:10:55 +0000 (GMT) Received: from smtp.k12us.com (smtp.k12us.com [65.112.222.15]) by mx1.FreeBSD.org (Postfix) with SMTP id 08C1E43D45 for ; Thu, 30 Dec 2004 01:10:55 +0000 (GMT) (envelope-from csw@k12hq.com) Received: (qmail 96082 invoked by uid 1001); 30 Dec 2004 01:10:54 -0000 Date: Wed, 29 Dec 2004 20:10:54 -0500 From: Christopher Weimann To: Dan Nelson Message-ID: <20041230011054.GC31984@smtp.k12us.com> References: <20041229230521.GB31984@smtp.k12us.com> <20041230001043.GA88403@dan.emsphone.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20041230001043.GA88403@dan.emsphone.com> User-Agent: Mutt/1.5.4i cc: freebsd-hackers@freebsd.org Subject: Re: execl bug? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Dec 2004 01:10:55 -0000 On 12/29/2004-06:10PM, Dan Nelson wrote: > > I think your problem here is with rewind(). There's nothing that says > it has to change the underlying filedescriptor; FreeBSD's fseek code > knows that the beginning of the file is still within its stdio buffer, > so it simply resets the seek offset in the FILE* back to zero. See the > code in /usr/src/lib/libc/stdio/fseek.c . Replacing your rewind() with > an lseek(0,0,SEEK_SET) makes the program work. > > -- > Dan Nelson > dnelson@allantgroup.com > Perfect! It works, and it even makes sense to me :) Thank you! --