Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.1 6/24/83; site umcp-cs.UUCP
Path: utzoo!watmath!clyde!burl!ulysses!allegra!bellcore!decvax!wivax!ucadmus!harvard!seismo!umcp-cs!chris
From: chris@umcp-cs.UUCP
Newsgroups: net.unix-wizards
Subject: Re: Shared Code under UNIX System V
Message-ID: <1958@umcp-cs.UUCP>
Date: Mon, 17-Dec-84 07:52:41 EST
Article-I.D.: umcp-cs.1958
Posted: Mon Dec 17 07:52:41 1984
Date-Received: Thu, 20-Dec-84 01:54:17 EST
References: <140@chemabs> <1768@wateng.UUCP>
Organization: U of Maryland, Computer Science Dept., College Park, MD
Lines: 32

> I sure wish that there was a system call that would return the full
> path name of the text file of a process.  Perhaps there is?  Any
> kobolds know of any?

Well, I'm no kobold (more of a Sindarin Elf myself) but in the 8th
Edition system, with /proc, you can always use this:

	#include 

	int
	gettextfd() {
		char buf[12];
		int fd, tfd;
		char *sprintf();

		(void) sprintf(buf, "/proc/%05d", getpid ());
		if ((fd = open(buf, 0)) < 0)
			return (-1);
		tfd = ioctl(fd, PIOCOPENT, 0);	/* is this right? seems
						   like it would be more
						   reasonable to use &tfd */
		(void) close(fd);
		return (tfd);
	}

Thinking about writing /proc for 4.2BSD,
-- 
(This line accidently left nonblank.)

In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (301) 454-7690
UUCP:	{seismo,allegra,brl-bmd}!umcp-cs!chris
CSNet:	chris@umcp-cs		ARPA:	chris@maryland