Click here to Skip to main content
15,883,901 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi!

I am already done with simple hello world system call in linux that is when called by user level test program, passes a string to the kernel and kernel returns that string...

But, now I want the kernel to count the string length. I don't have any idea how to do that?
Posted
Comments
Richard MacCutchan 28-Apr-15 16:56pm    
You need to find a kernel function that provides that feature. Are you sure you mean the kernel, and not the C/C++ library?
keyur_raval 28-Apr-15 16:58pm    
yes! I am sure about kernel, not the c/c++ library
keyur_raval 28-Apr-15 17:00pm    
Well, it says I need to Modify the "_syscallx" macros found in /usr/include/asm/unistd.h where "x" is the number of parameters to pass into the kernel.
Adn then Use the example "copy_from_user()" to fetch the string from user space into a local buffer.
Richard MacCutchan 28-Apr-15 17:14pm    
I've never tried that so cannot suggest anything.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900