Lines Matching refs:len
47 getcwd(char* buf, size_t len)
54 return SYSGETCWD(buf, len) < 0 ? 0 : buf;
63 if ((r = strlen(buf) + len + 1) != n && !(buf = newof(buf, char, r, 0)))
146 * return value is placed in buf of len chars
148 * len extra chars after the path name
153 getcwd(char* buf, size_t len)
186 if (buf && !len) ERROR(EINVAL);
194 if (len < namlen) ERROR(ERANGE);
196 else if (!(buf = newof(0, char, namlen, len))) ERROR(ENOMEM);
218 extra = len;
219 len = PATH_MAX;
220 if (!(buf = newof(0, char, len, extra))) ERROR(ENOMEM);
223 p = buf + len - 1;
233 if (!(dirstk = pushdir(dirstk, dots, p, buf + len - 1))) ERROR(ERANGE);
257 len = d - buf;
258 if (extra >= 0 && !(buf = newof(buf, char, len, extra))) ERROR(ENOMEM);
260 if (dirstk && popdir(dirstk, buf + len - 1))
292 if (namlen >= PATH_MAX || !(dirstk = pushdir(dirstk, dots + 3, p, buf + len - 1))) ERROR(ERANGE);
301 x = (buf + len - 1) - (p += namlen);
302 s = buf + len;
303 if (extra < 0 || !(buf = newof(buf, char, len += PATH_MAX, extra))) ERROR(ERANGE);
304 p = buf + len;
305 while (p > buf + len - 1 - x) *--p = *--s;
325 if (dirstk) popdir(dirstk, buf + len - 1);