summaryrefslogtreecommitdiff
path: root/share/man/man9/file.9
diff options
context:
space:
mode:
authorMartin Pieuchot <mpi@cvs.openbsd.org>2015-05-07 08:53:34 +0000
committerMartin Pieuchot <mpi@cvs.openbsd.org>2015-05-07 08:53:34 +0000
commit1b64a290cb5c23b8ca6c35a93d7a1d417c0966b9 (patch)
tree11849275298a24e1f22849fd4aeda6e8e64e3c09 /share/man/man9/file.9
parent2e74448235b519e3016df1ec094e7aea1c4f46be (diff)
Pass a thread pointer instead of its file descriptor table to getvnode(9).
Input and ok millert@
Diffstat (limited to 'share/man/man9/file.9')
-rw-r--r--share/man/man9/file.923
1 files changed, 8 insertions, 15 deletions
diff --git a/share/man/man9/file.9 b/share/man/man9/file.9
index 0fdad047692..594679da907 100644
--- a/share/man/man9/file.9
+++ b/share/man/man9/file.9
@@ -1,4 +1,4 @@
-.\" $OpenBSD: file.9,v 1.14 2015/05/06 08:52:17 mpi Exp $
+.\" $OpenBSD: file.9,v 1.15 2015/05/07 08:53:33 mpi Exp $
.\"
.\" Copyright (c) 2002 Artur Grabowski <art@openbsd.org>
.\" All rights reserved.
@@ -22,7 +22,7 @@
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
-.Dd $Mdocdate: May 6 2015 $
+.Dd $Mdocdate: May 7 2015 $
.Dt FILE 9
.Os
.Sh NAME
@@ -47,7 +47,7 @@
.In sys/filedesc.h
.In sys/vnode.h
.Ft int
-.Fn getvnode "struct filedesc *fdp" "int fd" "struct file **fpp"
+.Fn getvnode "struct proc *p" "int fd" "struct file **fpp"
.Sh DESCRIPTION
These functions provide the interface for the UNIX file descriptors.
File descriptors can be used to access vnodes (see
@@ -75,27 +75,20 @@ recommended to make complicated kernel APIs that require it.
The files are extracted from the file descriptor table using the
functions
.Fn fd_getfile
-and
-.Fn getvnode .
.Fn fd_getfile
performs all necessary checks to see if the file descriptor number is
within the range of file descriptor table, and if the descriptor is
valid.
-.Fn getvnode
-is a special case that besides doing
-.Fn fd_getfile
-also checks if the descriptor is a vnode, returns the proper
-errno on error and increases the use count with
-.Fn FREF .
.Pp
The files are extracted from the process context using the
function
-.Fn getsock .
.Fn getsock
-is a special case that besides doing
+and
+.Fn getvnode .
+These functions are special cases that besides doing
.Fn fd_getfile
-also checks if the descriptor is a socket, returns the proper
-errno on error and increases the use count with
+also check if the descriptor is a socket or a vnode respectively,
+return the proper errno on error and increase the use count with
.Fn FREF .
.Sh CONCURRENT ACCESS
Since multiple processes can share the same file descriptor table,