X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=folly%2Fportability%2FSockets.h;h=74060df1b8a211dc7f8db76ed69c390b66909803;hb=d3e8b83f6a8388d97443b9e5bdd4dc375b092fa1;hp=83e1b92e5c24a712dc9d1ebcf22bf0b174b8c339;hpb=4a0d0c51faec44f4a2d4e788cb9fce4230fa411a;p=folly.git diff --git a/folly/portability/Sockets.h b/folly/portability/Sockets.h index 83e1b92e..74060df1 100755 --- a/folly/portability/Sockets.h +++ b/folly/portability/Sockets.h @@ -1,5 +1,5 @@ /* - * Copyright 2016 Facebook, Inc. + * Copyright 2017 Facebook, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -37,7 +37,7 @@ using sa_family_t = ADDRESS_FAMILY; // We don't actually support either of these flags // currently. -#define MSG_DONTWAIT 0 +#define MSG_DONTWAIT 0x1000 #define MSG_EOR 0 struct msghdr { void* msg_name; @@ -60,8 +60,12 @@ struct sockaddr_un { // These are the same, but PF_LOCAL // isn't defined by WinSock. +#define AF_LOCAL PF_UNIX #define PF_LOCAL PF_UNIX -#define SO_REUSEPORT SO_REUSEADDR + +// This isn't defined by Windows, and we need to +// distinguish it from SO_REUSEADDR +#define SO_REUSEPORT 0x7001 // Someone thought it would be a good idea // to define a field via a macro... @@ -94,6 +98,7 @@ using ::socket; bool is_fh_socket(int fh); SOCKET fd_to_socket(int fd); int socket_to_fd(SOCKET s); +int translate_wsa_error(int wsaErr); // These aren't additional overloads, but rather other functions that // are referenced that we need to wrap, or, in the case of inet_aton,