/* vfs_vnops.c 4.26 82/08/03 */
#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
) {
if (ip
->i_gid
>= NGRPS
||
(u
.u_grps
[ip
->i_gid
/(sizeof(int)*8)] &
(1 << ip
->i_gid
%(sizeof(int)*8)) == 0))
* 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