da6f6103fd454ebbe4ebd803b1bae0f05ad61cd6
[unix-history] / usr / src / lib / libc / sys / undelete.2
.\" Copyright (c) 1994
.\" Jan-Simon Pendry
.\" The Regents of the University of California. All rights reserved.
.\"
.\" %sccs.include.redist.man%
.\"
.\" @(#)undelete.2 8.2 (Berkeley) %G%
.\"
.Dd
.Dt UNWHITEOUT 2
.Os BSD 4
.Sh NAME
.Nm unwhiteout
.Nd remove whiteout entry
.Sh SYNOPSIS
.Fd #include <unistd.h>
.Ft int
.Fn unwhiteout "const char *path"
.Sh DESCRIPTION
The
.Fn unwhiteout
function
removes the whiteout named by
.Fa path
from its directory.
Any objects in a lower layer of the
union stack will become visible once more.
.Sh RETURN VALUES
Upon successful completion, a value of 0 is returned.
Otherwise, a value of -1 is returned and
.Va errno
is set to indicate the error.
.Sh ERRORS
The
.Fn unwhiteout
succeeds unless:
.Bl -tag -width ENAMETOOLONGAA
.It Bq Er ENOTDIR
A component of the path prefix is not a directory.
.It Bq Er EINVAL
The pathname contains a character with the high-order bit set.
.It Bq Er ENAMETOOLONG
A component of a pathname exceeded 255 characters,
or an entire path name exceeded 1023 characters.
.It Bq Er EXIST
The path does not reference a whiteout.
.It Bq Er ENOENT
The whiteout does not exist.
.It Bq Er EACCES
Search permission is denied for a component of the path prefix.
.It Bq Er EACCES
Write permission is denied on the directory containing the link
to be removed.
.It Bq Er ELOOP
Too many symbolic links were encountered in translating the pathname.
.It Bq Er EPERM
The directory containing the file is marked sticky,
and the containing directory is not owned by the effective user ID.
.It Bq Er EIO
An I/O error occurred while deleting the directory entry.
.It Bq Er EROFS
The whiteout resides on a read-only file system.
.It Bq Er EFAULT
.Fa Path
points outside the process's allocated address space.
.El
.Sh SEE ALSO
.Xr unlink 2 ,
.Xr mount_union 8
.Sh HISTORY
An
.Nm
function call first appeared in 4.4BSD-Lite.