1e749abe9ab6dfaf9be17097f97080ee9c2f67c5dDan Albert/* 2e749abe9ab6dfaf9be17097f97080ee9c2f67c5dDan Albert * Copyright (C) 2016 The Android Open Source Project 3e749abe9ab6dfaf9be17097f97080ee9c2f67c5dDan Albert * All rights reserved. 4e749abe9ab6dfaf9be17097f97080ee9c2f67c5dDan Albert * 5e749abe9ab6dfaf9be17097f97080ee9c2f67c5dDan Albert * Redistribution and use in source and binary forms, with or without 6e749abe9ab6dfaf9be17097f97080ee9c2f67c5dDan Albert * modification, are permitted provided that the following conditions 7e749abe9ab6dfaf9be17097f97080ee9c2f67c5dDan Albert * are met: 8e749abe9ab6dfaf9be17097f97080ee9c2f67c5dDan Albert * * Redistributions of source code must retain the above copyright 9e749abe9ab6dfaf9be17097f97080ee9c2f67c5dDan Albert * notice, this list of conditions and the following disclaimer. 10e749abe9ab6dfaf9be17097f97080ee9c2f67c5dDan Albert * * Redistributions in binary form must reproduce the above copyright 11e749abe9ab6dfaf9be17097f97080ee9c2f67c5dDan Albert * notice, this list of conditions and the following disclaimer in 12e749abe9ab6dfaf9be17097f97080ee9c2f67c5dDan Albert * the documentation and/or other materials provided with the 13e749abe9ab6dfaf9be17097f97080ee9c2f67c5dDan Albert * distribution. 14e749abe9ab6dfaf9be17097f97080ee9c2f67c5dDan Albert * 15e749abe9ab6dfaf9be17097f97080ee9c2f67c5dDan Albert * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 16e749abe9ab6dfaf9be17097f97080ee9c2f67c5dDan Albert * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 17e749abe9ab6dfaf9be17097f97080ee9c2f67c5dDan Albert * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 18e749abe9ab6dfaf9be17097f97080ee9c2f67c5dDan Albert * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 19e749abe9ab6dfaf9be17097f97080ee9c2f67c5dDan Albert * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 20e749abe9ab6dfaf9be17097f97080ee9c2f67c5dDan Albert * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 21e749abe9ab6dfaf9be17097f97080ee9c2f67c5dDan Albert * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS 22e749abe9ab6dfaf9be17097f97080ee9c2f67c5dDan Albert * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 23e749abe9ab6dfaf9be17097f97080ee9c2f67c5dDan Albert * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 24e749abe9ab6dfaf9be17097f97080ee9c2f67c5dDan Albert * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 25e749abe9ab6dfaf9be17097f97080ee9c2f67c5dDan Albert * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26e749abe9ab6dfaf9be17097f97080ee9c2f67c5dDan Albert * SUCH DAMAGE. 27e749abe9ab6dfaf9be17097f97080ee9c2f67c5dDan Albert */ 28e749abe9ab6dfaf9be17097f97080ee9c2f67c5dDan Albert 29e749abe9ab6dfaf9be17097f97080ee9c2f67c5dDan Albert#ifndef _ANDROID_LEGACY_SYS_WAIT_INLINES_H_ 30e749abe9ab6dfaf9be17097f97080ee9c2f67c5dDan Albert#define _ANDROID_LEGACY_SYS_WAIT_INLINES_H_ 31e749abe9ab6dfaf9be17097f97080ee9c2f67c5dDan Albert 32e749abe9ab6dfaf9be17097f97080ee9c2f67c5dDan Albert#include <sys/cdefs.h> 33e749abe9ab6dfaf9be17097f97080ee9c2f67c5dDan Albert#include <sys/syscall.h> 34e749abe9ab6dfaf9be17097f97080ee9c2f67c5dDan Albert#include <sys/wait.h> 35e749abe9ab6dfaf9be17097f97080ee9c2f67c5dDan Albert#include <unistd.h> 36e749abe9ab6dfaf9be17097f97080ee9c2f67c5dDan Albert 375bc78c8bcd0c1e634c04029309ede3ec05f2d424Elliott Hughes#if __ANDROID_API__ < __ANDROID_API_J_MR2__ 38e749abe9ab6dfaf9be17097f97080ee9c2f67c5dDan Albert 39e749abe9ab6dfaf9be17097f97080ee9c2f67c5dDan Albert__BEGIN_DECLS 40e749abe9ab6dfaf9be17097f97080ee9c2f67c5dDan Albert 41e749abe9ab6dfaf9be17097f97080ee9c2f67c5dDan Albertstatic __inline pid_t wait4(pid_t pid, int* status, int options, struct rusage* rusage) { 42e749abe9ab6dfaf9be17097f97080ee9c2f67c5dDan Albert return __BIONIC_CAST(static_cast, pid_t, syscall(__NR_wait4, pid, status, options, rusage)); 43e749abe9ab6dfaf9be17097f97080ee9c2f67c5dDan Albert} 44e749abe9ab6dfaf9be17097f97080ee9c2f67c5dDan Albert 45e749abe9ab6dfaf9be17097f97080ee9c2f67c5dDan Albert__END_DECLS 46e749abe9ab6dfaf9be17097f97080ee9c2f67c5dDan Albert 475bc78c8bcd0c1e634c04029309ede3ec05f2d424Elliott Hughes#endif /* __ANDROID_API__ < __ANDROID_API_J_MR2__ */ 48e749abe9ab6dfaf9be17097f97080ee9c2f67c5dDan Albert 49e749abe9ab6dfaf9be17097f97080ee9c2f67c5dDan Albert#endif /* _ANDROID_LEGACY_SYS_WAIT_INLINES_H_ */ 50