xref: /386bsd/usr/share/man/cat2/readlink.0 (revision a2142627)
1READLINK(2)               386BSD Programmer's Manual               READLINK(2)
2
3NNAAMMEE
4     rreeaaddlliinnkk - read value of a symbolic link
5
6SSYYNNOOPPSSIISS
7     ##iinncclluuddee <<uunniissttdd..hh>>
8
9     _i_n_t
10     rreeaaddlliinnkk(_c_o_n_s_t _c_h_a_r *_p_a_t_h, _c_h_a_r *_b_u_f, _i_n_t _b_u_f_s_i_z)
11
12DDEESSCCRRIIPPTTIIOONN
13     RReeaaddlliinnkk() places the contents of the symbolic link _p_a_t_h in the buffer
14     _b_u_f, which has size _b_u_f_s_i_z. RReeaaddlliinnkk does not append a NUL character to
15     _b_u_f.
16
17RREETTUURRNN VVAALLUUEESS
18     The call returns the count of characters placed in the buffer if it
19     succeeds, or a -1 if an error occurs, placing the error code in the
20     global variable _e_r_r_n_o.
21
22EERRRROORRSS
23     RReeaaddlliinnkk() will fail if:
24
25     [ENOTDIR]     A component of the path prefix is not a directory.
26
27     [EINVAL]      The pathname contains a character with the high-order bit
28                   set.
29
30     [ENAMETOOLONG]
31                   A component of a pathname exceeded 255 characters, or an
32                   entire path name exceeded 1023 characters.
33
34     [ENOENT]      The named file does not exist.
35
36     [EACCES]      Search permission is denied for a component of the path
37                   prefix.
38
39     [ELOOP]       Too many symbolic links were encountered in translating the
40                   pathname.
41
42     [EINVAL]      The named file is not a symbolic link.
43
44     [EIO]         An I/O error occurred while reading from the file system.
45
46     [EFAULT]      _B_u_f extends outside the process's allocated address space.
47
48SSEEEE AALLSSOO
49     stat(2),  lstat(2),  symlink(2)
50
51HHIISSTTOORRYY
52     The rreeaaddlliinnkk function call appeared in 4.2BSD.
53
544.2 Berkeley Distribution       March 10, 1991                               1
55
56
57
58
59
60
61
62
63
64
65
66
67