docs/52612: [PATCH] close() can return undocumented ENOSPC
Marc Olzheim
marcolz at ilse.nl
Fri May 23 14:10:05 UTC 2003
>Number: 52612
>Category: docs
>Synopsis: [PATCH] close() can return undocumented ENOSPC
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: freebsd-doc
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: doc-bug
>Submitter-Id: current-users
>Arrival-Date: Fri May 23 07:10:02 PDT 2003
>Closed-Date:
>Last-Modified:
>Originator: Marc Olzheim
>Release: FreeBSD 5.0-CURRENT i386
>Organization:
ilse technology
>Environment:
FreeBSD office-install1.ilse.net 5.0-CURRENT FreeBSD 5.0-CURRENT #8: Tue Apr 29 11:21:52 CEST 2003 root at office-install1.ilse.net:/usr/obj/usr/src/sys/SMP i386
>Description:
On cached for example NFS, close can return ENOSPC, indicating
that it could not correctly write pending flushes to disk. It
would be nice to have this documented. Also, the paragraph about
why you should use close() yourself, made me wonder what kind of
programming we were trying to promote here...
>How-To-Repeat:
NFS mount a dir, write enough to it (at least 4 Mb in my case,
it's porbably some buffersize issue), then close() the file and
see ENOSPC returned.
>Fix:
Patch follows:
--- /usr/src/lib/libc/sys/close.2 Fri May 23 15:37:05 2003
+++ /usr/src/lib/libc/sys/close.2 Fri May 23 15:48:00 2003
@@ -71,11 +71,9 @@
file descriptor for that file is closed by that process.
.Pp
When a process exits,
-all associated file descriptors are freed, but since there is
-a limit on active descriptors per processes, the
+all associated file descriptors are freed, as though the process called
.Fn close
-system call
-is useful when a large quantity of file descriptors are being handled.
+itself.
.Pp
When a process forks (see
.Xr fork 2 ) ,
@@ -115,6 +113,8 @@
is not an active descriptor.
.It Bq Er EINTR
An interrupt was received.
+.It Bq Er ENOSPC
+The underlying object did not fit, cached data was lost.
.El
.Sh SEE ALSO
.Xr accept 2 ,
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-doc
mailing list