![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Linux RedHat, Ubuntu, SUSE, Fedora, Debian, Mandriva, Slackware, Gentoo linux, PCLinuxOS. All Linux questions here! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Heap fragementation on HPUX | atgoel | HP-UX | 1 | 06-30-2009 01:44 PM |
| Heap and stack | naan | High Level Programming | 5 | 04-30-2008 03:40 AM |
| AIX 5.3 Heap Memory with SAP | johnf | AIX | 3 | 10-23-2006 06:21 AM |
| heap size for JVM! | i2admin | Filesystems, Disks and Memory | 1 | 05-09-2002 10:09 AM |
| heap size! | i2admin | Filesystems, Disks and Memory | 2 | 05-08-2002 11:20 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
copy_from_user does not copy from process-heap
Hello all,
I need a positive reply from you. I want to copy the user-process-heap to the kernel space memory. For that, I wrote the following code but it does not copy. ---------------- code -------------- unsigned long length_of_heap_vma = < length of vma pointing to process-heap > ; void * kernel_mem = (void *) kmalloc(length_of_heap_vma,GFP_KERNEL); unsigned long bytes_not_copied = 0; bytes_not_copied = copy_from_user(kernel_mem,(void *)vm->vma_start,length_of_heap_vma);//vm points to process heap printk("failed to copy %ld bytes.",bytes_not_copied); //it always displays a non-zero value. ---------------- end of code -------- now the PROBLEM is that - the code successfuly compiles, but when I execute it, it copies not a single byte and bytes_not-copied always becomes equal to length_of_heap_vma. No compile-time or execution-time error occurs. (note: my process has the following dynamic memory in user-part: int * p = (int*) malloc(5 * sizeof(int)); for(i=0;i<5;i++) p[i]= i; ) |
![]() |
| Bookmarks |
| Tags |
| copy_from_user, fail, heap |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|