VOP_ACCESS.9 (32eef9aeb1f39a1623cea55da147c89abbd5b9a5) VOP_ACCESS.9 (be8989d5163307904446f54c80e4d1af24a19420)
1.\" -*- nroff -*-
2.\" -*- nroff -*-
3.\"
4.\" Copyright (c) 1996 Doug Rabson
5.\"
6.\" All rights reserved.
7.\"
8.\" This program is free software.

--- 25 unchanged lines hidden (view full) ---

34.Dt VOP_ACCESS 9
35.Sh NAME
36.Nm VOP_ACCESS
37.Nd "check access permissions of a file or Unix domain socket"
38.Sh SYNOPSIS
39.In sys/param.h
40.In sys/vnode.h
41.Ft int
1.\" -*- nroff -*-
2.\" -*- nroff -*-
3.\"
4.\" Copyright (c) 1996 Doug Rabson
5.\"
6.\" All rights reserved.
7.\"
8.\" This program is free software.

--- 25 unchanged lines hidden (view full) ---

34.Dt VOP_ACCESS 9
35.Sh NAME
36.Nm VOP_ACCESS
37.Nd "check access permissions of a file or Unix domain socket"
38.Sh SYNOPSIS
39.In sys/param.h
40.In sys/vnode.h
41.Ft int
42.Fn VOP_ACCESS "struct vnode *vp" "int mode" "struct ucred *cred" "struct proc *p"
42.Fn VOP_ACCESS "struct vnode *vp" "int mode" "struct ucred *cred" "struct thread *td"
43.Sh DESCRIPTION
44This entry point checks the access permissions of the file against the
45given credentials.
46.Pp
47Its arguments are:
48.Bl -tag -width mode
49.It Ar vp
50the vnode of the file to check
51.It Ar mode
52the type of access required
53.It Ar cred
54the user credentials to check
43.Sh DESCRIPTION
44This entry point checks the access permissions of the file against the
45given credentials.
46.Pp
47Its arguments are:
48.Bl -tag -width mode
49.It Ar vp
50the vnode of the file to check
51.It Ar mode
52the type of access required
53.It Ar cred
54the user credentials to check
55.It Ar p
56the process which is checking
55.It Ar td
56the thread which is checking
57.El
58.Pp
59The
60.Fa mode
61is a mask which can contain
62.Dv VREAD ,
63.Dv VWRITE
64or
65.Dv VEXEC .
66.Sh LOCKS
67The vnode will be locked on entry and should remain locked on return.
68.Sh RETURN VALUES
69If the file is accessible in the specified way, then zero is returned,
70otherwise an appropriate error code is returned.
71.Sh PSEUDOCODE
72.Bd -literal
73int
57.El
58.Pp
59The
60.Fa mode
61is a mask which can contain
62.Dv VREAD ,
63.Dv VWRITE
64or
65.Dv VEXEC .
66.Sh LOCKS
67The vnode will be locked on entry and should remain locked on return.
68.Sh RETURN VALUES
69If the file is accessible in the specified way, then zero is returned,
70otherwise an appropriate error code is returned.
71.Sh PSEUDOCODE
72.Bd -literal
73int
74vop_access(struct vnode *vp, int mode, struct ucred *cred, struct proc *p)
74vop_access(struct vnode *vp, int mode, struct ucred *cred, struct thread *td)
75{
76 int error;
77
78 /*
79 * Disallow write attempts on read-only file systems;
80 * unless the file is a socket, fifo, or a block or
81 * character device resident on the file system.
82 */

--- 67 unchanged lines hidden ---
75{
76 int error;
77
78 /*
79 * Disallow write attempts on read-only file systems;
80 * unless the file is a socket, fifo, or a block or
81 * character device resident on the file system.
82 */

--- 67 unchanged lines hidden ---