Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 29 Dec 2004 20:10:54 -0500
From:      Christopher Weimann <csw@k12hq.com>
To:        Dan Nelson <dnelson@allantgroup.com>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: execl bug?
Message-ID:  <20041230011054.GC31984@smtp.k12us.com>
In-Reply-To: <20041230001043.GA88403@dan.emsphone.com>
References:  <20041229230521.GB31984@smtp.k12us.com> <20041230001043.GA88403@dan.emsphone.com>

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

-- 



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