librb: support rb_path_to_self on FreeBSD 4.8
This commit is contained in:
parent
d2a4981ab2
commit
87f7632760
1 changed files with 3 additions and 1 deletions
|
@ -171,7 +171,7 @@ rb_path_to_self(void)
|
|||
return NULL;
|
||||
realpath(s, path_buf);
|
||||
return path_buf;
|
||||
#elif defined(__linux__)
|
||||
#elif defined(__linux__) || (defined(__FreeBSD__) && !defined(KERN_PROC_PATHNAME))
|
||||
if (readlink("/proc/self/exe", path_buf, path_len) != -1)
|
||||
return path_buf;
|
||||
return NULL;
|
||||
|
@ -196,6 +196,8 @@ rb_path_to_self(void)
|
|||
|
||||
realpath(tmp_path, path_buf);
|
||||
return path_buf;
|
||||
#else
|
||||
return NULL;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue