Date: Tue, 22 Aug 2006 17:09:37 -0600 (MDT) From: "M. Warner Losh" <imp@bsdimp.com> To: babkin@users.sourceforge.net, babkin@verizon.net Cc: freebsd-hackers@freebsd.org, lboehne@damogran.de Subject: Re: Aqcuiring full path to running process from outside the kernel Message-ID: <20060822.170937.1661909005.imp@bsdimp.com> In-Reply-To: <16315800.1957801156269547401.JavaMail.root@vms062.mailsrvcs.net> References: <16315800.1957801156269547401.JavaMail.root@vms062.mailsrvcs.net>
next in thread | previous in thread | raw e-mail | index | archive | help
In message: <16315800.1957801156269547401.JavaMail.root@vms062.mailsrvcs.net> Sergey Babkin <babkin@verizon.net> writes: : >From: Lutz Boehne <lboehne@damogran.de> : > : >> but argv[0] is either an absolute path or a path relative to pwd, : >> unless your shell is broken. : > : >One should also consider users breaking argv[0] intentionally, e.g. : >pointing it to other files which could lead to undesired/unpredictable : >behaviour. Even as a fallback it's probably not wise to trust it. : : If we get back to the question of why we need the file, : we might not need it at all. As far as I understand, : the problem is that the Watcom compiler works by : sticking a set of messages into the executable files : and then later reading them out of the file, and the : point is to adapt the compiler to work on FreeBSD. : : So why not just change the compiler to put the contents of : this file into a DATA section, at some special symbol. : (I presume that now it puts the messages into some : kind of a COMMENT section). : Then instead of reading the file manually you would have : the contents of the file already pre-mapped into the memory : for you when the program starts. Saves you lots of trouble. And is the main reason that DOS programs, back in the days that watcom was written, did this editing technique... Warner
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060822.170937.1661909005.imp>