vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| I would like to find out if there is a mechanism that would allow a shared library to initialize itself upon loading (not upon first call to one of its ebtry points). Any advice or pointers would be greatly appreciated. Thx, dk |
| |||
| Dan Koren wrote: > I would like to find out if there is a > mechanism that would allow a shared > library to initialize itself upon > loading (not upon first call to > one of its ebtry points). > > Any advice or pointers would be > greatly appreciated. > You are after the initialization routine. See: http://docs.sun.com/app/docs/doc/817...chapter2-48195 --chris |
| |||
| "Chris Gerhard" <Chris.Gerhard@remove_this.sun.com> wrote in message news:ctqaov$p2q$1@new-usenet.uk.sun.com... > Dan Koren wrote: > > I would like to find out if there is a > > mechanism that would allow a shared > > library to initialize itself upon > > loading (not upon first call to > > one of its ebtry points). > > > Any advice or pointers would be > > greatly appreciated. > > You are after the initialization routine. See: > > http://docs.sun.com/app/docs/doc/817...chapter2-48195 > Thanks for the pointer. This does not seem to be what I'm looking for however. The examples on the page you pointed me to illustrate init and fini routines that are invoked as a result of running a program. What I'm looking for is a method of loading and initializing a shared library upon loading, regardless of any program being run that might use it (and not waiting for this to happen). Thx, dk |
| |||
| "Dan Koren" <dankoren@yahoo.com> wrote in message news:4200b449$1@news.meer.net... > "Chris Gerhard" <Chris.Gerhard@remove_this.sun.com> wrote in message > news:ctqaov$p2q$1@new-usenet.uk.sun.com... > > Dan Koren wrote: > > > I would like to find out if there is a > > > mechanism that would allow a shared > > > library to initialize itself upon > > > loading (not upon first call to > > > one of its ebtry points). > > > > > Any advice or pointers would be > > > greatly appreciated. > > > > You are after the initialization routine. See: > > > > http://docs.sun.com/app/docs/doc/817...chapter2-48195 > > > > > Thanks for the pointer. > > This does not seem to be what I'm looking for however. > > The examples on the page you pointed me to illustrate > init and fini routines that are invoked as a result of > running a program. What I'm looking for is a method of > loading and initializing a shared library upon loading, > regardless of any program being run that might use it > (and not waiting for this to happen). > I should have perhaps clarified that this would be used as a system wide library to be loaded shortly after boot. Think of it as a system wide LD_PRELOAD. Thx, dk |
| |||
| Dan Koren wrote: > "Dan Koren" <dankoren@yahoo.com> wrote in message > news:4200b449$1@news.meer.net... > > > I should have perhaps clarified that this would be used > as a system wide library to be loaded shortly after boot. > Think of it as a system wide LD_PRELOAD. > Libraries only get loaded by processes and not by the system. If the library needed some shared per system resource, like a shared memory segment, it would have to be loaded by a process that then creates the resource. That process could be started early in the boot via smf. --chris |
| |||
| "Chris Gerhard" <Chris.Gerhard@remove_this.sun.com> wrote in message news:ctqd3p$pq8$1@new-usenet.uk.sun.com... > Dan Koren wrote: > > "Dan Koren" <dankoren@yahoo.com> wrote in message > > news:4200b449$1@news.meer.net... > > > > > > I should have perhaps clarified that this would be used > > as a system wide library to be loaded shortly after boot. > > Think of it as a system wide LD_PRELOAD. > > Libraries only get loaded by processes and not by the system. > If the library needed some shared per system resource, like a > shared memory segment, it would have to be loaded by a process > that then creates the resource. That process could be started > early in the boot via smf. > Thanks for the clarification. Unfortunately, this is not what I am looking for. I need the ability to load a shared library *before* any user processes start running. I suppose I will have to write a driver to accomplish this. dk |
| |||
| "Dan Koren" <dankoren@yahoo.com> writes: >> http://docs.sun.com/app/docs/doc/817...chapter2-48195 >Thanks for the pointer. >This does not seem to be what I'm looking for however. It is. >The examples on the page you pointed me to illustrate >init and fini routines that are invoked as a result of >running a program. What I'm looking for is a method of >loading and initializing a shared library upon loading, >regardless of any program being run that might use it >(and not waiting for this to happen). Using init and fini routines inside a library will have the same effect; they are executed when the library is first loaded, just like the methods in the examples are executed when the program is loaded. Casper -- Expressed in this posting are my opinions. They are in no way related to opinions held by my employer, Sun Microsystems. Statements on Sun products included here are not gospel and may be fiction rather than truth. |
| |||
| "Dan Koren" <dankoren@yahoo.com> writes: >I should have perhaps clarified that this would be used >as a system wide library to be loaded shortly after boot. >Think of it as a system wide LD_PRELOAD. Libraries are loaded into progams; they are not loaded into the system; of course, if you do a system wide LD_PRELOAD, then that would mean that the library is loaded in all programs. The init methods will be executed immediately on loading. Casper -- Expressed in this posting are my opinions. They are in no way related to opinions held by my employer, Sun Microsystems. Statements on Sun products included here are not gospel and may be fiction rather than truth. |
| |||
| "Dan Koren" <dankoren@yahoo.com> writes: >Thanks for the clarification. Unfortunately, this is not what >I am looking for. I need the ability to load a shared library >*before* any user processes start running. You cannot load a shared library except in a process, so this makes no sense. >I suppose I will have to write a driver to accomplish this. Quite; what is it that you wish to accomplish with this shared library or driver? Casper -- Expressed in this posting are my opinions. They are in no way related to opinions held by my employer, Sun Microsystems. Statements on Sun products included here are not gospel and may be fiction rather than truth. |
| ||||
| "Casper H.S. Dik" <Casper.Dik@Sun.COM> wrote in message news:4200c27c$0$28983$e4fe514c@news.xs4all.nl... > "Dan Koren" <dankoren@yahoo.com> writes: > > >Thanks for the clarification. Unfortunately, this is not what > >I am looking for. I need the ability to load a shared library > >*before* any user processes start running. > > You cannot load a shared library except in a > process, so this makes no sense. Only if one follows the textbooks ;-) > > I suppose I will have to write a driver to > > accomplish this. > > Quite; what is it that you wish to accomplish > with this shared library or driver? The picture from 1,000,000 ft is simply that I need a library that performs some magic tricks to be present and active in every context before any user level process starts running, so it can intercept the loading of any text file in the system, and instrument it in a certain fashion. It would be a little complicated, and possibly inappropriate, to discuss the details in a public forum. If you are interested in the details of this project, I would be happy to elaborate in private e-mail. Many thanks for your (and everyone's) help. dk |