xref: /xnu-8796.101.5/tests/socket_raw_uint8_max.c (revision aca3beaa3dfbd42498b42c5e5ce20a938e6554e5)
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