1RFIO_SYMLINK(3) Rfio Library Functions
2RFIO_SYMLINK(3)
3
4
5
6[1mNAME[0m
7 rfio_symlink ‐ create a symbolic link to a file
8
9[1mSYNOPSIS[0m
10 [1m#include <sys/types.h>[0m
11 [1m#include "rfio_api.h"[0m
12
13 [1mint rfio_symlink (const char *[4m[22moldpath[24m[1m,
14const char *[4m[22mnewpath[24m[1m);[0m
15 [1mint rfio_msymlink (const char *[4m[22moldpath[24m[1m,
16const char *[4m[22mnewpath[24m[1m);[0m
17 [1mint rfio_msymlink_reset ();[0m
18 [1mint rfio_symend ();[0m
19
20[1mDESCRIPTION[0m
21 [1mrfio_symlink [22mcreates a symbolic link [4mnew‐
22path[24m which contains the string
23 [4moldpath[24m.
24
25 [4mnewpath[24m may point to a non existing file.
26 If [4mnewpath[24m exists already, it will not be overwrit‐
27ten.
28 Write permission is required on [4mnewpath[24m parent.
29
30 [1mrfio_msymlink [22mis identical to [1mrfio_symlink
31[22mbut keeps the connection
32 open to the server unless there are more than MAXM‐
33CON connections
34 already opened. This is useful when issuing a series of
35symlink calls.
36 The last [1mrfio_msymlink [22mcall should be fol‐
37lowed by a call to
38 [1mrfio_symend[22m.
39
40 [1mrfio_msymlink_reset [22mis to be used when your program
41is forking. In such
42 a case the permanent connections opened with [1mr‐
43fio_msymlink [22mbecome
44 shared between the parent and the child. Use [1mr‐
45fio_msymlink_reset [22mto
46 perform the necessary reset and close of the socket file
47descriptor in
48 the parent or the child in order to be sure that only
49of them will
50 receice an answer from the RFIO daemon.
51
52 See NOTES section below.
53
54[1mRETURN VALUE[0m
55 This routine returns 0 if the operation was successful
56or ‐1 if the
57 operation failed. In the latter case, [1mserrno [22mis set
58appropriately.
59
60[1mNOTES[0m
61 Multiple connections using rfio_msymlink are thread‐
62safe but not
63 process‐wide, therefore a forked child can share
64file descriptors
65 opened with rfio_msymlink by its parent. Use [1mr‐
66fio_msymlink_reset [22min
67 such case.
68
69 Multiple connections behaviour is undefined if you
70work in a multi‐
71 threaded environment and with threads [1mnot [22mcreat‐
72ed using the LCG’s
73 [1mCthread [22minterface.
74
75[1mERRORS[0m
76 [1mENOENT [22mA component of [4mnewpath[24m prefix
77does not exist or [4moldpath[24m is
78 a null pathname.
79
80 [1mENOMEM [22mInsufficient memory.
81
82 [1mEACCES [22mSearch permission is denied on a com‐
83ponent of the [4mnewpath[0m
84 prefix or write permission on the [4mnew‐
85path[24m parent directory
86 is denied.
87
88 [1mEFAULT [4m[22moldpath[24m or [4mnewpath[24m is a
89NULL pointer.
90
91 [1mEEXIST [4m[22mnewpath[24m already exists.
92
93 [1mENOTDIR [22mA component of the [4mnewpath[24m pre‐
94fix is not a directory.
95
96 [1mENAMETOOLONG [22mThe length of [4moldpath[24m or
97[4mnewpath[24m exceeds [1mCA_MAXPATHLEN [22mor
98 the length of a path component exceeds
99[1mCA_MAXNAMELEN[22m.
100
101 [1mSENOSHOST [22mHost unknown.
102
103 [1mSENOSSERV [22mService unknown.
104
105 [1mSECOMERR [22mCommunication error.
106
107 [1mSEOPNOTSUP [22mNot supported on Windows.
108
109[1mSEE ALSO[0m
110 [1mCastor_limits(4)[22m, [1mrfio_readlink(3)[22m, [1mr‐
111fio_unlink(3)[22m, [1mCthread(3)[0m
112
113[1mAUTHOR[0m
114 [1mLCG Grid Deployment [22mTeam
115
116
117
118LCG $Date: 2005/03/31 13:13:03 $
119RFIO_SYMLINK(3)
120
121
122
123
124
125
126
127
128
129
130
131
132