Lines Matching refs:rpath
100 char *rpath, *dest, *extra_buf = NULL;
135 rpath = malloc (path_max);
136 if (rpath == NULL)
145 rpath = resolved;
146 rpath_limit = rpath + path_max;
150 if (!__getcwd (rpath, path_max))
152 rpath[0] = '\0';
155 dest = strchr (rpath, '\0');
159 rpath[0] = '/';
160 dest = rpath + 1;
186 if (dest > rpath + 1)
198 ptrdiff_t dest_offset = dest - rpath;
204 if (dest > rpath + 1)
209 new_size = rpath_limit - rpath;
214 new_rpath = (char *) realloc (rpath, new_size);
222 rpath = new_rpath;
223 rpath_limit = rpath + new_size;
225 dest = rpath + dest_offset;
237 if (__lxstat64 (_STAT_VER, rpath, &st) < 0)
239 if (lstat (rpath, &st) < 0)
263 n = __readlink (rpath, buf, path_max);
297 dest = rpath + 1; /* It's an absolute symlink */
300 if (dest > rpath + 1)
306 if (dest > rpath + 1 && dest[-1] == '/')
313 return resolved ? memcpy (resolved, rpath, dest - rpath + 1) : rpath;
321 strcpy (resolved, rpath);
323 free (rpath);