Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

link(2) [v7 man page]

LINK(2) 							System Calls Manual							   LINK(2)

NAME
link - link to a file SYNOPSIS
link(name1, name2) char *name1, *name2; DESCRIPTION
A link to name1 is created; the link has the name name2. Either name may be an arbitrary path name. SEE ALSO
ln(1), unlink(2) DIAGNOSTICS
Zero is returned when a link is made; -1 is returned when name1 cannot be found; when name2 already exists; when the directory of name2 cannot be written; when an attempt is made to link to a directory by a user other than the super-user; when an attempt is made to link to a file on another file system; when a file has too many links. ASSEMBLER
(link = 9.) sys link; name1; name2 LINK(2)

Check Out this Related Man Page

symlink(2)							System Calls Manual							symlink(2)

Name
       symlink - make symbolic link to a file

Syntax
       symlink(name1, name2)
       char *name1, *name2;

Description
       A  symbolic link name2 is created to name1 (name2 is the name of the file created, name1 is the string used in creating the symbolic link).
       Either name can be an arbitrary path name.  The files need not be on the same file system.

Return Values
       Upon successful completion, a zero (0) value is returned.  If an error occurs, the error code is  stored  in  errno,  and  a  -1  value	is
       returned.

Diagnostics
       The symbolic link is made, unless one or more of the following are true:

       [ENOTDIR]      A component of the name2 prefix is not a directory.

       [EEXIST]       The name2 already exists.

       [EACCES]       A component of the name2 path prefix denies search permission.

       [EROFS]	      The file name2 would reside on a read-only file system.

       [EFAULT]       The name1 or name2 points outside the process's allocated address space.

       [ELOOP]	      Too many symbolic links were encountered in translating the pathname.

       [ENAMETOOLONG] A  component of either pathname exceeded MAXNAMELEN characters, or the entire length of either pathname exceeded MAXPATHNAME
		      characters.

       [ENOENT]       The named file does not exist.

       [EIO]	      An I/O error occurred while making the directory entry for name2, or allocating the inode for name2, or writing out the link
		      contents of name2.

       [ENOSPC]       The  directory  in  which  the entry for the new symbolic link is being placed cannot be extended, because there is no space
		      left on the file system containing the directory.

       [ENOSPC]       The new symbolic link cannot be created, because there is no space left on the file system that will  contain  the  symbolic
		      link.

       [ENOSPC]       There are no free inodes on the file system on which the symbolic link is being created.

       [EDQUOT]       The  directory  in  which the entry for the new symbolic link is being placed cannot be extended because the user's quota of
		      disk blocks on the file system containing the directory has been exhausted.

       [EDQUOT]       The new symbolic link cannot be created because the user's quota of disk blocks on the file system  that	will  contain  the
		      symbolic link has been exhausted.

       [EDQUOT]       The user's quota of inodes on the file system on which the user's symbolic link is being created has been exhausted.

       [EIO]	      An I/O error occurred while making the directory entry or allocating the inode.

       [ETIMEDOUT]    A  connect  request  or remote file operation failed, because the connected party did not properly respond after a period of
		      time that is dependent on the communications protocol.

See Also
       ln(1), link(2), readlink(2), stat(2), unlink(2)

																	symlink(2)
Man Page

12 More Discussions You Might Find Interesting

1. Linux

MkLinux, almost done

I wouldn't say I'm a unix dummy, or a unix expert, but I have few other options. So I installed MkLinux on an old powermac 6100 I had around. I got it up and running too, its on my network, its apache web server works (though I need to install PHP) I downloaded the RC5-72 client and it runs great.... (25 Replies)
Discussion started by: l008com
25 Replies

2. SuSE

Errors while trying to install software on SuSE 9.2 Pro

First off I try to install XTheater on SuSE 9.2 Pro I run the ./configure command and this is what I get chris@linux:~/Desktop/Xtheater-0.9.2> ./configure loading cache ./config.cache checking for a BSD compatible install... (cached) /usr/bin/install -c checking whether build environment is... (25 Replies)
Discussion started by: CTroxtell21
25 Replies

3. Shell Programming and Scripting

Remove unwanted data?

Hi Can any one help me remove the unwanted data? I would want to remove the complete event id 4910 ( the type there is INFO), that means, I have to remove starting from 7th - 19th lines. can any one of you please help? Thanks, (24 Replies)
Discussion started by: hitmansilentass
24 Replies

4. HP-UX

Mirrored root and swap HP9000 machine

How do I check if the root and swap are mirrored on my HP9000 machine? Thank you, N. (33 Replies)
Discussion started by: NicoMan
33 Replies

5. Solaris

C Compiler

Greetings, :rolleyes: :o :confused: I am working on Solaris 8. I have a few questions: 1. How do I determine if I have the CC compiler? I know it isn't in my $PATH, so how do I find it? 2. How do you install wget? I have read the INSTALL file, but I am not familar with the switches,... (25 Replies)
Discussion started by: Roam
25 Replies

6. Solaris

SUNW, hme0: Link Down - Cable problem

Ultra E150 Solaris 2.5.1 Oracle server. was working fine, then started losing network connection. I can see in messages file that it was complaining about another device using its ip address. Though not any longer, though I wonder if that was a red herring. My IT guys have now re-reserved its ip... (29 Replies)
Discussion started by: AlSmith1964
29 Replies

7. Shell Programming and Scripting

Perl Script to check file date and size

Hi guys, i am new to perl. I started reading the perl documents and try to come up with some logic. I am trying to create a script that would go into a location, search for todays files, then searches for all .txt files from today. If todays not found, its an error If file size is less... (26 Replies)
Discussion started by: DallasT
26 Replies

8. Programming

C++ - Problem in asking and checking user's passwd

This is the source code: #include <pwd.h> #include <iostream> #include <string.h> using namespace std; int main() { struct passwd *user; char login="alex", password="qwertyuiop"; if ((user= getpwnam(login)) == NULL) cout << "No such user\n"; else if... (24 Replies)
Discussion started by: hakermania
24 Replies

9. Programming

Execute code in kernel mode.

Hi everyone. I would like to hook a system function (gettimeofday) to modify it. I guess I'll need kernel mode to do that. By the way, how could I do it (c++ or c)? I want to modify that function for one process which I know the PID. So I need to return my own value for that PID and real value... (29 Replies)
Discussion started by: lilezek
29 Replies

10. Programming

Incompatiblity of the code due to CC compiler version mismatch.

Incompatiblity of the code due to CC compiler version mismatch. I have a machine with Machine A-- Operating System:SunOs 5.8 Generic_117350-45 sun4u sparc SUNW,Ultra-80(solaris 5.8) CC Compiler:CC: WorkShop Compilers 4.2 16 Jun 1998 C++ 4.2 patch 104631-07 we have compiled C++... (36 Replies)
Discussion started by: Revathi R
36 Replies

11. Programming

Merge two strings by overlapped region

Hello, I am trying to concatenate two strings by merging the overlapped region. E.g. Seq1=ACGTGCCC Seq2=CCCCCGTGTGTGT Seq_merged=ACGTGCCCCCGTGTGTGTFunction strcat(char *dest, char *src) appends the src string to the dest string, ignoring the overlapped parts (prefix of src and suffix of dest).... (30 Replies)
Discussion started by: yifangt
30 Replies

12. What is on Your Mind?

What Social Networks Do You Use Regularly?

What Online Social Networks Do You Use Regularly? I use Facebook and LinkedIn nearly everyday.... You? If your online social network is not listed, please do a "write in" vote.. Thanks! (39 Replies)
Discussion started by: Neo
39 Replies