Hi, How can I use memcoyp in memcpy? I try #include stdio.h and string.h, but .h fails to include during compilation. Can you please help me? Thank you.
On Mon, 27 Jan 2014 11:53:00 -0800, m silverstri said:
I try #include stdio.h
Can you please help me?
stdio is a libc invention, only used in userspace. As such, you can't call anything in a shared library from within kernel code (although there are similarly named routines for many things).
On 2014-01-27 11:53:00 (-0800), m silverstri <michael.j.silverstri@gmail.com> wrote:
How can I use memcoyp in memcpy? I try #include stdio.h and string.h, but .h fails to include during compilation.
That's because stdio.h is a C library header. You can't use the C library in the kernel. You should actually be able to include string.h, but you need the kernel version, which lives in include/linux/string.h. The kernel provides a few of the functions usually provided by the C library. Things like memcpy() and memset() exist. printf() doesn't, but there is an sprintf(), ... Kristof
On Mon, Jan 27, 2014 at 5:53 PM, m silverstri < michael.j.silverstri@gmail.com> wrote:
How can I use memcoyp in memcpy? I try #include stdio.h and string.h, but .h fails to include during compilation.
Hi, stdio.h and string.h are glibc header files (userspace)... Kernelspace is another thing. Try to include "linux/string.h" -- Augusto Mecking Caringi
participants (4)
-
Augusto Mecking Caringi -
Kristof Provost -
m silverstri -
Valdis.Kletnieks@vt.edu