]> git.lizzy.rs Git - plan9front.git/blob - sys/man/3/shr
shr(3): fix man page
[plan9front.git] / sys / man / 3 / shr
1 .TH SHR 3 
2 .SH NAME
3 shr \- global mountpoints
4 .SH SYNOPSIS
5 .nf
6 .B bind '#σ' /shr
7
8 .BI #σ/ share1
9 .BI #σc/ share1/service1
10 .BI #σc/ share1/service2
11  ...
12 .fi
13 .SH DESCRIPTION
14 The
15 .I shr
16 device provides global mountpoints in the form of share directories
17 where
18 .IR 9P
19 services can be mounted.
20
21 Effectively, it is a global mountpoint registry that is separate from
22 private namespaces.
23 .PP
24 The
25 .I shr
26 device exports a mount tree and a control tree.
27 The directories
28 in the mount tree
29 .BI #σ
30 are the share mountpoints themselves, while the directories in
31 .BI #σc
32 contain the service files of the share.
33 .PP
34 To create a new share, create the directory
35 .B #σc/myshare
36
37 To mount a service in that share, create the file
38 .B #σc/myshare/myserv
39 and then write a text string (suitable for
40 .IR strtoul ;
41 see
42 .IR atof (2))
43 giving the file descriptor number of an open
44 .I 9P
45 service.  Any process
46 with the proper permission may then access
47 .B #σ/myshare
48 on the mount tree.
49 .PP
50 The service file can be reopened and passed to
51 .IR mount
52 (see
53 .IR bind(2))
54 or added to another share.
55 .PP
56 Multiple services can be mounted under a share forming a union
57 directory. New services get mounted before old ones.
58 Removing the service file unmounts the service from the share.
59 .PP
60 Creating shares and mounts requires read-write access in the share
61 directory. The special user
62 .B none
63 is prohibited from these operations.
64 .SH SOURCE
65 .B /sys/src/9/port/devshr.c