plan9fox/sys/man/3/shr

78 lines
1.6 KiB
Plaintext
Raw Normal View History

2011-08-13 20:20:01 +00:00
.TH SHR 3
.SH NAME
shr \- global mountpoints
.SH SYNOPSIS
.nf
2011-08-17 17:03:44 +00:00
.B bind '#σ' /shr
2011-08-13 20:20:01 +00:00
.BI #σ/ share1
.BI #σc/ share1/service1
.BI #σc/ share1/service2
...
.fi
.SH DESCRIPTION
The
.I shr
device provides global mountpoints in the form of share directories
2011-08-15 16:27:30 +00:00
where
.IR 9P
2011-08-18 17:04:15 +00:00
services can be mounted.
2011-08-13 20:20:01 +00:00
Effectively, it is a global mountpoint registry that is separate from
private namespaces.
.PP
The
.I shr
2011-08-17 17:03:44 +00:00
device exports a mount tree and a control tree.
The directories
2011-08-13 20:20:01 +00:00
in the mount tree
.BI #σ
2011-08-19 04:58:05 +00:00
are the share mountpoints themselves, while the directories in
2011-08-13 20:20:01 +00:00
.BI #σc
2011-08-19 04:58:05 +00:00
contain the service files of the share.
2011-08-13 20:20:01 +00:00
.PP
To create a new share, create the directory
.B #σc/myshare
To mount a service in that share, create the file
.B #σc/myshare/myserv
and then write a text string (suitable for
.IR strtoul ;
see
.IR atof (2))
2011-08-15 16:27:30 +00:00
giving the file descriptor number of an open
.I 9P
service. Any process
2011-08-13 20:20:01 +00:00
with the proper permission may then access
.B #σ/myshare
2011-08-15 16:27:30 +00:00
on the mount tree.
2011-08-13 20:20:01 +00:00
.PP
2011-08-15 16:27:30 +00:00
The service file can be reopened and passed to
.IR mount
(see
2011-08-22 01:55:31 +00:00
.IR bind (2))
2011-08-15 16:27:30 +00:00
or added to another share.
.PP
Multiple services can be mounted under a share forming a union
directory. New services get mounted before old ones.
Removing the service file unmounts the service from the share.
.PP
Creating shares and mounts requires read-write access in the share
directory. The special user
.B none
is prohibited from these operations.
2016-05-03 17:35:19 +00:00
.SH EXAMPLES
To mount a 9p service from
2016-05-03 17:37:46 +00:00
.IR srv (3)
2016-05-03 17:35:19 +00:00
to the shr device
.IP
.EX
mkdir '#σc'/myshare
echo 3 > '#σc'/myshare/myserv <>[3]/srv/myserv
.EE
2011-08-13 20:20:01 +00:00
.SH SOURCE
.B /sys/src/9/port/devshr.c
2013-12-27 21:22:05 +00:00
.SH HISTORY
.I Shr
first appeared in 9front (July, 2011).