/* vfs_vnops.c 4.27 82/08/24 */
#include "../h/socketvar.h"
* Openi called to allow handler
* of special files to initialize and
* validate before actual IO.
register struct inode
*ip
;
register unsigned int maj
;
switch (ip
->i_mode
&IFMT
) {
(*cdevsw
[maj
].d_open
)(dev
, mode
);
(*bdevsw
[maj
].d_open
)(dev
, mode
);
* Check mode permission on inode pointer.
* Mode is READ, WRITE or EXEC.
* In the case of WRITE, the
* read-only status of the file
* Also in WRITE, prototype text
* segments cannot be written.
* The mode is shifted to select
* the owner/group/other fields.
* The super user is granted all
register struct inode
*ip
;
if (ip
->i_fs
->fs_ronly
!= 0) {
if (ip
->i_flag
&ITEXT
) /* try to free text */
if (ip
->i_flag
& ITEXT
) {
if (u
.u_uid
!= ip
->i_uid
) {
for (gp
= u
.u_groups
; gp
< &u
.u_groups
[NGROUPS
]; gp
++)
* Look up a pathname and test if
* the resultant inode is owned by the
* If not, try for super-user.
* If permission is granted,
register struct inode
*ip
;
ip
= namei(uchar
, 0, follow
);
if (u
.u_uid
== ip
->i_uid
)
* Test if the current user is the