[Bug 248184] readlink("/proc/curproc/file") returns arbitrary correct name for programs with more than one link (name)

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Thu Jul 23 14:57:05 UTC 2020


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=248184

Ed Maste <emaste at freebsd.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |emaste at freebsd.org

--- Comment #3 from Ed Maste <emaste at freebsd.org> ---
>From the man page:

    #include <stdlib.h>
    const char *getexecname(void);

    ...

    If successful, getexecname() returns a pointer to the executables pathname;
otherwise, it returns 0.

    ...

    The getexecname() function obtains the executable pathname from the
AT_SUN_EXECNAME aux vector. These vectors are made available to dynamically
linked processes only.

It seems like we could also add getexecname as a slightly more convenient
interface than elf_aux_info.

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-bugs mailing list