From owner-freebsd-hackers@FreeBSD.ORG Tue Aug 22 17:59:26 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 354F416A4DE for ; Tue, 22 Aug 2006 17:59:26 +0000 (UTC) (envelope-from babkin@verizon.net) Received: from vms048pub.verizon.net (vms048pub.verizon.net [206.46.252.48]) by mx1.FreeBSD.org (Postfix) with ESMTP id AEB2843D4C for ; Tue, 22 Aug 2006 17:59:25 +0000 (GMT) (envelope-from babkin@verizon.net) Received: from vms062.mailsrvcs.net ([192.168.1.3]) by vms048.mailsrvcs.net (Sun Java System Messaging Server 6.2-4.02 (built Sep 9 2005)) with ESMTPA id <0J4E00GEAVAJMUV4@vms048.mailsrvcs.net> for freebsd-hackers@freebsd.org; Tue, 22 Aug 2006 12:59:07 -0500 (CDT) Received: from 198.190.8.100 ([198.190.8.100]) by vms062.mailsrvcs.net (Verizon Webmail) with HTTP; Tue, 22 Aug 2006 12:59:07 -0500 (CDT) Date: Tue, 22 Aug 2006 12:59:07 -0500 (CDT) From: Sergey Babkin X-Originating-IP: [198.190.8.100] To: Lutz Boehne , freebsd-hackers@freebsd.org Message-id: <16315800.1957801156269547401.JavaMail.root@vms062.mailsrvcs.net> MIME-version: 1.0 Content-type: text/plain; charset=ISO-8859-1 Content-transfer-encoding: 7bit X-Mailman-Approved-At: Tue, 22 Aug 2006 18:16:15 +0000 Cc: Subject: Re: Re: Aqcuiring full path to running process from outside the kernel X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: babkin@users.sf.net List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Aug 2006 17:59:26 -0000 >From: Lutz Boehne > >> 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