Changeset View
Changeset View
Standalone View
Standalone View
head/lib/libc/sys/unlink.2
Show All 22 Lines | |||||
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||||
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||||
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||||
.\" SUCH DAMAGE. | .\" SUCH DAMAGE. | ||||
.\" | .\" | ||||
.\" @(#)unlink.2 8.1 (Berkeley) 6/4/93 | .\" @(#)unlink.2 8.1 (Berkeley) 6/4/93 | ||||
.\" $FreeBSD$ | .\" $FreeBSD$ | ||||
.\" | .\" | ||||
.Dd October 20, 2018 | .Dd November 11, 2018 | ||||
.Dt UNLINK 2 | .Dt UNLINK 2 | ||||
.Os | .Os | ||||
.Sh NAME | .Sh NAME | ||||
.Nm unlink , | .Nm unlink , | ||||
.Nm unlinkat | .Nm unlinkat | ||||
.Nd remove directory entry | .Nd remove directory entry | ||||
.Sh LIBRARY | .Sh LIBRARY | ||||
.Lb libc | .Lb libc | ||||
▲ Show 20 Lines • Show All 45 Lines • ▼ Show 20 Lines | |||||
.Bl -tag -width indent | .Bl -tag -width indent | ||||
.It Dv AT_REMOVEDIR | .It Dv AT_REMOVEDIR | ||||
Remove the directory entry specified by | Remove the directory entry specified by | ||||
.Fa fd | .Fa fd | ||||
and | and | ||||
.Fa path | .Fa path | ||||
as a directory, not a normal file. | as a directory, not a normal file. | ||||
.It Dv AT_BENEATH | .It Dv AT_BENEATH | ||||
Only unlink files and directories which are beneath of the starting | Only unlink files and directories which are beneath of the topping | ||||
directory. | directory. | ||||
See the description of the | |||||
.Dv O_BENEATH | |||||
flag in the | |||||
.Xr open 2 | |||||
manual page. | |||||
.El | .El | ||||
.Pp | .Pp | ||||
If | If | ||||
.Fn unlinkat | .Fn unlinkat | ||||
is passed the special value | is passed the special value | ||||
.Dv AT_FDCWD | .Dv AT_FDCWD | ||||
in the | in the | ||||
.Fa fd | .Fa fd | ||||
▲ Show 20 Lines • Show All 96 Lines • ▼ Show 20 Lines | |||||
The | The | ||||
.Fa path | .Fa path | ||||
argument is not an absolute path and | argument is not an absolute path and | ||||
.Fa fd | .Fa fd | ||||
is neither | is neither | ||||
.Dv AT_FDCWD | .Dv AT_FDCWD | ||||
nor a file descriptor associated with a directory. | nor a file descriptor associated with a directory. | ||||
.It Bq Er ENOTCAPABLE | .It Bq Er ENOTCAPABLE | ||||
.Fa path | |||||
is an absolute path, | |||||
or contained a ".." component leading to a | |||||
directory outside of the directory hierarchy specified by | |||||
.Fa fd , | |||||
and the process is in capability mode. | |||||
.It Bq Er ENOTCAPABLE | |||||
The | The | ||||
.Dv AT_BENEATH | .Dv AT_BENEATH | ||||
flag was specified but | flag was provided to | ||||
.Fn unlinkat , | |||||
and the absolute | |||||
.Fa path | .Fa path | ||||
is not strictly relative to the starting directory. | does not have its tail fully contained under the topping directory, | ||||
For example, | or the relative | ||||
.Fa path | .Fa path | ||||
is absolute or includes a ".." component that escapes the starting directory. | escapes it. | ||||
.El | .El | ||||
.Sh SEE ALSO | .Sh SEE ALSO | ||||
.Xr chflags 2 , | .Xr chflags 2 , | ||||
.Xr close 2 , | .Xr close 2 , | ||||
.Xr link 2 , | .Xr link 2 , | ||||
.Xr rmdir 2 , | .Xr rmdir 2 , | ||||
.Xr symlink 7 | .Xr symlink 7 | ||||
.Sh STANDARDS | .Sh STANDARDS | ||||
Show All 18 Lines |