LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 02-08-2011, 07:42 PM   #1
yaplej
Member
 
Registered: Apr 2009
Distribution: CentOS, Ubuntu, openSuSE
Posts: 165
Blog Entries: 1

Rep: Reputation: 22
Possible to make a application module similar to LKM?


Hey everyone,

Is it possible to create a loadable module for a C app that could be loaded into the app in runtime from a CLI or web interface?

I would like the code to handle a particular type of structure to be "swappable" for lack of a better term. This would allow different modules to be used based on the users wants without having to mess with code. A different module could be downloaded into the application directory then loaded. Basicaly the code would be handed a pointer process it then return it.

Thanks.
 
Old 02-08-2011, 09:58 PM   #2
Nominal Animal
Senior Member
 
Registered: Dec 2010
Location: Finland
Distribution: Xubuntu, CentOS, LFS
Posts: 1,723
Blog Entries: 3

Rep: Reputation: 948Reputation: 948Reputation: 948Reputation: 948Reputation: 948Reputation: 948Reputation: 948Reputation: 948
Of course. It is called dynamic linking.

See the dlopen man page for details. It even has an example program. In your case, you won't load libm.so, but your own module. The modules you compile of course as dynamically loadable libraries.

Hope this helps,
Nominal Animal

Last edited by Nominal Animal; 03-21-2011 at 07:09 AM.
 
Old 03-19-2011, 11:06 PM   #3
yaplej
Member
 
Registered: Apr 2009
Distribution: CentOS, Ubuntu, openSuSE
Posts: 165

Original Poster
Blog Entries: 1

Rep: Reputation: 22
Thank you. That is exactly what I was looking for. I thought I had already posted my thanks but I must have spaced it somehow. Thanks again.

Last edited by yaplej; 03-19-2011 at 11:07 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Any application similar to obexclient? vibinlakshman Linux - Software 1 12-14-2008 04:35 PM
Turbonote on linux or a similar application PsYlTrance Linux - Software 4 09-15-2008 12:36 AM
I want add my own system call using LKM (loadable kernel module)... raga4223688 Linux - Software 1 03-07-2007 07:21 AM
Application similar to aptitude for urpmi? skibud2 Mandriva 4 12-26-2006 03:59 PM
which linux application ist most similar to adobe Illustrator? Patrique Linux - Software 4 07-21-2004 02:16 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 06:27 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration