1 ?MAKE:d_procselfexe procselfexe: \
2 Oldconfig Setvar rm ls contains issymlink d_readlink
5 ?S: Defined if $procselfexe is symlink to the absolute
6 ?S: pathname of the executing program.
9 ?S: If d_procselfexe is defined, $procselfexe is the filename
10 ?S: of the symbolic link pointing to the absolute pathname of
11 ?S: the executing program.
14 ?C: This symbol is defined if PROCSELFEXE_PATH is a symlink
15 ?C: to the absolute pathname of the executing program.
18 ?C: If HAS_PROCSELFEXE is defined this symbol is the filename
19 ?C: of the symbolic link pointing to the absolute pathname of
20 ?C: the executing program.
22 ?H:#$d_procselfexe HAS_PROCSELFEXE /**/
23 ?H:?%<:#if defined(HAS_PROCSELFEXE) && !defined(PROCSELFEXE_PATH)
24 ?H:?%<:#define PROCSELFEXE_PATH $procselfexe /**/
28 ?LINT: set d_procselfexe
29 : Check if exe is symlink to abs path of executing program
35 : NetBSD first as /proc/self is a symlink to /proc/curproc, and it feels
36 : more tidy to avoid an extra level of symlink
37 set NetBSD /proc/curproc/exe Linux /proc/self/exe FreeBSD /proc/curproc/file Solaris /proc/self/path/a.out
38 while test $# -gt 0; do
41 if $issymlink $try; then
43 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
44 echo "You have $type-like $try."
45 procselfexe='"'$try'"'
47 : This will break out of the loop