Re: Windows and DLLs



On Sun, Oct 04, 1998 at 11:42:05AM -0700, David Jeske wrote:
> 
> On Sun, Oct 04, 1998 at 12:10:57PM +0200, Nils Philippsen wrote:
> > > We would be 'best off' if we could ask the system for the full path to
> > > the executable which was 'exec()ed' into our process.
> 
> I think this should be a Gnome API. We're not going to be changing
> POSIX. That way we can implement as best we can for each system, and
> if anyone puts it into their kernels, we can implement it with that.

After some poking around, I noticed that Linux (at least the 2.1.120
release) offers such a mechanism already if the /proc filesystem is
built into the kernel.

$ ls -l /proc/self/exe
lrwx------   1 kodis  kodis   0 Oct  4 19:13 /proc/self/exe-> /bin/ls*

... and of course there should be the argv[0] and $PATH fallbacks
provided for systems that don't offer this feature.

-- John Kodis.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]