From owner-freebsd-questions Thu Nov 18 14:43: 8 1999 Delivered-To: freebsd-questions@freebsd.org Received: from fw.wintelcom.net (ns1.wintelcom.net [209.1.153.20]) by hub.freebsd.org (Postfix) with ESMTP id 8585015440 for ; Thu, 18 Nov 1999 14:43:06 -0800 (PST) (envelope-from bright@wintelcom.net) Received: from localhost (bright@localhost) by fw.wintelcom.net (8.9.3/8.9.3) with ESMTP id PAA26063; Thu, 18 Nov 1999 15:09:19 -0800 (PST) Date: Thu, 18 Nov 1999 15:09:19 -0800 (PST) From: Alfred Perlstein To: "Oleg V. Volkov" Cc: freebsd-questions@freebsd.org Subject: Re: Is there correct way for program to read from itself? In-Reply-To: <19991119013456.A63985@fly.lglobus.ru> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Fri, 19 Nov 1999, Oleg V. Volkov wrote: > On Thu, Nov 18, 1999 at 02:54:21PM -0800, Alfred Perlstein wrote: > > I think procfs would be even more helpful (unless the 'file' is still > > done, or is it?) You guys should have gotten my profs suggestion > > but someone obviously dropped cc lines. *sigh* > > > > And Greg is definetly right, you should be able to look around to > > solve this problem, if the problem is then PATH, then searching > > the path is what you need to do, but I still think procfs offers > > what you need. > > > > man 5 procfs. > > Look a this dump: > 481 ktrace RET ktrace 0 > 481 ktrace CALL execve(0xbfbfdc9f,0xbfbfdbc4,0xbfbfdbcc) > 481 ktrace NAMI "./hellow" > 481 hellow RET execve 0 > 481 hellow CALL getpid > 481 hellow RET getpid 481/0x1e1 > 481 hellow CALL open(0xbfbfdb64,0,0) > 481 hellow NAMI "/compat/linux/proc/481/exe" > 481 hellow NAMI "/proc/481/exe" > 481 hellow RET open JUSTRETURN > 481 hellow CALL old.lseek(0xfffffffe,0x688,0) > 481 hellow RET old.lseek -1 errno -9 Unknown error: -9 > 481 hellow CALL exit(0x7f) > > I just don't know why lseek fails. I don't know either, perhaps the source to this errant program would be helpful? This looks like a Linux program, just what are you trying to by opening 'exe'? You obviously didn't read the procfs manpage, please do read it and then follow up. And please stop dropping cc lines on these emails! other people trying to help you more than likely won't see these postings and just repeat the same steps I'm trying to get you to follow. thank you, -Alfred To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message