unix_sorflush.c (175821) | unix_sorflush.c (281403) |
---|---|
1/*- 2 * Copyright (c) 2008 Robert N. M. Watson 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 22 unchanged lines hidden (view full) --- 31 * - Process (b) is blocked in shutdown() on a socket waiting on (a). 32 * - Process (c) delivers a signal to (b) interrupting its wait. 33 * 34 * This race is premised on shutdown() not interrupting (a) properly, and the 35 * signal to (b) causing problems in the kernel. 36 */ 37 38#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2008 Robert N. M. Watson 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 22 unchanged lines hidden (view full) --- 31 * - Process (b) is blocked in shutdown() on a socket waiting on (a). 32 * - Process (c) delivers a signal to (b) interrupting its wait. 33 * 34 * This race is premised on shutdown() not interrupting (a) properly, and the 35 * signal to (b) causing problems in the kernel. 36 */ 37 38#include <sys/cdefs.h> |
39__FBSDID("$FreeBSD: head/tools/regression/sockets/unix_sorflush/unix_sorflush.c 175821 2008-01-30 13:23:34Z rwatson $"); | 39__FBSDID("$FreeBSD: head/tools/regression/sockets/unix_sorflush/unix_sorflush.c 281403 2015-04-11 03:57:35Z ngie $"); |
40 41#include <sys/socket.h> 42 43#include <err.h> 44#include <signal.h> 45#include <stdio.h> 46#include <stdlib.h> 47#include <unistd.h> --- 15 unchanged lines hidden (view full) --- 63{ 64 65 if (shutdown(s, SHUT_RD) < 0) 66 err(-1, "shutdown_and_exit: shutdown"); 67 exit(0); 68} 69 70int | 40 41#include <sys/socket.h> 42 43#include <err.h> 44#include <signal.h> 45#include <stdio.h> 46#include <stdlib.h> 47#include <unistd.h> --- 15 unchanged lines hidden (view full) --- 63{ 64 65 if (shutdown(s, SHUT_RD) < 0) 66 err(-1, "shutdown_and_exit: shutdown"); 67 exit(0); 68} 69 70int |
71main(int argc, char *argv[]) | 71main(void) |
72{ 73 pid_t pida, pidb; 74 int sv[2]; 75 76 if (socketpair(PF_LOCAL, SOCK_STREAM, 0, sv) < 0) 77 err(-1, "socketpair"); 78 79 pida = fork(); --- 20 unchanged lines hidden --- | 72{ 73 pid_t pida, pidb; 74 int sv[2]; 75 76 if (socketpair(PF_LOCAL, SOCK_STREAM, 0, sv) < 0) 77 err(-1, "socketpair"); 78 79 pida = fork(); --- 20 unchanged lines hidden --- |