Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 23 May 2003 16:06:42 +0200 (CEST)
From:      Marc Olzheim <marcolz@ilse.nl>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   docs/52612: [PATCH] close() can return undocumented ENOSPC
Message-ID:  <200305231406.h4NE6gAJ038179@serv5.ilse.net>
Resent-Message-ID: <200305231410.h4NEA3Gg041503@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>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@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:



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