xref: /xnu-8019.80.24/tests/socket_raw_uint8_max.c (revision a325d9c4a84054e40bbe985afedcb50ab80993ea)
1 #include <darwintest.h>
2 #include <sys/socket.h>
3 
4 T_DECL(socket_raw_uint8_max, "create socket with borderline proto numbers")
5 {
6 	int fd = socket(AF_INET, SOCK_RAW, 256);
7 
8 	T_ASSERT_POSIX_FAILURE(fd, EINVAL, "socket(AF_INET, SOCK_RAW, 256);");
9 
10 	int fd2 = socket(AF_INET, SOCK_RAW, 255);
11 
12 	T_ASSERT_POSIX_SUCCESS(fd2, "socket(AF_INET, SOCK_RAW, 255);");
13 }
14