Expose wait4 as wait4 rather than __wait4.

This helps strace(1) compile with one fewer hack.

Change-Id: I5296d0cfec5546709cda990abd705ad33d7c4626
diff --git a/libc/bionic/wait.c b/libc/bionic/wait.cpp
similarity index 65%
rename from libc/bionic/wait.c
rename to libc/bionic/wait.cpp
index f1db086..7dbcec2 100644
--- a/libc/bionic/wait.c
+++ b/libc/bionic/wait.cpp
@@ -25,29 +25,30 @@
  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  */
+
 #include <sys/wait.h>
 #include <stddef.h>
 
-extern pid_t  __wait4 (pid_t pid, int *status, int options, struct rusage *rusage);
-extern int    __waitid(idtype_t which, id_t id, siginfo_t *info, int options, struct rusage *ru);
+extern "C" int __waitid(idtype_t which, id_t id, siginfo_t* info, int options, struct rusage* ru);
 
-pid_t  wait( int*  status )
-{
-    return __wait4( (pid_t)-1, status, 0, NULL );
+pid_t wait(int* status) {
+  return wait4(-1, status, 0, NULL);
 }
 
-pid_t  wait3(int*  status, int options, struct rusage*  rusage)
-{
-    return __wait4( (pid_t)-1, status, options, rusage );
+pid_t wait3(int* status, int options, struct rusage* rusage) {
+  return wait4(-1, status, options, rusage);
 }
 
-pid_t  waitpid(pid_t  pid, int*  status, int  options)
-{
-    return __wait4( pid, status, options, NULL );
+pid_t waitpid(pid_t pid, int* status, int options) {
+  return wait4(pid, status, options, NULL);
 }
 
-int  waitid(idtype_t which, id_t id, siginfo_t *info, int options)
-{
-    /* the system call takes an option struct rusage that we don't need */
-    return __waitid(which, id, info, options, NULL);
+int waitid(idtype_t which, id_t id, siginfo_t* info, int options) {
+  /* the system call takes an option struct rusage that we don't need */
+  return __waitid(which, id, info, options, NULL);
+}
+
+// TODO: remove this backward compatibility hack (for jb-mr1 strace binaries).
+extern "C" pid_t __wait4(pid_t pid, int* status, int options, struct rusage* rusage) {
+  return wait4(pid, status, options, rusage);
 }