CONTENTS
#include <ShoreApp.h>
shrc Shore::getcwd(char *buf, int bufsize);
Getcwd
writes the path name of the current process' working directory
into the buffer given by
buf.
At most
bufsize
characters are copied. The resulting string is null-terminated only if the
length of the returned string is less than that of the buffer.
Shore applications have two working directories: the Unix directory and the
Shore directory. This function returns the latter. The former can be
retrieved with
getcwd(3).
Note also that some Unix versions will allocate a buffer if the
buf
parameter is 0. This method does not allocate a buffer.
The current working directory of a process can be changed with chdir(oc)
(to change the Shore working directory) or chdir(2) (to change the Unix
working directory).
Getcwd
is implemented by tracing a path from the current directory back to the
root of the Shore file system.
In the Shore, this operation acquires
short-term SH-mode (share-mode) locks on each directory on this
path.
This manual page applies to Version 1.1.1 of the Shore software.
The Shore project is sponsored by the Advanced Research Project Agency, ARPA
order number 018 (formerly 8230), monitored by the U.S. Army Research
Laboratory under contract DAAB07-91-C-Q518.
Copyright © 1994, 1995, 1996, 1997,
Computer Sciences Department, University of
Wisconsin -- Madison. All Rights Reserved.
chdir(oc),
chdir(2),
and
getcwd(3).