1.\" $NetBSD: undelete.2,v 1.15 2009/01/11 02:46:30 christos Exp $ 2.\" 3.\" Copyright (c) 1994 4.\" The Regents of the University of California. All rights reserved. 5.\" 6.\" Redistribution and use in source and binary forms, with or without 7.\" modification, are permitted provided that the following conditions 8.\" are met: 9.\" 1. Redistributions of source code must retain the above copyright 10.\" notice, this list of conditions and the following disclaimer. 11.\" 2. Redistributions in binary form must reproduce the above copyright 12.\" notice, this list of conditions and the following disclaimer in the 13.\" documentation and/or other materials provided with the distribution. 14.\" 3. Neither the name of the University nor the names of its contributors 15.\" may be used to endorse or promote products derived from this software 16.\" without specific prior written permission. 17.\" 18.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 19.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 22.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 24.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 25.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 27.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 28.\" SUCH DAMAGE. 29.\" 30.\" Copyright (c) 1994 31.\" Jan-Simon Pendry 32.\" 33.\" Redistribution and use in source and binary forms, with or without 34.\" modification, are permitted provided that the following conditions 35.\" are met: 36.\" 1. Redistributions of source code must retain the above copyright 37.\" notice, this list of conditions and the following disclaimer. 38.\" 2. Redistributions in binary form must reproduce the above copyright 39.\" notice, this list of conditions and the following disclaimer in the 40.\" documentation and/or other materials provided with the distribution. 41.\" 3. All advertising materials mentioning features or use of this software 42.\" must display the following acknowledgement: 43.\" This product includes software developed by the University of 44.\" California, Berkeley and its contributors. 45.\" 4. Neither the name of the University nor the names of its contributors 46.\" may be used to endorse or promote products derived from this software 47.\" without specific prior written permission. 48.\" 49.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 50.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 51.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 52.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 53.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 54.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 55.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 56.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 57.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 58.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 59.\" SUCH DAMAGE. 60.\" 61.\" @(#)undelete.2 8.4 (Berkeley) 10/18/94 62.\" 63.Dd November 28, 2008 64.Dt UNDELETE 2 65.Os 66.Sh NAME 67.Nm undelete 68.Nd remove whiteout 69.Sh LIBRARY 70.Lb libc 71.Sh SYNOPSIS 72.In unistd.h 73.Ft int 74.Fn undelete "const char *path" 75.Sh DESCRIPTION 76Currently 77.Nm 78works only when the named object 79is a whiteout in a union filesystem. 80The system call removes the whiteout causing 81any objects in a lower layer of the 82union stack to become visible once more. 83.Sh RETURN VALUES 84Upon successful completion, a value of 0 is returned. 85Otherwise, a value of \-1 is returned and 86.Va errno 87is set to indicate the error. 88.Sh ERRORS 89The 90.Fn undelete 91succeeds unless: 92.Bl -tag -width ENAMETOOLONGAA 93.It Bq Er EACCES 94Search permission is denied for a component of the path prefix, or 95write permission is denied on the directory containing the name 96to be undeleted. 97.It Bq Er EEXIST 98The path does not reference a whiteout. 99.It Bq Er EFAULT 100.Fa path 101points outside the process's allocated address space. 102.It Bq Er EINVAL 103The pathname contains a character with the high-order bit set. 104.It Bq Er EIO 105An I/O error occurred while updating the directory entry. 106.It Bq Er ELOOP 107Too many symbolic links were encountered in translating the pathname. 108.It Bq Er ENAMETOOLONG 109A component of a pathname exceeded 255 characters, 110or an entire path name exceeded 1023 characters. 111.It Bq Er ENOENT 112The named whiteout does not exist. 113.It Bq Er ENOTDIR 114A component of the path prefix is not a directory. 115.It Bq Er EPERM 116The directory containing the name is marked sticky, 117and the containing directory is not owned by the effective user ID. 118.It Bq Er EROFS 119The name resides on a read-only file system. 120.El 121.Sh SEE ALSO 122.Xr unlink 2 , 123.Xr mount_union 8 124.Sh HISTORY 125An 126.Nm undelete 127function call first appeared in 128.Bx 4.4 -Lite . 129