summaryrefslogtreecommitdiff
path: root/static/unix-v10/man3/getshput.3
blob: 248518b7ee7c528f44b37081b5ea1ff3ab574282 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
.TH GETSHPUT 3 SHARE
.SH NAME
getshput \- read, modify, and write shares file entry
.SH SYNOPSIS
.B "#include <shares.h>"
.br
.sp
.B "unsigned long getshput(lp, func)"
.br
.B "struct lnode * lp;"
.br
.B "unsigned long (*func)();"
.SH DESCRIPTION
.I Getshput
finds the shares entry with the same uid as
.I lp\->l_uid
and reads it into an internal
.I lnode
structure.
The function pointed to by
.I func
is then called with two arguments,
the first pointing to the original
.I lnode
structure,
and the second pointing to the internal
.I lnode
structure.
If
.I func
returns with a value other than 0
the (presumably modified) second structure is written back to the shares file,
with the ``extime'' field in the shares record filled with the value returned by
.IR func .
Otherwise
.I getshput
simply returns.
.I Getshput
returns the value returned by
.IR func .
.SH "SEE ALSO"
closeshares(3),
getshares(3),
openshares(3),
putshares(3),
sharesfile(3).
.SH DIAGNOSTICS
.I Getshput
returns 0
if the entry can't be modified.