After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 172268 - Binary relocatability API for glib
Binary relocatability API for glib
Status: RESOLVED OBSOLETE
Product: glib
Classification: Platform
Component: general
unspecified
Other Linux
: Normal enhancement
: ---
Assigned To: gtkdev
gtkdev
Depends on: 615903
Blocks:
 
 
Reported: 2005-03-31 15:32 UTC by Mike Hearn
Modified: 2018-05-24 10:35 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Mike Hearn 2005-03-31 15:32:00 UTC
It'd be nice to have a GetModuleFileName style API in glib that abstracts the
different ways a program can locate its own absolute path at runtime.

On Windows you can use GetModuleFileName to locate the absolute path of the
current process. On Linux reading /proc/self/exe does the same thing. I do not
know what the equivalent is on other UNIX systems.

One thing I'm not sure about is whether to support libraries or not. Windows and
Linux let you determine the absolute path of a library by passing in a pointer
to somewhere inside the image, for instance the address of an empty string.
Again I am not sure how portable that is outside these two platforms.

I hope to write a patch for this in the next few months.
Comment 1 Matthias Clasen 2005-04-01 20:19:01 UTC
I'm pretty sure this is a duplicate of some other bug, but I can't find it right
now.
Comment 2 Bastien Nocera 2005-06-30 16:12:09 UTC
Looks like there's already an API for the similar
g_win32_get_package_installation_directory().
Comment 3 probono 2005-09-24 15:55:36 UTC
Maybe http://autopackage.org/docs/binreloc/ can help. 
Comment 4 Matthias Clasen 2006-01-05 20:55:14 UTC
Doesn't look like it is going to happen for 2.10
Comment 5 Matteo Settenvini 2006-07-05 17:02:40 UTC
I'm developing some projects that should be portable also to systems other than *nix, and I stumbled upon BinReloc as well as a solution to binary relocatability.

Since it has a GLib-style interface, how about adding its API directly to GLib? It would make life a bit easier to us developers, rather than using yet another external tool for this task.

KDE guys have already integrated something like that in their libraries. Probably GNOME could benefit too. What about landing them in GLib 2.13.x, for a 2.14 release?
Comment 6 GNOME Infrastructure Team 2018-05-24 10:35:24 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/glib/issues/31.