Merge branch 'master' into libposix-new-signals
This commit is contained in:
		| @@ -36,6 +36,7 @@ | |||||||
| 			"psx.c", | 			"psx.c", | ||||||
| 			"segattach.c", | 			"segattach.c", | ||||||
| 			"sched0.c", | 			"sched0.c", | ||||||
|  | 			"stop_start.c", | ||||||
| 			"syscall.c", | 			"syscall.c", | ||||||
| 			"sysstatread.c", | 			"sysstatread.c", | ||||||
| 			"tsemacquire.c", | 			"tsemacquire.c", | ||||||
|   | |||||||
							
								
								
									
										41
									
								
								qa/kern/stop_start.c
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										41
									
								
								qa/kern/stop_start.c
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,41 @@ | |||||||
|  | /* | ||||||
|  |  * This file is part of Jehanne. | ||||||
|  |  * | ||||||
|  |  * Copyright (C) 2017 Giacomo Tesio <giacomo@tesio.it> | ||||||
|  |  * | ||||||
|  |  * Jehanne is free software: you can redistribute it and/or modify | ||||||
|  |  * it under the terms of the GNU General Public License as published by | ||||||
|  |  * the Free Software Foundation, version 2 of the License. | ||||||
|  |  * | ||||||
|  |  * Jehanne is distributed in the hope that it will be useful, | ||||||
|  |  * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||||
|  |  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | ||||||
|  |  * GNU General Public License for more details. | ||||||
|  |  * | ||||||
|  |  * You should have received a copy of the GNU General Public License | ||||||
|  |  * along with Jehanne.  If not, see <http://www.gnu.org/licenses/>. | ||||||
|  |  */ | ||||||
|  | #include <u.h> | ||||||
|  | #include <lib9.h> | ||||||
|  |  | ||||||
|  | void | ||||||
|  | main(int argc, char**argv) | ||||||
|  | { | ||||||
|  | 	int fd, n; | ||||||
|  | 	char *path; | ||||||
|  | 	 | ||||||
|  | 	path = smprint("/proc/%d/ctl", getpid()); | ||||||
|  | 	fd = open(path, OWRITE); | ||||||
|  | 	if(fd < 0){ | ||||||
|  | 		print("FAIL: open"); | ||||||
|  | 		exits("FAIL"); | ||||||
|  | 	} | ||||||
|  | 	n = write(fd, "stop", 4); | ||||||
|  | 	if(n < 0){ | ||||||
|  | 		print("FAIL: write"); | ||||||
|  | 		exits("FAIL"); | ||||||
|  | 	} | ||||||
|  | 	close(fd); | ||||||
|  | 	print("PASS\n"); | ||||||
|  | 	exits("PASS"); | ||||||
|  | } | ||||||
							
								
								
									
										29
									
								
								qa/kern/stop_start.runner
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										29
									
								
								qa/kern/stop_start.runner
									
									
									
									
									
										Executable file
									
								
							| @@ -0,0 +1,29 @@ | |||||||
|  | #!/cmd/rc | ||||||
|  |  | ||||||
|  | runner=$0 | ||||||
|  | test = `{echo $runner|sed 's/.runner//'} | ||||||
|  | test_output = /tmp/output-`{basename $test} | ||||||
|  |  | ||||||
|  | if ( test -e $test_output) rm $test_output | ||||||
|  |  | ||||||
|  | $test > $test_output & | ||||||
|  | testpid=$apid | ||||||
|  | sleep 5 | ||||||
|  |  | ||||||
|  | if ( cat $test_output | grep 'PASS' > /dev/null ) { | ||||||
|  | 	cat $test_output | ||||||
|  | 	echo FAIL | ||||||
|  | 	exit FAIL | ||||||
|  | } | ||||||
|  |  | ||||||
|  | echo start > /proc/$testpid/ctl | ||||||
|  | wait $testpid | ||||||
|  |  | ||||||
|  | if ( cat $test_output | grep 'PASS' > /dev/null ) { | ||||||
|  | 	rm $test_output | ||||||
|  | 	echo PASS | ||||||
|  | 	exit PASS | ||||||
|  | } | ||||||
|  | cat $test_output | ||||||
|  | echo FAIL | ||||||
|  | exit FAIL | ||||||
| @@ -1325,6 +1325,8 @@ procstopwait(Proc *p, int ctl) | |||||||
| 		error(Eprocdied); | 		error(Eprocdied); | ||||||
| 	if(ctl != 0) | 	if(ctl != 0) | ||||||
| 		p->procctl = ctl; | 		p->procctl = ctl; | ||||||
|  | 	if(p == up) | ||||||
|  | 		return; | ||||||
| 	p->pdbg = up; | 	p->pdbg = up; | ||||||
| 	qunlock(&p->debug); | 	qunlock(&p->debug); | ||||||
| 	up->psstate = "Stopwait"; | 	up->psstate = "Stopwait"; | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user