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