2012-04-27

Linux C: page aligned buffer


I had to allocate a page-aligned buffer.



Alignment

char buf[1024] __attribute__ ((aligned (8)));

Unfortunately it is unusable for page alignment, because we haven't any PAGE_SIZE macro in user space.

Getting page size



Page align



References:
http://froebe.net/blog/2007/05/10/linux-o_directio-what-am-i-doing-wrong/

1 comments:

mohit sona said...

It is nice blog Thank you provide important information and i am searching for same information to save my time Big data hadoop online Training
ivanka trump hot pictures

Post a Comment

 
Design by Free WordPress Themes | Bloggerized by Lasantha - Premium Blogger Themes | Top WordPress Themes