VisionFive2 Linux kernel

StarFive Tech Linux Kernel for VisionFive (JH7110) boards (mirror)

More than 9999 Commits   32 Branches   54 Tags
97870c34b4532 arch/um/os-Linux/helper.c (Alex Dewar                     2019-08-25 10:49:18 +0100   1) // SPDX-License-Identifier: GPL-2.0
ff5c6ff54215f arch/um/os-Linux/helper.c (Jeff Dike                      2005-11-07 00:58:51 -0800   2) /*
1aa351a308d2c arch/um/os-Linux/helper.c (Jeff Dike                      2008-02-04 22:31:10 -0800   3)  * Copyright (C) 2002 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com)
^1da177e4c3f4 arch/um/kernel/helper.c   (Linus Torvalds                 2005-04-16 15:20:36 -0700   4)  */
^1da177e4c3f4 arch/um/kernel/helper.c   (Linus Torvalds                 2005-04-16 15:20:36 -0700   5) 
^1da177e4c3f4 arch/um/kernel/helper.c   (Linus Torvalds                 2005-04-16 15:20:36 -0700   6) #include <stdlib.h>
^1da177e4c3f4 arch/um/kernel/helper.c   (Linus Torvalds                 2005-04-16 15:20:36 -0700   7) #include <unistd.h>
^1da177e4c3f4 arch/um/kernel/helper.c   (Linus Torvalds                 2005-04-16 15:20:36 -0700   8) #include <errno.h>
^1da177e4c3f4 arch/um/kernel/helper.c   (Linus Torvalds                 2005-04-16 15:20:36 -0700   9) #include <sched.h>
b6d8adf477439 arch/um/os-Linux/helper.c (Ingo Molnar                    2008-06-05 22:46:14 -0700  10) #include <linux/limits.h>
512b6fb1c14d4 arch/um/os-Linux/helper.c (Jeff Dike                      2007-10-16 01:27:11 -0700  11) #include <sys/socket.h>
1aa351a308d2c arch/um/os-Linux/helper.c (Jeff Dike                      2008-02-04 22:31:10 -0800  12) #include <sys/wait.h>
37185b3324087 arch/um/os-Linux/helper.c (Al Viro                        2012-10-08 03:27:32 +0100  13) #include <kern_util.h>
37185b3324087 arch/um/os-Linux/helper.c (Al Viro                        2012-10-08 03:27:32 +0100  14) #include <os.h>
37185b3324087 arch/um/os-Linux/helper.c (Al Viro                        2012-10-08 03:27:32 +0100  15) #include <um_malloc.h>
^1da177e4c3f4 arch/um/kernel/helper.c   (Linus Torvalds                 2005-04-16 15:20:36 -0700  16) 
^1da177e4c3f4 arch/um/kernel/helper.c   (Linus Torvalds                 2005-04-16 15:20:36 -0700  17) struct helper_data {
^1da177e4c3f4 arch/um/kernel/helper.c   (Linus Torvalds                 2005-04-16 15:20:36 -0700  18) 	void (*pre_exec)(void*);
^1da177e4c3f4 arch/um/kernel/helper.c   (Linus Torvalds                 2005-04-16 15:20:36 -0700  19) 	void *pre_data;
^1da177e4c3f4 arch/um/kernel/helper.c   (Linus Torvalds                 2005-04-16 15:20:36 -0700  20) 	char **argv;
^1da177e4c3f4 arch/um/kernel/helper.c   (Linus Torvalds                 2005-04-16 15:20:36 -0700  21) 	int fd;
5d48545e5e88a arch/um/os-Linux/helper.c (Paolo 'Blaisorblade' Giarrusso 2006-11-25 11:09:39 -0800  22) 	char *buf;
^1da177e4c3f4 arch/um/kernel/helper.c   (Linus Torvalds                 2005-04-16 15:20:36 -0700  23) };
^1da177e4c3f4 arch/um/kernel/helper.c   (Linus Torvalds                 2005-04-16 15:20:36 -0700  24) 
^1da177e4c3f4 arch/um/kernel/helper.c   (Linus Torvalds                 2005-04-16 15:20:36 -0700  25) static int helper_child(void *arg)
^1da177e4c3f4 arch/um/kernel/helper.c   (Linus Torvalds                 2005-04-16 15:20:36 -0700  26) {
^1da177e4c3f4 arch/um/kernel/helper.c   (Linus Torvalds                 2005-04-16 15:20:36 -0700  27) 	struct helper_data *data = arg;
^1da177e4c3f4 arch/um/kernel/helper.c   (Linus Torvalds                 2005-04-16 15:20:36 -0700  28) 	char **argv = data->argv;
2fdf2130926f0 arch/um/os-Linux/helper.c (Vitaliy Ivanov                 2011-07-25 17:12:50 -0700  29) 	int err, ret;
^1da177e4c3f4 arch/um/kernel/helper.c   (Linus Torvalds                 2005-04-16 15:20:36 -0700  30) 
8b028bcd0e746 arch/um/os-Linux/helper.c (Paolo 'Blaisorblade' Giarrusso 2006-10-19 23:28:21 -0700  31) 	if (data->pre_exec != NULL)
^1da177e4c3f4 arch/um/kernel/helper.c   (Linus Torvalds                 2005-04-16 15:20:36 -0700  32) 		(*data->pre_exec)(data->pre_data);
1aa351a308d2c arch/um/os-Linux/helper.c (Jeff Dike                      2008-02-04 22:31:10 -0800  33) 	err = execvp_noalloc(data->buf, argv[0], argv);
1aa351a308d2c arch/um/os-Linux/helper.c (Jeff Dike                      2008-02-04 22:31:10 -0800  34) 
1aa351a308d2c arch/um/os-Linux/helper.c (Jeff Dike                      2008-02-04 22:31:10 -0800  35) 	/* If the exec succeeds, we don't get here */
2fdf2130926f0 arch/um/os-Linux/helper.c (Vitaliy Ivanov                 2011-07-25 17:12:50 -0700  36) 	CATCH_EINTR(ret = write(data->fd, &err, sizeof(err)));
1aa351a308d2c arch/um/os-Linux/helper.c (Jeff Dike                      2008-02-04 22:31:10 -0800  37) 
8b028bcd0e746 arch/um/os-Linux/helper.c (Paolo 'Blaisorblade' Giarrusso 2006-10-19 23:28:21 -0700  38) 	return 0;
^1da177e4c3f4 arch/um/kernel/helper.c   (Linus Torvalds                 2005-04-16 15:20:36 -0700  39) }
^1da177e4c3f4 arch/um/kernel/helper.c   (Linus Torvalds                 2005-04-16 15:20:36 -0700  40) 
1aa351a308d2c arch/um/os-Linux/helper.c (Jeff Dike                      2008-02-04 22:31:10 -0800  41) /* Returns either the pid of the child process we run or -E* on failure. */
c43990162fc7f arch/um/os-Linux/helper.c (Jeff Dike                      2007-07-15 23:38:56 -0700  42) int run_helper(void (*pre_exec)(void *), void *pre_data, char **argv)
^1da177e4c3f4 arch/um/kernel/helper.c   (Linus Torvalds                 2005-04-16 15:20:36 -0700  43) {
^1da177e4c3f4 arch/um/kernel/helper.c   (Linus Torvalds                 2005-04-16 15:20:36 -0700  44) 	struct helper_data data;
^1da177e4c3f4 arch/um/kernel/helper.c   (Linus Torvalds                 2005-04-16 15:20:36 -0700  45) 	unsigned long stack, sp;
^1da177e4c3f4 arch/um/kernel/helper.c   (Linus Torvalds                 2005-04-16 15:20:36 -0700  46) 	int pid, fds[2], ret, n;
^1da177e4c3f4 arch/um/kernel/helper.c   (Linus Torvalds                 2005-04-16 15:20:36 -0700  47) 
2fcb4090cd735 arch/um/os-Linux/helper.c (Johannes Berg                  2021-01-10 19:05:08 +0100  48) 	stack = alloc_stack(0, __cant_sleep());
8b028bcd0e746 arch/um/os-Linux/helper.c (Paolo 'Blaisorblade' Giarrusso 2006-10-19 23:28:21 -0700  49) 	if (stack == 0)
6b7aaad9ba4f2 arch/um/os-Linux/helper.c (Jeff Dike                      2006-09-25 23:33:02 -0700  50) 		return -ENOMEM;
^1da177e4c3f4 arch/um/kernel/helper.c   (Linus Torvalds                 2005-04-16 15:20:36 -0700  51) 
512b6fb1c14d4 arch/um/os-Linux/helper.c (Jeff Dike                      2007-10-16 01:27:11 -0700  52) 	ret = socketpair(AF_UNIX, SOCK_STREAM, 0, fds);
8b028bcd0e746 arch/um/os-Linux/helper.c (Paolo 'Blaisorblade' Giarrusso 2006-10-19 23:28:21 -0700  53) 	if (ret < 0) {
512b6fb1c14d4 arch/um/os-Linux/helper.c (Jeff Dike                      2007-10-16 01:27:11 -0700  54) 		ret = -errno;
1aa351a308d2c arch/um/os-Linux/helper.c (Jeff Dike                      2008-02-04 22:31:10 -0800  55) 		printk(UM_KERN_ERR "run_helper : pipe failed, errno = %d\n",
1aa351a308d2c arch/um/os-Linux/helper.c (Jeff Dike                      2008-02-04 22:31:10 -0800  56) 		       errno);
^1da177e4c3f4 arch/um/kernel/helper.c   (Linus Torvalds                 2005-04-16 15:20:36 -0700  57) 		goto out_free;
^1da177e4c3f4 arch/um/kernel/helper.c   (Linus Torvalds                 2005-04-16 15:20:36 -0700  58) 	}
^1da177e4c3f4 arch/um/kernel/helper.c   (Linus Torvalds                 2005-04-16 15:20:36 -0700  59) 
512b6fb1c14d4 arch/um/os-Linux/helper.c (Jeff Dike                      2007-10-16 01:27:11 -0700  60) 	ret = os_set_exec_close(fds[1]);
8b028bcd0e746 arch/um/os-Linux/helper.c (Paolo 'Blaisorblade' Giarrusso 2006-10-19 23:28:21 -0700  61) 	if (ret < 0) {
1aa351a308d2c arch/um/os-Linux/helper.c (Jeff Dike                      2008-02-04 22:31:10 -0800  62) 		printk(UM_KERN_ERR "run_helper : setting FD_CLOEXEC failed, "
1aa351a308d2c arch/um/os-Linux/helper.c (Jeff Dike                      2008-02-04 22:31:10 -0800  63) 		       "ret = %d\n", -ret);
^1da177e4c3f4 arch/um/kernel/helper.c   (Linus Torvalds                 2005-04-16 15:20:36 -0700  64) 		goto out_close;
^1da177e4c3f4 arch/um/kernel/helper.c   (Linus Torvalds                 2005-04-16 15:20:36 -0700  65) 	}
^1da177e4c3f4 arch/um/kernel/helper.c   (Linus Torvalds                 2005-04-16 15:20:36 -0700  66) 
558f9b2f94dbd arch/um/os-Linux/helper.c (YiFei Zhu                      2021-04-20 00:56:10 -0500  67) 	sp = stack + UM_KERN_PAGE_SIZE;
^1da177e4c3f4 arch/um/kernel/helper.c   (Linus Torvalds                 2005-04-16 15:20:36 -0700  68) 	data.pre_exec = pre_exec;
^1da177e4c3f4 arch/um/kernel/helper.c   (Linus Torvalds                 2005-04-16 15:20:36 -0700  69) 	data.pre_data = pre_data;
^1da177e4c3f4 arch/um/kernel/helper.c   (Linus Torvalds                 2005-04-16 15:20:36 -0700  70) 	data.argv = argv;
^1da177e4c3f4 arch/um/kernel/helper.c   (Linus Torvalds                 2005-04-16 15:20:36 -0700  71) 	data.fd = fds[1];
43f5b3085fdd2 arch/um/os-Linux/helper.c (Jeff Dike                      2008-05-12 14:01:52 -0700  72) 	data.buf = __cant_sleep() ? uml_kmalloc(PATH_MAX, UM_GFP_ATOMIC) :
43f5b3085fdd2 arch/um/os-Linux/helper.c (Jeff Dike                      2008-05-12 14:01:52 -0700  73) 					uml_kmalloc(PATH_MAX, UM_GFP_KERNEL);
4dbed85a35ed3 arch/um/os-Linux/helper.c (Stanislaw Gruszka              2007-12-17 16:19:46 -0800  74) 	pid = clone(helper_child, (void *) sp, CLONE_VM, &data);
8b028bcd0e746 arch/um/os-Linux/helper.c (Paolo 'Blaisorblade' Giarrusso 2006-10-19 23:28:21 -0700  75) 	if (pid < 0) {
^1da177e4c3f4 arch/um/kernel/helper.c   (Linus Torvalds                 2005-04-16 15:20:36 -0700  76) 		ret = -errno;
1aa351a308d2c arch/um/os-Linux/helper.c (Jeff Dike                      2008-02-04 22:31:10 -0800  77) 		printk(UM_KERN_ERR "run_helper : clone failed, errno = %d\n",
1aa351a308d2c arch/um/os-Linux/helper.c (Jeff Dike                      2008-02-04 22:31:10 -0800  78) 		       errno);
5d48545e5e88a arch/um/os-Linux/helper.c (Paolo 'Blaisorblade' Giarrusso 2006-11-25 11:09:39 -0800  79) 		goto out_free2;
^1da177e4c3f4 arch/um/kernel/helper.c   (Linus Torvalds                 2005-04-16 15:20:36 -0700  80) 	}
^1da177e4c3f4 arch/um/kernel/helper.c   (Linus Torvalds                 2005-04-16 15:20:36 -0700  81) 
ff5c6ff54215f arch/um/os-Linux/helper.c (Jeff Dike                      2005-11-07 00:58:51 -0800  82) 	close(fds[1]);
^1da177e4c3f4 arch/um/kernel/helper.c   (Linus Torvalds                 2005-04-16 15:20:36 -0700  83) 	fds[1] = -1;
^1da177e4c3f4 arch/um/kernel/helper.c   (Linus Torvalds                 2005-04-16 15:20:36 -0700  84) 
ef0470c053274 arch/um/os-Linux/helper.c (Jeff Dike                      2007-05-06 14:51:33 -0700  85) 	/*
ef0470c053274 arch/um/os-Linux/helper.c (Jeff Dike                      2007-05-06 14:51:33 -0700  86) 	 * Read the errno value from the child, if the exec failed, or get 0 if
ef0470c053274 arch/um/os-Linux/helper.c (Jeff Dike                      2007-05-06 14:51:33 -0700  87) 	 * the exec succeeded because the pipe fd was set as close-on-exec.
ef0470c053274 arch/um/os-Linux/helper.c (Jeff Dike                      2007-05-06 14:51:33 -0700  88) 	 */
a61f334fd2864 arch/um/os-Linux/helper.c (Jeff Dike                      2007-05-06 14:51:35 -0700  89) 	n = read(fds[0], &ret, sizeof(ret));
8b028bcd0e746 arch/um/os-Linux/helper.c (Paolo 'Blaisorblade' Giarrusso 2006-10-19 23:28:21 -0700  90) 	if (n == 0) {
^1da177e4c3f4 arch/um/kernel/helper.c   (Linus Torvalds                 2005-04-16 15:20:36 -0700  91) 		ret = pid;
8b028bcd0e746 arch/um/os-Linux/helper.c (Paolo 'Blaisorblade' Giarrusso 2006-10-19 23:28:21 -0700  92) 	} else {
8b028bcd0e746 arch/um/os-Linux/helper.c (Paolo 'Blaisorblade' Giarrusso 2006-10-19 23:28:21 -0700  93) 		if (n < 0) {
a61f334fd2864 arch/um/os-Linux/helper.c (Jeff Dike                      2007-05-06 14:51:35 -0700  94) 			n = -errno;
1aa351a308d2c arch/um/os-Linux/helper.c (Jeff Dike                      2008-02-04 22:31:10 -0800  95) 			printk(UM_KERN_ERR "run_helper : read on pipe failed, "
1aa351a308d2c arch/um/os-Linux/helper.c (Jeff Dike                      2008-02-04 22:31:10 -0800  96) 			       "ret = %d\n", -n);
6b7aaad9ba4f2 arch/um/os-Linux/helper.c (Jeff Dike                      2006-09-25 23:33:02 -0700  97) 			ret = n;
6b7aaad9ba4f2 arch/um/os-Linux/helper.c (Jeff Dike                      2006-09-25 23:33:02 -0700  98) 		}
6b1873371cea1 arch/um/os-Linux/helper.c (Richard Weinberger             2015-08-09 21:49:07 +0200  99) 		CATCH_EINTR(waitpid(pid, NULL, __WALL));
^1da177e4c3f4 arch/um/kernel/helper.c   (Linus Torvalds                 2005-04-16 15:20:36 -0700 100) 	}
^1da177e4c3f4 arch/um/kernel/helper.c   (Linus Torvalds                 2005-04-16 15:20:36 -0700 101) 
5d48545e5e88a arch/um/os-Linux/helper.c (Paolo 'Blaisorblade' Giarrusso 2006-11-25 11:09:39 -0800 102) out_free2:
5d48545e5e88a arch/um/os-Linux/helper.c (Paolo 'Blaisorblade' Giarrusso 2006-11-25 11:09:39 -0800 103) 	kfree(data.buf);
^1da177e4c3f4 arch/um/kernel/helper.c   (Linus Torvalds                 2005-04-16 15:20:36 -0700 104) out_close:
^1da177e4c3f4 arch/um/kernel/helper.c   (Linus Torvalds                 2005-04-16 15:20:36 -0700 105) 	if (fds[1] != -1)
ff5c6ff54215f arch/um/os-Linux/helper.c (Jeff Dike                      2005-11-07 00:58:51 -0800 106) 		close(fds[1]);
ff5c6ff54215f arch/um/os-Linux/helper.c (Jeff Dike                      2005-11-07 00:58:51 -0800 107) 	close(fds[0]);
^1da177e4c3f4 arch/um/kernel/helper.c   (Linus Torvalds                 2005-04-16 15:20:36 -0700 108) out_free:
c43990162fc7f arch/um/os-Linux/helper.c (Jeff Dike                      2007-07-15 23:38:56 -0700 109) 	free_stack(stack, 0);
8b028bcd0e746 arch/um/os-Linux/helper.c (Paolo 'Blaisorblade' Giarrusso 2006-10-19 23:28:21 -0700 110) 	return ret;
^1da177e4c3f4 arch/um/kernel/helper.c   (Linus Torvalds                 2005-04-16 15:20:36 -0700 111) }
^1da177e4c3f4 arch/um/kernel/helper.c   (Linus Torvalds                 2005-04-16 15:20:36 -0700 112) 
ff5c6ff54215f arch/um/os-Linux/helper.c (Jeff Dike                      2005-11-07 00:58:51 -0800 113) int run_helper_thread(int (*proc)(void *), void *arg, unsigned int flags,
c43990162fc7f arch/um/os-Linux/helper.c (Jeff Dike                      2007-07-15 23:38:56 -0700 114) 		      unsigned long *stack_out)
^1da177e4c3f4 arch/um/kernel/helper.c   (Linus Torvalds                 2005-04-16 15:20:36 -0700 115) {
^1da177e4c3f4 arch/um/kernel/helper.c   (Linus Torvalds                 2005-04-16 15:20:36 -0700 116) 	unsigned long stack, sp;
b4fd310e16347 arch/um/kernel/helper.c   (Jeff Dike                      2005-09-16 19:27:49 -0700 117) 	int pid, status, err;
^1da177e4c3f4 arch/um/kernel/helper.c   (Linus Torvalds                 2005-04-16 15:20:36 -0700 118) 
2fcb4090cd735 arch/um/os-Linux/helper.c (Johannes Berg                  2021-01-10 19:05:08 +0100 119) 	stack = alloc_stack(0, __cant_sleep());
8b028bcd0e746 arch/um/os-Linux/helper.c (Paolo 'Blaisorblade' Giarrusso 2006-10-19 23:28:21 -0700 120) 	if (stack == 0)
8b028bcd0e746 arch/um/os-Linux/helper.c (Paolo 'Blaisorblade' Giarrusso 2006-10-19 23:28:21 -0700 121) 		return -ENOMEM;
^1da177e4c3f4 arch/um/kernel/helper.c   (Linus Torvalds                 2005-04-16 15:20:36 -0700 122) 
558f9b2f94dbd arch/um/os-Linux/helper.c (YiFei Zhu                      2021-04-20 00:56:10 -0500 123) 	sp = stack + UM_KERN_PAGE_SIZE;
4dbed85a35ed3 arch/um/os-Linux/helper.c (Stanislaw Gruszka              2007-12-17 16:19:46 -0800 124) 	pid = clone(proc, (void *) sp, flags, arg);
8b028bcd0e746 arch/um/os-Linux/helper.c (Paolo 'Blaisorblade' Giarrusso 2006-10-19 23:28:21 -0700 125) 	if (pid < 0) {
b4fd310e16347 arch/um/kernel/helper.c   (Jeff Dike                      2005-09-16 19:27:49 -0700 126) 		err = -errno;
1aa351a308d2c arch/um/os-Linux/helper.c (Jeff Dike                      2008-02-04 22:31:10 -0800 127) 		printk(UM_KERN_ERR "run_helper_thread : clone failed, "
1aa351a308d2c arch/um/os-Linux/helper.c (Jeff Dike                      2008-02-04 22:31:10 -0800 128) 		       "errno = %d\n", errno);
b4fd310e16347 arch/um/kernel/helper.c   (Jeff Dike                      2005-09-16 19:27:49 -0700 129) 		return err;
^1da177e4c3f4 arch/um/kernel/helper.c   (Linus Torvalds                 2005-04-16 15:20:36 -0700 130) 	}
8b028bcd0e746 arch/um/os-Linux/helper.c (Paolo 'Blaisorblade' Giarrusso 2006-10-19 23:28:21 -0700 131) 	if (stack_out == NULL) {
6b1873371cea1 arch/um/os-Linux/helper.c (Richard Weinberger             2015-08-09 21:49:07 +0200 132) 		CATCH_EINTR(pid = waitpid(pid, &status, __WALL));
8b028bcd0e746 arch/um/os-Linux/helper.c (Paolo 'Blaisorblade' Giarrusso 2006-10-19 23:28:21 -0700 133) 		if (pid < 0) {
b4fd310e16347 arch/um/kernel/helper.c   (Jeff Dike                      2005-09-16 19:27:49 -0700 134) 			err = -errno;
1aa351a308d2c arch/um/os-Linux/helper.c (Jeff Dike                      2008-02-04 22:31:10 -0800 135) 			printk(UM_KERN_ERR "run_helper_thread - wait failed, "
1aa351a308d2c arch/um/os-Linux/helper.c (Jeff Dike                      2008-02-04 22:31:10 -0800 136) 			       "errno = %d\n", errno);
b4fd310e16347 arch/um/kernel/helper.c   (Jeff Dike                      2005-09-16 19:27:49 -0700 137) 			pid = err;
^1da177e4c3f4 arch/um/kernel/helper.c   (Linus Torvalds                 2005-04-16 15:20:36 -0700 138) 		}
8b028bcd0e746 arch/um/os-Linux/helper.c (Paolo 'Blaisorblade' Giarrusso 2006-10-19 23:28:21 -0700 139) 		if (!WIFEXITED(status) || (WEXITSTATUS(status) != 0))
1aa351a308d2c arch/um/os-Linux/helper.c (Jeff Dike                      2008-02-04 22:31:10 -0800 140) 			printk(UM_KERN_ERR "run_helper_thread - thread "
1aa351a308d2c arch/um/os-Linux/helper.c (Jeff Dike                      2008-02-04 22:31:10 -0800 141) 			       "returned status 0x%x\n", status);
c43990162fc7f arch/um/os-Linux/helper.c (Jeff Dike                      2007-07-15 23:38:56 -0700 142) 		free_stack(stack, 0);
8b028bcd0e746 arch/um/os-Linux/helper.c (Paolo 'Blaisorblade' Giarrusso 2006-10-19 23:28:21 -0700 143) 	} else
8b028bcd0e746 arch/um/os-Linux/helper.c (Paolo 'Blaisorblade' Giarrusso 2006-10-19 23:28:21 -0700 144) 		*stack_out = stack;
8b028bcd0e746 arch/um/os-Linux/helper.c (Paolo 'Blaisorblade' Giarrusso 2006-10-19 23:28:21 -0700 145) 	return pid;
^1da177e4c3f4 arch/um/kernel/helper.c   (Linus Torvalds                 2005-04-16 15:20:36 -0700 146) }
^1da177e4c3f4 arch/um/kernel/helper.c   (Linus Torvalds                 2005-04-16 15:20:36 -0700 147) 
1aa351a308d2c arch/um/os-Linux/helper.c (Jeff Dike                      2008-02-04 22:31:10 -0800 148) int helper_wait(int pid)
^1da177e4c3f4 arch/um/kernel/helper.c   (Linus Torvalds                 2005-04-16 15:20:36 -0700 149) {
4dbed85a35ed3 arch/um/os-Linux/helper.c (Stanislaw Gruszka              2007-12-17 16:19:46 -0800 150) 	int ret, status;
6b1873371cea1 arch/um/os-Linux/helper.c (Richard Weinberger             2015-08-09 21:49:07 +0200 151) 	int wflags = __WALL;
^1da177e4c3f4 arch/um/kernel/helper.c   (Linus Torvalds                 2005-04-16 15:20:36 -0700 152) 
4dbed85a35ed3 arch/um/os-Linux/helper.c (Stanislaw Gruszka              2007-12-17 16:19:46 -0800 153) 	CATCH_EINTR(ret = waitpid(pid, &status, wflags));
8b028bcd0e746 arch/um/os-Linux/helper.c (Paolo 'Blaisorblade' Giarrusso 2006-10-19 23:28:21 -0700 154) 	if (ret < 0) {
1aa351a308d2c arch/um/os-Linux/helper.c (Jeff Dike                      2008-02-04 22:31:10 -0800 155) 		printk(UM_KERN_ERR "helper_wait : waitpid process %d failed, "
1aa351a308d2c arch/um/os-Linux/helper.c (Jeff Dike                      2008-02-04 22:31:10 -0800 156) 		       "errno = %d\n", pid, errno);
4dbed85a35ed3 arch/um/os-Linux/helper.c (Stanislaw Gruszka              2007-12-17 16:19:46 -0800 157) 		return -errno;
4dbed85a35ed3 arch/um/os-Linux/helper.c (Stanislaw Gruszka              2007-12-17 16:19:46 -0800 158) 	} else if (!WIFEXITED(status) || WEXITSTATUS(status) != 0) {
1aa351a308d2c arch/um/os-Linux/helper.c (Jeff Dike                      2008-02-04 22:31:10 -0800 159) 		printk(UM_KERN_ERR "helper_wait : process %d exited with "
1aa351a308d2c arch/um/os-Linux/helper.c (Jeff Dike                      2008-02-04 22:31:10 -0800 160) 		       "status 0x%x\n", pid, status);
4dbed85a35ed3 arch/um/os-Linux/helper.c (Stanislaw Gruszka              2007-12-17 16:19:46 -0800 161) 		return -ECHILD;
4dbed85a35ed3 arch/um/os-Linux/helper.c (Stanislaw Gruszka              2007-12-17 16:19:46 -0800 162) 	} else
4dbed85a35ed3 arch/um/os-Linux/helper.c (Stanislaw Gruszka              2007-12-17 16:19:46 -0800 163) 		return 0;
^1da177e4c3f4 arch/um/kernel/helper.c   (Linus Torvalds                 2005-04-16 15:20:36 -0700 164) }