Merge "Return errors to caller" into tizen_5.5
[platform/core/connectivity/stc-manager.git] / src / helper / helper-procfs.h
index 4f0fd02..26839c6 100644 (file)
@@ -22,6 +22,8 @@
 
 #define PROC_BUF_MAX 64
 
+typedef bool (*proc_pid_cb)(pid_t pid, void *user_data);
+
 /**
  * @desc get command line from /proc/{pid}/cmdline
  * @return negative value if error
@@ -36,6 +38,11 @@ int proc_get_cmdline(pid_t pid, char *cmdline);
 pid_t find_pid_from_cmdline(char *cmdline);
 
 /**
+ * @desc find pid from /proc
+ */
+void proc_foreach_pid(proc_pid_cb cb, void *user_data);
+
+/**
  * @desc get smack subject label from /proc/{pid}/attr/current
  * this label can indicate package name about child processes
  * @return negative value if error or pid doesn't exist
@@ -58,6 +65,6 @@ int proc_get_exepath(pid_t pid, char *buf, int len);
  * @desc get status from /proc/{pid}/status
  * @return negative value if error
  */
-int proc_get_status(pid_t pid, char *buf, int len);
+int proc_get_status(pid_t pid, char status[][PROC_BUF_MAX]);
 
 #endif /*__HELPER_PROCFS_H__*/