execl bug?

Christopher Weimann csw at k12hq.com
Wed Dec 29 17:10:55 PST 2004


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 at allantgroup.com
> 

Perfect!  It works, and it even makes sense to me :)

Thank you!

-- 


More information about the freebsd-hackers mailing list