21,584
社区成员




#include <asm/uaccess.h>
菜鸟问题:隐式声明函数 copy_to_user。大家帮忙啊
//源码:linux/arch/i386/lib/usercopy.c
copy_to_user: - Copy a block of data into user space.
@to: Destination address, in user space.
@from: Source address, in kernel space.
@n: Number of bytes to copy.
849unsigned long copy_to_user(void __user *to, const void *from, unsigned long n)
850{
851 if (access_ok(VERIFY_WRITE, to, n))
852 n = __copy_to_user(to, from, n);
853 return n;
854}
copy_from_user: - Copy a block of data from user space.
@to: Destination address, in kernel space.
@from: Source address, in user space.
@n: Number of bytes to copy.
874unsigned long copy_from_user(void *to, const void __user *from, unsigned long n)
875{
876 if (access_ok(VERIFY_READ, from, n))
877 n = __copy_from_user(to, from, n);
878 else
879 memset(to, 0, n);
880 return n;
881}