Lines Matching defs:??

1 /*      $NetBSD: h_cwd.c,v 1.3 2012/04/17 09:23:21 jruoho Exp $	*/
7 * Redistribution and use in source and binary forms, with or without
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
16 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND
17 * CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
18 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
20 * IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS BE LIABLE FOR ANY
21 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
23 * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
25 * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
26 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
27 * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
50 if (prefix[prefixlen-1] != '/')
61 if (chdir(path) == -1)
68 int fd;
70 fd = open(path, O_RDONLY);
71 if (fd == -1)
73 if (fchdir(fd) == -1)
75 close(fd);
84 if (getcwd(pwd, sizeof(pwd)) == NULL)
86 if (strcmp(pwd, prefix) != 0)
89 if (mkdir("dir", 0777) == -1)
92 if (getcwd(pwd, sizeof(pwd)) == NULL)
94 if (strcmp(pwd, makepath("dir")) != 0)
97 if (mkdir("dir", 0777) == -1)
100 if (getcwd(pwd, sizeof(pwd)) == NULL)
102 if (strcmp(pwd, makepath("dir/dir")) != 0)
106 if (getcwd(pwd, sizeof(pwd)) == NULL)
108 if (strcmp(pwd, makepath("dir")) != 0)
113 if (getcwd(pwd, sizeof(pwd)) == NULL)
115 if (strcmp(pwd, prefix) != 0)
119 if (getcwd(pwd, sizeof(pwd)) == NULL)
121 if (strcmp(pwd, "/") != 0)
130 if (mkdir("adir", 0777) == -1)
132 if (mkdir("anotherdir", 0777) == -1)
135 if (symlink("/adir", "anotherdir/lincthesink") == -1)
139 if (getcwd(pwd, sizeof(pwd)) == NULL)
141 if (strcmp(pwd, makepath("adir")) != 0)
149 if (argc != 4)
155 if (strcmp(argv[3], "chdir") == 0)
157 else if (strcmp(argv[3], "fchdir") == 0)
162 if (strcmp(argv[2], "simple") == 0)
164 if (strcmp(argv[2], "symlink") == 0)