244b37aa5dcede3bf8b67330b3e9041051940ffc
[platform/core/system/crash-worker.git] / src / crash-manager / crash-manager.h
1 /*
2  * crash-manager
3  *
4  * Copyright (c) 2019 Samsung Electronics Co., Ltd.
5  *
6  * Licensed under the Apache License, Version 2.0 (the License);
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  *     http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */
18
19 #ifndef __CRASH_MANAGER_H__
20 #define __CRASH_MANAGER_H__
21
22 #include <sys/types.h>
23 #include <unistd.h>
24 #include <stdbool.h>
25
26 #define APPID_MAX                   128
27 #define PKGNAME_MAX                 128
28
29 /* Paths and variables */
30 struct crash_info {
31         pid_t pid_info;
32         pid_t tid_info;
33         int uid_info;
34         int gid_info;
35         int sig_info;
36         char *cmd_line;
37         char *cmd_path;
38         time_t time_info;
39         char *temp_dir;
40         char *name;
41         char *result_path;
42         char *pfx;
43         char *info_path;
44         char *core_path;
45         char *log_path;
46         char appid[APPID_MAX];
47         char pkgid[PKGNAME_MAX];
48         char *output_path;
49         bool livedump;
50         bool kill;
51         bool print_result_path;
52 #ifdef SYS_ASSERT
53         char *sysassert_cs_path;
54         bool have_sysassert_report;
55 #endif
56         int prstatus_fd;
57 };
58
59 bool crash_manager_direct(struct crash_info *cinfo);
60 void crash_info_init(struct crash_info *cinfo);
61 void crash_manager_free(struct crash_info *cinfo);
62 #endif