Lines Matching refs:rpath
104 char *rpath, *dest, *extra_buf = NULL;
139 rpath = malloc (path_max);
140 if (rpath == NULL)
144 rpath = resolved;
145 rpath_limit = rpath + path_max;
149 if (!__getcwd (rpath, path_max))
151 rpath[0] = '\0';
154 dest = strchr (rpath, '\0');
158 rpath[0] = '/';
159 dest = rpath + 1;
185 if (dest > rpath + 1)
197 ptrdiff_t dest_offset = dest - rpath;
203 if (dest > rpath + 1)
208 new_size = rpath_limit - rpath;
213 new_rpath = (char *) realloc (rpath, new_size);
216 rpath = new_rpath;
217 rpath_limit = rpath + new_size;
219 dest = rpath + dest_offset;
231 if (__lxstat64 (_STAT_VER, rpath, &st) < 0)
233 if (lstat (rpath, &st) < 0)
257 n = __readlink (rpath, buf, path_max);
291 dest = rpath + 1; /* It's an absolute symlink */
294 if (dest > rpath + 1)
300 if (dest > rpath + 1 && dest[-1] == '/')
307 return resolved ? memcpy (resolved, rpath, dest - rpath + 1) : rpath;
315 strcpy (resolved, rpath);
317 free (rpath);