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