From: kristof@sigsegv.be (Kristof Provost)
To: kernelnewbies@lists.kernelnewbies.org
Subject: How to use memcpy in kernel driver
Date: Mon, 27 Jan 2014 21:28:17 +0100 [thread overview]
Message-ID: <20140127202817.GJ20063@vega> (raw)
In-Reply-To: <CABMudhRdpu_Bgp1Ur3m_Ld7q9sOabgK3OpBwND4bymOg0iAYig@mail.gmail.com>
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
next prev parent reply other threads:[~2014-01-27 20:28 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-27 19:53 How to use memcpy in kernel driver m silverstri
2014-01-27 20:28 ` Valdis.Kletnieks at vt.edu
2014-01-27 20:28 ` Kristof Provost [this message]
2014-01-27 20:28 ` Augusto Mecking Caringi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140127202817.GJ20063@vega \
--to=kristof@sigsegv.be \
--cc=kernelnewbies@lists.kernelnewbies.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.