Provide page-aligned length to ftruncate. 36/10436/2
authorIgor Mikhailov (imichail) <[email protected]>
Mon, 5 Feb 2018 20:09:36 +0000 (12:09 -0800)
committerJohn Lo <[email protected]>
Thu, 8 Feb 2018 01:04:18 +0000 (01:04 +0000)
commit67d782514941a68ea47934379e2d96050c9b2001
tree164e0c72a979e9ec1124c9ed6872c649395d9dfb
parent0eacf49ffaaeb94f00aea71b8106aed80804d327
Provide page-aligned length to ftruncate.

For some files such as hugepages files, ftruncate() fails with the error
"Invalid argument" if the 'length' parameter is not on a page boundary.

Change-Id: I42a9cde98707da15e3c5d1653046e2277fc7a424
Signed-off-by: Igor Mikhailov (imichail) <[email protected]>
(cherry picked from commit 7d25415a9384d4c3d786d0c1ae5c0fcff3112acd)
src/vppinfra/linux/mem.c