diff --git a/include/sys/socket_checked.h b/include/sys/socket_checked.h index 6f2cfb079a..046525a382 100644 --- a/include/sys/socket_checked.h +++ b/include/sys/socket_checked.h @@ -1,6 +1,5 @@ //---------------------------------------------------------------------// -// Bounds-safe interfaces for functions in POSIX socket.h. // -// // +// Bounds-safe interfaces for functions in POSIX socket.h. // // // // ///////////////////////////////////////////////////////////////////////// @@ -25,16 +24,25 @@ #pragma CHECKED_SCOPE push #pragma CHECKED_SCOPE on -#ifdef __APPLE__ -// Seems not to be a thing for Mac -#define __THROW +#ifndef __CONST_SOCKADDR_ARG #define __CONST_SOCKADDR_ARG const struct sockaddr * +#endif + +#ifndef __SOCKADDR_ARG #define __SOCKADDR_ARG struct sockaddr *__restrict #endif + +#ifdef __APPLE__ +// Seems not to be a thing for Mac +#define __THROW +#endif + + extern int socketpair (int __domain, int __type, int __protocol, int __fds[2] : itype(int _Checked[2])) __THROW; +/* extern int bind ( int __fd, __CONST_SOCKADDR_ARG __addr : itype(_Ptr), @@ -134,6 +142,7 @@ extern int accept4 ( int __flags); #endif +*/ #pragma CHECKED_SCOPE pop #endif // guard