From owner-freebsd-bugs Thu Nov 6 18:00:04 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id SAA29881 for bugs-outgoing; Thu, 6 Nov 1997 18:00:04 -0800 (PST) (envelope-from owner-freebsd-bugs) Received: (from gnats@localhost) by hub.freebsd.org (8.8.7/8.8.7) id SAA29857; Thu, 6 Nov 1997 18:00:02 -0800 (PST) (envelope-from gnats) Date: Thu, 6 Nov 1997 18:00:02 -0800 (PST) Message-Id: <199711070200.SAA29857@hub.freebsd.org> To: freebsd-bugs Cc: From: Bill Fenner Subject: Re: bin/4961: Problems with fseek and fprints Reply-To: Bill Fenner Sender: owner-freebsd-bugs@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk The following reply was made to PR bin/4961; it has been noted by GNATS. From: Bill Fenner To: tege@pdc.kth.se Cc: FreeBSD-gnats-submit@freebsd.org Subject: Re: bin/4961: Problems with fseek and fprints Date: Thu, 6 Nov 1997 17:55:52 PST tege@pdc.kth.se wrote: >1) fseek is ignored on files that were fdopen'ed in append mode. This is not a bug. ANSI C says that writes are only allowed at the end of file when opening in append mode (e.g. any write has an implicit seek to end preceding it). Open with "r+" if you want to write somewhere other than the end of file. >2) The second fprintf below sets errno even while no error really > happens. errno is not set on a 2.2.2-RELEASE system; on a 3.0-CURRENT system, errno is indeed set to ENOENT. Interestingly enough, it's the first fprintf that's setting errno. This is definitely worth looking into; I have no clue what fprintf might be doing that would cause a ENOENT. Bill