"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "fsremap/src/arch/mem_posix.cc" between
fstransform-0.9.3-src.tar.gz and fstransform-0.9.4.tar.gz

About: fstransform is a tool to change a file-system from one format to another, for example from jfs, xfs, or reiser to ext2, ext3, or ext4, in-place and without the need for backup.

mem_posix.cc  (fstransform-0.9.3-src):mem_posix.cc  (fstransform-0.9.4)
skipping to change at line 41 skipping to change at line 41
#endif #endif
#include "mem_posix.hh" #include "mem_posix.hh"
/** /**
* return RAM page size, or 0 if cannot be determined * return RAM page size, or 0 if cannot be determined
*/ */
ft_size ff_arch_posix_mem_page_size() { ft_size ff_arch_posix_mem_page_size() {
#if defined(_SC_PAGESIZE)
// first attempt: sysconf(_SC_PAGESIZE)
#if defined(FT_HAVE_SYSCONF) && defined(_SC_PAGESIZE)
long n = sysconf(_SC_PAGESIZE); long n = sysconf(_SC_PAGESIZE);
if (n > 0) if (n > 0 && n == (long)(ft_size) n)
return (ft_size) n; return (ft_size) n;
#endif #endif
// second attempt: getpagesize()
int n2 = getpagesize();
if (n2 > 0 && n2 == (int)(ft_size) n2)
return (ft_size) n2;
// third attempt: PAGE_SIZE and PAGESIZE
#if defined(PAGE_SIZE) #if defined(PAGE_SIZE)
return PAGE_SIZE; return PAGE_SIZE;
#elif defined(PAGESIZE) #elif defined(PAGESIZE)
return PAGESIZE; return PAGESIZE;
#else #else
return 0; return 0;
#endif #endif
} }
 End of changes. 3 change blocks. 
2 lines changed or deleted 13 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)