1LAM_RFPOSIX(2) LAM REMOTE LIBRARY LAM_RFPOSIX(2)
2
3
4
6 lam_rfposix - LAM POSIX-like remote file service
7
9 The remote file daemon, filed, provides POSIX file access for any
10 client process in the LAM multicomputer. Some services are LAM spe‐
11 cific (see lam_rfrmfd(2))). Most of services mirror local POSIX ser‐
12 vices and these are listed below.
13
14 open(2) open file
15 close(2) close file descriptor
16 read(2) read input
17 write(2) write output
18 lseek(2) set or increment position in file
19 access(2) check permissions and/or existance of a file
20 mkdir(2) create a directory
21 chdir(2) change current working directory
22 fstat(2) get status on a file descriptor
23 stat(2) get status on a file name
24 dup(2) duplicate a file descriptor
25 dup2(2) duplicate a file descriptor to a specific handle
26 system(3) issue a command to sh(1)
27 rmdir(2) remove a directory
28 unlink(2) remove a file
29 getwd(3) get name of current working directory
30 ftruncate(2) set open file to specified length
31 truncate(2) set named file to specified length
32
33 The names of the LAM versions of these functions are prepended with
34 'lam_rf', for example lam_rfopen(), lam_rfclose(), etc. The parameters
35 are the same as in the POSIX calls. Special flag bits passed to
36 lam_rfopen(2) will invoke special LAM functionality. These flags,
37 defined in <freq.h>, are listed below.
38
39 LAM_O_LOCK lock a file permanently active
40 LAM_O_REUSE reuse existing open descriptor with same file name
41 LAM_O_1WAY do not reply to write requests
42 LAM_O_DINT4 data are four-byte integers
43 LAM_O_DFLT4 data are four-byte reals (single precision)
44 LAM_O_DFLT8 data are eight-byte reals (double precision)
45
46 By default, files are accessed on the origin node. The node ID of a
47 file can be specified by prepending the file name with the node ID and
48 a `:'. The example below opens the file "foo" on node 15.
49
50 lam_rfopen("15:foo", O_RDWR, 0);
51
52 An active LAM file descriptor has an associated open POSIX file
53 descriptor. Since the daemon can maintain only a limited number of
54 open POSIX files, it periodically has to close them and reopen them for
55 a different LAM file descriptor. The global number of LAM file
56 descriptors is unlimited, as are the clients of the remote file ser‐
57 vice. Thus, performance problems (like thrashing) may be avoided by
58 locking certain files in an active state. Locked LAM file descriptors
59 will maintain their open POSIX descriptors until closed by the client.
60 Do not overuse this facility.
61
62 Most of the POSIX-like services behave exactly as in POSIX (in fact,
63 the genuine article is eventually called). The exception is
64 lam_rfwrite() when the data size is greater than the LAM network mes‐
65 sage size (as defined in <net.h>). Such requests have to be packe‐
66 tized. The daemon treats each packet as an individual write request in
67 order to remain simple and stateless. Therefore, long writes on asyn‐
68 chronous descriptors are not atomic.
69
71 The daemon does not allow read access to any filename starting with
72 "/dev/". This is done to prevent the possibility of the daemon block‐
73 ing on a slow device, such as a tty. This limitation will be removed
74 in the future.
75
77 lam_rfstate(2), lam_rfrmfd(2)
78
79
80
81LAM 7.1.2 March, 2006 LAM_RFPOSIX(2)