The HyperNews Linux KHG Discussion Pages

News: Fixed.... strncpy to blame

Forum: The Linux Kernel Hackers' Guide
Re: Question Remapping Memory Buffer using vmalloc/vma_nopage (Brian W. Taylor)
Keywords: mmap, vmalloc, DMA, and Interrupts
Date: Thu, 11 Jun 1998 20:42:17 GMT
From: Brian W. Taylor <>

Hello All,

Well, I was able to solve the problem by setting a loop to transfer the data byte by byte. I had been using "strncpy(map_buffer, dma_buffer, dma_count)" to transfer the data.

   Now why?

Why was this a problem and why did it behave so strangly? When the data was fairly uniform there were no problems. But, when the was a discouniuity in the date the transfer would latch the rest of the dma transfer data to 0?? Very Odd.

strncpy is defined in the kernel and should be usable with vmalloc if anything else.....

Any Ideas??? I would really like to understand the mechanism inside the kernel that caused this problem.