| 1 | |
| 2 | |
| 3 | |
| 4 | get_realpath( const char * rpath ) |
| 5 | { |
| 6 | // uses c-library to get the absolute path |
| 7 | -#ifdef __GLIBC__ |
| 8 | - // in case of GLIBC the task is easy. |
| 9 | return realpath( rpath, NULL ); |
| 10 | -#else |
| 11 | -# warning having to use old style realpath() |
| 12 | - // otherwise less so and requires PATH_MAX limit |
| 13 | - char buf[ PATH_MAX] ; |
| 14 | - char *asw = realpath( rpath, buf ); |
| 15 | - if( !asw ) |
| 16 | - { return NULL; } |
| 17 | - |
| 18 | - return s_strdup( asw ); |
| 19 | -#endif |
| 20 | } |
| 21 | |
| 22 |