Date: Tue, 22 Aug 2006 12:59:07 -0500 (CDT) From: Sergey Babkin <babkin@verizon.net> To: Lutz Boehne <lboehne@damogran.de>, freebsd-hackers@freebsd.org Subject: Re: Re: Aqcuiring full path to running process from outside the kernel Message-ID: <16315800.1957801156269547401.JavaMail.root@vms062.mailsrvcs.net>
next in thread | raw e-mail | index | archive | help
>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. -SB
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?16315800.1957801156269547401.JavaMail.root>