Changeset View
Changeset View
Standalone View
Standalone View
lib/libc/sys/link.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. | ||||
.\" | .\" | ||||
.\" @(#)link.2 8.3 (Berkeley) 1/12/94 | .\" @(#)link.2 8.3 (Berkeley) 1/12/94 | ||||
.\" $FreeBSD$ | .\" $FreeBSD$ | ||||
.\" | .\" | ||||
.Dd September 23, 2020 | .Dd February 23, 2021 | ||||
.Dt LINK 2 | .Dt LINK 2 | ||||
.Os | .Os | ||||
.Sh NAME | .Sh NAME | ||||
.Nm link , | .Nm link , | ||||
.Nm linkat | .Nm linkat | ||||
.Nd make a hard file link | .Nd make a hard file link | ||||
.Sh LIBRARY | .Sh LIBRARY | ||||
.Lb libc | .Lb libc | ||||
▲ Show 20 Lines • Show All 70 Lines • ▼ Show 20 Lines | |||||
list, defined in | list, defined in | ||||
.In fcntl.h : | .In fcntl.h : | ||||
.Bl -tag -width indent | .Bl -tag -width indent | ||||
.It Dv AT_SYMLINK_FOLLOW | .It Dv AT_SYMLINK_FOLLOW | ||||
If | If | ||||
.Fa name1 | .Fa name1 | ||||
names a symbolic link, a new link for the target of the symbolic link is | names a symbolic link, a new link for the target of the symbolic link is | ||||
created. | created. | ||||
.It Dv AT_BENEATH | |||||
Only allow to link to a file which is beneath of the topping directory. | |||||
See the description of the | |||||
.Dv O_BENEATH | |||||
flag in the | |||||
.Xr open 2 | |||||
manual page. | |||||
.It Dv AT_RESOLVE_BENEATH | .It Dv AT_RESOLVE_BENEATH | ||||
Only walks paths below the topping directory. | Only walks paths below the topping directory. | ||||
See the description of the | See the description of the | ||||
.Dv O_RESOLVE_BENEATH | .Dv O_RESOLVE_BENEATH | ||||
flag in the | flag in the | ||||
.Xr open 2 | .Xr open 2 | ||||
manual page. | manual page. | ||||
.El | .El | ||||
▲ Show 20 Lines • Show All 144 Lines • ▼ Show 20 Lines | |||||
.Fa name1 | .Fa name1 | ||||
is not strictly relative to the starting directory. | is not strictly relative to the starting directory. | ||||
For example, | For example, | ||||
.Fa name1 | .Fa name1 | ||||
is absolute or includes a ".." component that escapes | is absolute or includes a ".." component that escapes | ||||
the directory hierarchy specified by | the directory hierarchy specified by | ||||
.Fa fd , | .Fa fd , | ||||
and the process is in capability mode. | and the process is in capability mode. | ||||
.It Bq Er ENOTCAPABLE | |||||
The | |||||
.Dv AT_BENEATH | |||||
flag was provided to | |||||
.Fa linkat | |||||
and the absolute path | |||||
.Fa name1 | |||||
does not have its tail fully contained under the topping directory, | |||||
or the relative path | |||||
.Fa name1 | |||||
escapes it. | |||||
.El | .El | ||||
.Sh SEE ALSO | .Sh SEE ALSO | ||||
.Xr chflags 2 , | .Xr chflags 2 , | ||||
.Xr readlink 2 , | .Xr readlink 2 , | ||||
.Xr symlink 2 , | .Xr symlink 2 , | ||||
.Xr unlink 2 | .Xr unlink 2 | ||||
.Sh STANDARDS | .Sh STANDARDS | ||||
The | The | ||||
Show All 21 Lines |