Deleted Added
sdiff udiff text old ( 157139 ) new ( 157146 )
full compact
1/*-
2 * Copyright (c) 2006 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

--- 9 unchanged lines hidden (view full) ---

18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 *
26 * $FreeBSD: head/tools/regression/netipx/ipxsocket/ipxsocket.c 157139 2006-03-26 01:58:39Z rwatson $
27 */
28
29/*
30 * Simple regression test to open and then immediately close various types of
31 * PF_IPX sockets.
32 */
33
34#include <sys/types.h>
35#include <sys/socket.h>
36
37#include <netipx/ipx.h>
38
39#include <err.h>
40#include <unistd.h>
41
42int
43main(int argc, char *argv[])
44{
45 int s;
46
47 s = socket(PF_IPX, SOCK_DGRAM, 0);
48 if (s < 0)
49 warn("socket(PF_IPX, SOCK_DGRAM, 0)");
50 else
51 close(s);
52
53 s = socket(PF_IPX, SOCK_STREAM, 0);
54 if (s < 0)
55 warn("socket(PF_IPX, SOCK_STREAM, 0)");
56 else
57 close(s);
58
59 s = socket(PF_IPX, SOCK_SEQPACKET, 0);
60 if (s < 0)
61 warn("socket(PF_IPX, SOCK_SEQPACKET, 0)");
62 else
63 close(s);
64
65 s = socket(PF_IPX, SOCK_RAW, 0);
66 if (s < 0)
67 warn("socket(PF_IPX, SOCK_RAW, 0)");
68 else
69 close(s);
70
71 return (0);
72}