Have ReExec read environment from /proc/self/environ
authorPeter Collingbourne <peter@pcc.me.uk>
Thu, 17 Jan 2013 19:50:42 +0000 (19:50 +0000)
committerPeter Collingbourne <peter@pcc.me.uk>
Thu, 17 Jan 2013 19:50:42 +0000 (19:50 +0000)
commit6600516a58947a8be49ba8c8be178ab48924516b
treefc8aa68dac2c2d85bf5e2bb452e4f9026883e174
parent94b8cdbf5512ab4ffac0dc09f58ea70c87797546
Have ReExec read environment from /proc/self/environ

It is possible for ReExec to be called before the C standard library
has initialised itself sufficiently for execv to work properly.
Fix this by parsing the environment ourselves and using execve.

Differential Revision: http://llvm-reviews.chandlerc.com/D304

llvm-svn: 172748
compiler-rt/lib/sanitizer_common/sanitizer_linux.cc