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