xref: /aosp_15_r20/external/mesa3d/src/util/u_process.h (revision 6104692788411f58d303aa86923a9ff6ecaded22)
1*61046927SAndroid Build Coastguard Worker /*
2*61046927SAndroid Build Coastguard Worker  * Copyright © 2003 Felix Kuehling
3*61046927SAndroid Build Coastguard Worker  * Copyright © 2018 Advanced Micro Devices, Inc.
4*61046927SAndroid Build Coastguard Worker  * All Rights Reserved.
5*61046927SAndroid Build Coastguard Worker  *
6*61046927SAndroid Build Coastguard Worker  * Permission is hereby granted, free of charge, to any person obtaining
7*61046927SAndroid Build Coastguard Worker  * a copy of this software and associated documentation files (the
8*61046927SAndroid Build Coastguard Worker  * "Software"), to deal in the Software without restriction, including
9*61046927SAndroid Build Coastguard Worker  * without limitation the rights to use, copy, modify, merge, publish,
10*61046927SAndroid Build Coastguard Worker  * distribute, sub license, and/or sell copies of the Software, and to
11*61046927SAndroid Build Coastguard Worker  * permit persons to whom the Software is furnished to do so, subject to
12*61046927SAndroid Build Coastguard Worker  * the following conditions:
13*61046927SAndroid Build Coastguard Worker  *
14*61046927SAndroid Build Coastguard Worker  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15*61046927SAndroid Build Coastguard Worker  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
16*61046927SAndroid Build Coastguard Worker  * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17*61046927SAndroid Build Coastguard Worker  * NON-INFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT HOLDERS, AUTHORS
18*61046927SAndroid Build Coastguard Worker  * AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19*61046927SAndroid Build Coastguard Worker  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
20*61046927SAndroid Build Coastguard Worker  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
21*61046927SAndroid Build Coastguard Worker  * USE OR OTHER DEALINGS IN THE SOFTWARE.
22*61046927SAndroid Build Coastguard Worker  *
23*61046927SAndroid Build Coastguard Worker  * The above copyright notice and this permission notice (including the
24*61046927SAndroid Build Coastguard Worker  * next paragraph) shall be included in all copies or substantial portions
25*61046927SAndroid Build Coastguard Worker  * of the Software.
26*61046927SAndroid Build Coastguard Worker  */
27*61046927SAndroid Build Coastguard Worker 
28*61046927SAndroid Build Coastguard Worker #ifndef PROCESS_H
29*61046927SAndroid Build Coastguard Worker #define PROCESS_H
30*61046927SAndroid Build Coastguard Worker 
31*61046927SAndroid Build Coastguard Worker #include <stdbool.h>
32*61046927SAndroid Build Coastguard Worker #include <stddef.h>
33*61046927SAndroid Build Coastguard Worker 
34*61046927SAndroid Build Coastguard Worker #ifdef __cplusplus
35*61046927SAndroid Build Coastguard Worker extern "C" {
36*61046927SAndroid Build Coastguard Worker #endif
37*61046927SAndroid Build Coastguard Worker 
38*61046927SAndroid Build Coastguard Worker const char *
39*61046927SAndroid Build Coastguard Worker util_get_process_name(void);
40*61046927SAndroid Build Coastguard Worker 
41*61046927SAndroid Build Coastguard Worker size_t
42*61046927SAndroid Build Coastguard Worker util_get_process_exec_path(char* process_path, size_t len);
43*61046927SAndroid Build Coastguard Worker 
44*61046927SAndroid Build Coastguard Worker /**
45*61046927SAndroid Build Coastguard Worker  * Return the command line for the calling process.  This is basically
46*61046927SAndroid Build Coastguard Worker  * the argv[] array with the arguments separated by spaces.
47*61046927SAndroid Build Coastguard Worker  * \param cmdline  returns the command line string
48*61046927SAndroid Build Coastguard Worker  * \param size  size of the cmdline buffer
49*61046927SAndroid Build Coastguard Worker  * \return  true or false for success, failure
50*61046927SAndroid Build Coastguard Worker  */
51*61046927SAndroid Build Coastguard Worker bool
52*61046927SAndroid Build Coastguard Worker util_get_command_line(char *cmdline, size_t size);
53*61046927SAndroid Build Coastguard Worker 
54*61046927SAndroid Build Coastguard Worker #ifdef __cplusplus
55*61046927SAndroid Build Coastguard Worker } /* extern C */
56*61046927SAndroid Build Coastguard Worker #endif
57*61046927SAndroid Build Coastguard Worker 
58*61046927SAndroid Build Coastguard Worker #endif
59