mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
NetBSD build update. (#4079)
This commit is contained in:
parent
be1486568a
commit
739f9297c5
Notes:
git
2021-02-02 22:05:52 +09:00
Merged-By: nurse <naruse@airemix.jp>
1 changed files with 6 additions and 2 deletions
|
@ -2101,11 +2101,15 @@ fail:
|
|||
* and returns strlen(binary_filename).
|
||||
* it is NUL terminated.
|
||||
*/
|
||||
#if defined(__linux__)
|
||||
#if defined(__linux__) || defined(__NetBSD__)
|
||||
static ssize_t
|
||||
main_exe_path(void)
|
||||
{
|
||||
# define PROC_SELF_EXE "/proc/self/exe"
|
||||
# if defined(__linux__)
|
||||
# define PROC_SELF_EXE "/proc/self/exe"
|
||||
# elif defined(__NetBSD__)
|
||||
# define PROC_SELF_EXE "/proc/curproc/exe"
|
||||
# endif
|
||||
ssize_t len = readlink(PROC_SELF_EXE, binary_filename, PATH_MAX);
|
||||
if (len < 0) return 0;
|
||||
binary_filename[len] = 0;
|
||||
|
|
Loading…
Reference in a new issue