From 78e51a8c6678b6e3dff3d619aa786669f531f4bc Mon Sep 17 00:00:00 2001 From: rsc Date: Fri, 14 Jan 2005 03:45:44 +0000 Subject: checkpoint --- man/man3/get9root.html | 109 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 109 insertions(+) create mode 100644 man/man3/get9root.html (limited to 'man/man3/get9root.html') diff --git a/man/man3/get9root.html b/man/man3/get9root.html new file mode 100644 index 00000000..6ca02c02 --- /dev/null +++ b/man/man3/get9root.html @@ -0,0 +1,109 @@ + +get9root(3) - Plan 9 from User Space + + + + +
+
+
GET9ROOT(3)GET9ROOT(3) +
+
+

NAME
+ +
+ + get9root, unsharp – get path to root of Plan 9 tree
+ +
+

SYNOPSIS
+ +
+ + #include <u.h>
+ #include <libc.h> +
+
+ char*       get9root(void) +
+
+ char*       unsharp(char *path)
+
+
+

DESCRIPTION
+ +
+ + This tree of Plan 9 software is conventionally installed in /usr/local/plan9 + but may be installed in other places (for example, users without + the ability to write to /usr/local may with to install it in their + own home directories). The environment variable $PLAN9 should + contain the path to the root. Get9root + returns a static pointer to the pathname of root, first checking + $PLAN9 and defaulting to /usr/local/plan9. +
+ + The lack of a fixed location for the Plan 9 tree makes it difficult + to hard-code paths to files. Unsharp replaces a leading #9 in + path with the root of the tree. Unsharp also replaces a leading + #d with the path to the underlying system’s file descriptor dup + device, typically /dev/fd. The string returned from unsharp, if + different from path, should be freed with free (see malloc(3)) + when no longer needed. +
+ + As a convention, programs should never unsharp paths obtained + from user input.
+ +
+

EXAMPLE
+ +
+ + The plumber(4) uses this code to find unrooted file names included + by plumb rules.
+ +
+ + snprint(buf, sizeof buf, "#9/plumb/%s", name);
+ fd = open(unsharp(buf), OREAD);
+
+
+ +
+

SOURCE
+ +
+ + /usr/local/plan9/src/lib9/getns.c
+
+
+

SEE ALSO
+ +
+ + intro(4)
+ +
+

BUGS
+ +
+ + Get9root could be smarter about finding the tree when $PLAN9 is + not set.
+ +
+ +

+
+
+ + +
+
+
+Space Glenda +
+
+ + -- cgit v1.2.3