/*
- * 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.
}
const char* inet_ntop(int af, const void* src, char* dst, socklen_t size) {
- return ::inet_ntop(af, (char*)src, dst, size);
+ return ::inet_ntop(af, (char*)src, dst, size_t(size));
}
int listen(int s, int backlog) {
int poll(struct pollfd fds[], nfds_t nfds, int timeout) {
// TODO: Allow both file descriptors and SOCKETs in this.
for (int i = 0; i < nfds; i++) {
- fds[i].fd = fd_to_socket(fds[i].fd);
+ fds[i].fd = fd_to_socket((int)fds[i].fd);
}
return ::WSAPoll(fds, (ULONG)nfds, timeout);
}
WSABUF wBuf{};
wBuf.buf = (CHAR*)buf;
- wBuf.len = len;
+ wBuf.len = (ULONG)len;
WSAMSG wMsg{};
wMsg.dwBufferCount = 1;
wMsg.lpBuffers = &wBuf;
return recvfrom(s, (void*)buf, (size_t)len, flags, from, fromlen);
}
-ssize_t recvmsg(int s, struct msghdr* message, int fl) {
+ssize_t recvmsg(int s, struct msghdr* message, int /* flags */) {
SOCKET h = fd_to_socket(s);
// Don't currently support the name translation.
return send(s, (const void*)buf, (size_t)len, flags);
}
-ssize_t sendmsg(int s, const struct msghdr* message, int fl) {
+ssize_t sendmsg(int s, const struct msghdr* message, int /* flags */) {
SOCKET h = fd_to_socket(s);
// Unfortunately, WSASendMsg requires the socket to have been opened