diff options
author | Benjamin Berg <benjamin.berg@intel.com> | 2024-09-13 15:44:39 +0200 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2024-10-10 12:02:04 +0200 |
commit | 47e174969cbf9244add188635a9590ff717d796e (patch) | |
tree | 00a7396a632754b4f4700c4b12b19fa3f9af3eb8 | |
parent | 7852ee068afe97eec3e955de3c4197aeb4793c52 (diff) |
um: Remove unused os_process_parent
The function is not used anywhere.
Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
Link: https://patch.msgid.link/20240913134442.967599-3-benjamin@sipsolutions.net
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
-rw-r--r-- | arch/um/include/shared/os.h | 1 | ||||
-rw-r--r-- | arch/um/os-Linux/process.c | 39 |
2 files changed, 0 insertions, 40 deletions
diff --git a/arch/um/include/shared/os.h b/arch/um/include/shared/os.h index c8c1a93c8d2c..4bdd4fb5dd80 100644 --- a/arch/um/include/shared/os.h +++ b/arch/um/include/shared/os.h @@ -199,7 +199,6 @@ extern int create_mem_file(unsigned long long len); extern void report_enomem(void); /* process.c */ -extern int os_process_parent(int pid); extern void os_alarm_process(int pid); extern void os_stop_process(int pid); extern void os_kill_process(int pid, int reap_child); diff --git a/arch/um/os-Linux/process.c b/arch/um/os-Linux/process.c index 6b74a8d91e06..b25c226c5491 100644 --- a/arch/um/os-Linux/process.c +++ b/arch/um/os-Linux/process.c @@ -18,45 +18,6 @@ #include <longjmp.h> #include <os.h> -#define FAILURE_PID -1 - -#define STAT_PATH_LEN sizeof("/proc/#######/stat\0") -#define COMM_SCANF "%*[^)])" - -int os_process_parent(int pid) -{ - char stat[STAT_PATH_LEN]; - char data[256]; - int parent = FAILURE_PID, n, fd; - - if (pid == -1) - return parent; - - snprintf(stat, sizeof(stat), "/proc/%d/stat", pid); - fd = open(stat, O_RDONLY, 0); - if (fd < 0) { - printk(UM_KERN_ERR "Couldn't open '%s', errno = %d\n", stat, - errno); - return parent; - } - - CATCH_EINTR(n = read(fd, data, sizeof(data))); - close(fd); - - if (n < 0) { - printk(UM_KERN_ERR "Couldn't read '%s', errno = %d\n", stat, - errno); - return parent; - } - - parent = FAILURE_PID; - n = sscanf(data, "%*d " COMM_SCANF " %*c %d", &parent); - if (n != 1) - printk(UM_KERN_ERR "Failed to scan '%s'\n", data); - - return parent; -} - void os_alarm_process(int pid) { kill(pid, SIGALRM); |