2 * Copyright (c) 2000 - 2021 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 #ifndef __AUL_PROC_H__
18 #define __AUL_RPOC_H__
20 #include <sys/types.h>
31 * @brief Gets the user ID of the process from the proc filesystem.
33 * @param[in] pid The process ID
34 * @param[out] uid The user ID
35 * @return @c 0 on success,
36 * otherwise a negative error value
37 * @remarks This function is only for App Framework internally.
39 int aul_proc_get_uid(pid_t pid, uid_t *uid);
42 * @brief Gets the SMACK label of the process from the proc filesystem.
44 * @param[in] pid The process ID
45 * @param[in] buf The buffer
46 * @param[in] buf_size The size of the buffer
47 * @return @c 0 on success,
48 * otherwise a negative error value
49 * @remarks This function is only for App Framework internally.
51 int aul_proc_get_attr(pid_t pid, char *buf, size_t buf_size);
54 * @brief Gets the cmdline of the process from the proc filesystem.
56 * @param[in] pid The process ID
57 * @param[in] buf The buffer
58 * @param[in] buf_size The size of the buffer
59 * @return @c 0 on success,
60 * otherwise a negative error value
61 * @remarks This function is only for App Framework internally.
63 int aul_proc_get_cmdline(pid_t pid, char *buf, size_t buf_size);
66 * @brief Registers the process information,
67 * @details This function registers the process information to the application manager daemon.
68 * After calling this function, the other process can get the process information
69 * using aul_proc_get_name() or aul_proc_get_extra().
71 * @param[in] name The process name
72 * @param[in] extra The extra data
73 * @return @c 0 on success,
74 * otherwise a negative error value
75 * @remarks This function is only for App Framework internally.
77 int aul_proc_register(const char *name, bundle *extra);
80 * @brief Deregister the process information.
82 * @return @c 0 on success,
83 * otherwise a negative error value
84 * @remarks This function is only for App Framework internally.
86 int aul_proc_deregister(void);
89 * @brief Gets the process name.
91 * @remarks The @a name MUST be released using free().
92 * @param[in] pid The process ID
93 * @param[out] name The process name
94 * @return @c 0 on success,
95 * otherwise a negative error value
96 * @remarks This function is only for App Framework internally.
98 int aul_proc_get_name(pid_t pid, char **name);
101 * @brief Gets the extra data of the process.
103 * @reamrks The @a extra MUST be released using bundle_free().
104 * @param[in] pid The process ID
105 * @param[out] extra The extra data
106 * @return @c 0 on success,
107 * otherwise a negative error value
108 * @remarks This function is only for App Framework internally.
110 int aul_proc_get_extra(pid_t pid, bundle **extra);
116 #endif /* __AUL_PROC_H__ */