01.01.2013 Views

AT&T UNIX™PC Unix System V Users Manual - tenox

AT&T UNIX™PC Unix System V Users Manual - tenox

AT&T UNIX™PC Unix System V Users Manual - tenox

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

LINK ( 2 ) LINK ( 2 )<br />

NAME<br />

link - link to a file<br />

SYNOPSIS<br />

int link (pathl, path2)<br />

char *path l, *path2;<br />

DESCRIPTION<br />

Path1 points to a path name naming an existing file. Path2<br />

points to a path name naming the new directory entry to be<br />

created. Link creates a new link (directory entry) for the existing<br />

file.<br />

Link will fail and no link will be created if one or more of the following<br />

are true:<br />

A component of either path prefix is not a directory.<br />

[ENOTDIR]<br />

A component of either path prefix does not exist.<br />

[ENOENT[<br />

A component of either path prefix denies search permission.<br />

[EACCES]<br />

The file named by path1 does not exist. [ENOENT]<br />

The link named by path2 exists. [EEXIST]<br />

The file named by path1 is a directory and the effective<br />

user ID is not super-user. [EPERM]<br />

The link named by path2 and the file named by path1 are<br />

on different logical devices (file systems). [EXDEV]<br />

Path2 points to a null path name. [ENOENT[<br />

The requested link requires writing in a directory with a<br />

mode that denies write permission. [EACCES]<br />

The requested link requires writing in a directory on a<br />

read-only file system. [EROFS]<br />

Path points outside the process's allocated address space.<br />

[EFAULT[<br />

RETURN VALUE<br />

Upon successful completion, a value of 0 is returned. Otherwise, a<br />

value of -1 is returned and errno is set to indicate the error.<br />

SEE ALSO<br />

unlink(2).<br />

- 1 -

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!