Hi, everyone Is memcpy a system call? Thanks in advnace, Best Regards, J.Hwna Kim
Is memcpy a system call?
Thanks in advnace,
memcpy is *not* a system call. It is a standard C library function. System calls are those where you enter the kernel mode and ask your OS to do something for you (like read/write from disk). For memory copy you don't need to take the service of OS.
Hi Memcpy is both- a system call as well as a user library function. Implementation differs Regards Siddharth On Jun 8, 2012 8:42 PM, "J.Hwan Kim" <frog1120@gmail.com> wrote:
Hi, everyone
Is memcpy a system call?
Thanks in advnace,
Best Regards, J.Hwna Kim
_______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Hi! On Fre, 2012-06-08 at 20:51 +0530, siddharth saxena wrote: [...]
Memcpy is both- a system call as well as a user library function. Implementation differs
What makes you believe this? Bernd -- Bernd Petrovitsch Email : bernd@petrovitsch.priv.at LUGA : http://www.luga.at
On Sat, Jun 09, 2012 at 12:11:36AM +0900, J.Hwan Kim wrote:
Hi, everyone
Is memcpy a system call?
Thanks in advnace,
Best Regards, J.Hwna Kim
"strace" is a good tool to find out which system calls a program is doing. To answer your question, I don't think it makes much sense to implement memcpy as a syscall, because entering kernel mode is usually relatively expensive and I can't think of any kernel mode-only memcpy optimizations (and optimizations are the only reason to do a user space memcpy in kernel space I can think of). HTH, Jonathan Neuschäfer
On Fri, Jun 8, 2012 at 12:11 PM, J.Hwan Kim <frog1120@gmail.com> wrote:
Hi, everyone
Is memcpy a system call?
"Use the force, read the source" uclibc: http://git.uclibc.org/uClibc/tree/libc/string/generic/memcpy.c glibc: http://sourceware.org/git/?p=glibc.git;a=blob;f=string/memcpy.c;h=e167e85d7b... Which means: No, memcpy (meaning the userspace function that gets included by "string.h") is *not* a system call. Hope this helps, Ezequiel.
participants (6)
-
Bernd Petrovitsch -
Ezequiel Garcia -
J.Hwan Kim -
Jonathan Neuschäfer -
rahul dev -
siddharth saxena