Results 1 to 5 of 5
So, atoi is not in the kernel.
Is there a workaround?...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 03-16-2010 #1Just Joined!
- Join Date
- Jan 2010
- Location
- The Sillicon Valley, California
- Posts
- 28
how is atoi() done in the kernel?
So, atoi is not in the kernel.
Is there a workaround?
- 03-17-2010 #2
not in the kernel?
are you trying to use this in a C program? If you are, the kernel is not responsible for supplying libraries for non kernel apps. you need to inclue the cstdlib.h header file.
cstdlib (stdlib.h) - C++ Reference
it is a C++ site, but it includes the legacy library references. you need to include the cstdlin.h header into your source file, and then you can use atoi() in your program.New to the internet, technical forums, or the hacker / open source community??
Read this to learn good posting habits http://www.catb.org/~esr/faqs/smart-questions.html
RHCE for RHEL version 5
RHCT for RHEL version 4
- 03-17-2010 #3
i'm guessing the OP is trying to write a kernel code, and needs the functionality of atoi. Probably you can't include stdlib.h in a kernel module, thus the problem.
- 03-20-2010 #4Linux Guru
- Join Date
- Apr 2009
- Location
- I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
- Posts
- 10,236
There is a function simple_strtol() defined in kernel.h which you can use in place of atoi().
Sometimes, real fast is almost as good as real time.
Just remember, Semper Gumbi - always be flexible!
- 03-22-2010 #5Just Joined!
- Join Date
- Jul 2009
- Posts
- 49
kernel API...
To those new people trying to find their way through the Kernel API....
If you have a look at the README file in the top directory of the Linux kernel source, you will find a reference to "DOCUMENTATION". It refers you to the directory under that current directory of "Documentation/DocBook". In that directory are instructions of how to generate the html or PDF files that describe the Kernel API which also lists the "simple_strtoll()" function along with many other useful functions. If you are writing a kernel module, you should really become acquainted with the kernel API. I derive a lot of amusement reviewing someones code after they have written a bunch of linked list functions AGAIN!!
Cheers!!



