android source build fails: undeclared identifier 'ftruncate'
I wanted to build the android source code by using this documentation: https://source.android.com/source/building-running.html
last step was: 'make -j16'
After a while the compilation is aborted with the following error message:
host C++: libart <= art/runtime/catch_block_stack_visitor.cc host C++: libart <= art/runtime/catch_finder.cc art/compiler/elf_stripper.cc:122:16: error: use of undeclared identifier 'ftruncate' int result = ftruncate(file->Fd(), offset); ^ 1 error generated. make: *** [out/host/linux-x86/obj/SHARED_LIBRARIES/libart-compiler_intermediates/elf_stripper.o] Fehler 1 make: *** Warte auf noch nicht beendete Prozesse...
I have no idea. Google did not help and I am really not into this topic, just wanted to do a little change to the android code (I have not changed anything yet).
My system is:
ubuntu 13.10 java 1.6.0_4 current android master branch
You could avoid this problem by adding
at the beginning of elf_stripper.cc