ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
actually i want to call a function which is stored in my file.I want to call the function in the source code before some kernel function. So how should i do it...
i wrote some code in one file and in that file there is one function . i want to call that function in the kernel code. i called that function in main.c , in that start_kernel(). and during compilation it is not working .
so i wanted to ask can i directly call my own written function in kernel???
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789
Rep:
Quote:
Originally Posted by vishalbutte
i wrote some code in one file and in that file there is one function . i want to call that function in the kernel code. i called that function in main.c , in that start_kernel(). and during compilation it is not working .
so i wanted to ask can i directly call my own written function in kernel???
Please explain "it is not working".
Is there a compilation error ?
Is it crashing the kernel ?
Is it just not doing what expected ?
well function accesses one file which contains some information written using structure.
and i want to extract the same into similar but kernel data structure.
so i am calling that function into "start_kernel" fun. of main.c (in fs )as upto there root file sys gets mounted.
when i compiled the kernel it gave errors regardin the
#include<stdio.h> , #include<stdlib.h> .....no such file or directory..
FILE *fp..... fp undeclared like that............
well one question again..
in the same function we hav used "fopen" to open the file which contains
the information.
Is that correct?
If not then what should be used to open the file?
hope so this is sufficient..
thanks for all the replies.
and waiting for the remaining ..
SO if i cant use the library functuions then which functions i can use to access the files on hard disk ?
Or how can i access the RDBMS databases then ?
Where can i get info about these functions?
can u show me example or if it already used in kernel then
where it is used ?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.