Files
oldlinux-files/Ref-docs/syscalls/syscalls_18.html
2024-02-19 00:21:47 -05:00

37 lines
1.7 KiB
HTML

<html><!-- This HTML file has been created by texi2html 1.29
from syscalls.texi on 4 June 1994 -->
<TITLE>Syscall specifications of Linux - link</TITLE>
<P>Go to the <A HREF="syscalls_17.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_17.html">previous</A>, <A HREF="syscalls_19.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_19.html">next</A> section.<P>
<H2><A NAME="SEC18" HREF="syscalls_toc.html#SEC18" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_toc.html#SEC18">link</A></H2>
<P>
<H3>SYNOPSIS</H3>
<P>
<CODE>int link(const char *<VAR>src</VAR>, const char *<VAR>new</VAR>);</CODE>
<P>
<H3>PARAMETERS</H3>
<P>
<VAR>src</VAR>: [in] points the the file we want to add a link to.
<P>
<VAR>new</VAR>: [in] points to the path for the new link.
<H3>DESCRIPTION</H3>
<P>
Creates a new (hard) link to a file. There is no way to distinguish
the links.
<P>
<H3>RETURN VALUE</H3>
<P>
On success zero is returned. On error, -1 is returned and <CODE>errno</CODE> is
set to one of the following values:
<P>
<UL>
<LI><CODE>EPERM</CODE>: the file system does not support hard links or
<VAR>oldpath</VAR> is the <CODE>.</CODE> or <CODE>..</CODE> entry of a directory.
<LI><CODE>EXDEV</CODE>, <CODE>EFAULT</CODE>, <CODE>EACCESS</CODE>, <CODE>ENAMETOOLONG</CODE>,
<CODE>ENOENT</CODE>, <CODE>ENOTDIR</CODE>, <CODE>ENOMEM</CODE>, <CODE>EROFS</CODE>,
<CODE>EEXIST</CODE>, <CODE>EMLINK</CODE>, <CODE>ELOOP</CODE> and. <CODE>ESPC</CODE>.
</UL>
<P>
<P>Go to the <A HREF="syscalls_17.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_17.html">previous</A>, <A HREF="syscalls_19.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_19.html">next</A> section.<P>