From mboxrd@z Thu Jan 1 00:00:00 1970 From: kristof@sigsegv.be (Kristof Provost) Date: Mon, 27 Jan 2014 21:28:17 +0100 Subject: How to use memcpy in kernel driver In-Reply-To: References: Message-ID: <20140127202817.GJ20063@vega> To: kernelnewbies@lists.kernelnewbies.org List-Id: kernelnewbies.lists.kernelnewbies.org On 2014-01-27 11:53:00 (-0800), m silverstri 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