xref: /xnu-10002.81.5/tests/socket_raw_uint8_max.c (revision 5e3eaea39dcf651e66cb99ba7d70e32cc4a99587)
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