.th K_unlink II 4/21/86
.sh NAME
K_unlink - decrement file link count
.sh "MODULA SYNOPSIS"
.nh
.na
 CONST fSeid: seid;
.br
 VAR stat: K_err_num;
.br
 . . .
.br
 stat := NK_unlink(fSeid);
.br
.hy
.ad
.sp
.sh "C SYNOPSIS"
.nh
.na
 seid fSeid;
.br
 int stat;
.br
 . . .
.br
 stat = K_unlink (fSeid);
.br
.hy
.ad
.sh DESCRIPTION
K_unlink decrements the file reference count of the specified file.
When the file reference count is zero and no process has the file open,
the file is deleted.  When the count is decremented from one to zero,
the file becomes logically nonexistent.  If a file is logically
nonexistent, but the file has not been deleted because some process
still has it open, it cannot be opened again, and the file does not
exist for Kernel calls which take file SEIDs as arguments, such as
K_link (II).  When a file is created with K_create (II) it has a
reference count of zero, but does have logical existence and thus
K_link (II) can be used to increment its count.
.s3
The security and integrity checking are as if the file is being opened
for reading and writing, except that
no discretionary access checking is done
by the Kernel, allowing processes privileged to use this primitive to
perform whatever checking they choose to.
.sp
The use of K_unlink requires the privilege privLink.  This privilege is
normally restricted to the UNIX directory manager.
.sh EXCEPTIONS
.lp 22 15
XnoObj	Object does not exist, or process cannot determine existence
of object.
.i0
.sh "SEE ALSO"
K_link(II),
priv_struct(IIa)
