|
@@ -570,7 +570,8 @@ static int tcp_open (PAL_HANDLE *handle, const char * type, const char * uri,
|
|
|
}
|
|
|
|
|
|
|
|
|
-static int tcp_read (PAL_HANDLE handle, int offset, int len, void * buf)
|
|
|
+static int64_t tcp_read (PAL_HANDLE handle, uint64_t offset, uint64_t len,
|
|
|
+ void * buf)
|
|
|
{
|
|
|
if (!IS_HANDLE_TYPE(handle, tcp) || !handle->sock.conn)
|
|
|
return -PAL_ERROR_NOTCONNECTION;
|
|
@@ -590,7 +591,7 @@ static int tcp_read (PAL_HANDLE handle, int offset, int len, void * buf)
|
|
|
hdr.msg_controllen = 0;
|
|
|
hdr.msg_flags = 0;
|
|
|
|
|
|
- int bytes = INLINE_SYSCALL(recvmsg, 3, handle->sock.fd, &hdr, 0);
|
|
|
+ int64_t bytes = INLINE_SYSCALL(recvmsg, 3, handle->sock.fd, &hdr, 0);
|
|
|
|
|
|
if (IS_ERR(bytes))
|
|
|
switch (ERRNO(bytes)) {
|
|
@@ -607,7 +608,8 @@ static int tcp_read (PAL_HANDLE handle, int offset, int len, void * buf)
|
|
|
}
|
|
|
|
|
|
|
|
|
-static int tcp_write (PAL_HANDLE handle, int offset, int len, const void * buf)
|
|
|
+static int64_t tcp_write (PAL_HANDLE handle, uint64_t offset, uint64_t len,
|
|
|
+ const void * buf)
|
|
|
{
|
|
|
if (!IS_HANDLE_TYPE(handle, tcp) || !handle->sock.conn)
|
|
|
return -PAL_ERROR_NOTCONNECTION;
|
|
@@ -627,7 +629,7 @@ static int tcp_write (PAL_HANDLE handle, int offset, int len, const void * buf)
|
|
|
hdr.msg_controllen = 0;
|
|
|
hdr.msg_flags = 0;
|
|
|
|
|
|
- int bytes = INLINE_SYSCALL(sendmsg, 3, handle->sock.fd, &hdr, MSG_NOSIGNAL);
|
|
|
+ int64_t bytes = INLINE_SYSCALL(sendmsg, 3, handle->sock.fd, &hdr, MSG_NOSIGNAL);
|
|
|
|
|
|
if (IS_ERR(bytes))
|
|
|
switch(ERRNO(bytes)) {
|
|
@@ -800,7 +802,8 @@ static int udp_open (PAL_HANDLE *hdl, const char * type, const char * uri,
|
|
|
return -PAL_ERROR_NOTSUPPORT;
|
|
|
}
|
|
|
|
|
|
-static int udp_receive (PAL_HANDLE handle, int offset, int len, void * buf)
|
|
|
+static int64_t udp_receive (PAL_HANDLE handle, uint64_t offset, uint64_t len,
|
|
|
+ void * buf)
|
|
|
{
|
|
|
if (!IS_HANDLE_TYPE(handle, udp))
|
|
|
return -PAL_ERROR_NOTCONNECTION;
|
|
@@ -820,7 +823,7 @@ static int udp_receive (PAL_HANDLE handle, int offset, int len, void * buf)
|
|
|
hdr.msg_controllen = 0;
|
|
|
hdr.msg_flags = 0;
|
|
|
|
|
|
- int bytes = INLINE_SYSCALL(recvmsg, 3, handle->sock.fd, &hdr, 0);
|
|
|
+ int64_t bytes = INLINE_SYSCALL(recvmsg, 3, handle->sock.fd, &hdr, 0);
|
|
|
|
|
|
if (IS_ERR(bytes))
|
|
|
switch(ERRNO(bytes)) {
|
|
@@ -835,8 +838,8 @@ static int udp_receive (PAL_HANDLE handle, int offset, int len, void * buf)
|
|
|
return bytes;
|
|
|
}
|
|
|
|
|
|
-static int udp_receivebyaddr (PAL_HANDLE handle, int offset, int len,
|
|
|
- void * buf, char * addr, int addrlen)
|
|
|
+static int64_t udp_receivebyaddr (PAL_HANDLE handle, uint64_t offset, uint64_t len,
|
|
|
+ void * buf, char * addr, int addrlen)
|
|
|
{
|
|
|
if (!IS_HANDLE_TYPE(handle, udpsrv))
|
|
|
return -PAL_ERROR_NOTCONNECTION;
|
|
@@ -859,7 +862,7 @@ static int udp_receivebyaddr (PAL_HANDLE handle, int offset, int len,
|
|
|
hdr.msg_controllen = 0;
|
|
|
hdr.msg_flags = 0;
|
|
|
|
|
|
- int bytes = INLINE_SYSCALL(recvmsg, 3, handle->sock.fd, &hdr, 0);
|
|
|
+ int64_t bytes = INLINE_SYSCALL(recvmsg, 3, handle->sock.fd, &hdr, 0);
|
|
|
|
|
|
if (IS_ERR(bytes))
|
|
|
switch(ERRNO(bytes)) {
|
|
@@ -885,7 +888,8 @@ static int udp_receivebyaddr (PAL_HANDLE handle, int offset, int len,
|
|
|
return bytes;
|
|
|
}
|
|
|
|
|
|
-static int udp_send (PAL_HANDLE handle, int offset, int len, const void * buf)
|
|
|
+static int64_t udp_send (PAL_HANDLE handle, uint64_t offset, uint64_t len,
|
|
|
+ const void * buf)
|
|
|
{
|
|
|
if (!IS_HANDLE_TYPE(handle, udp))
|
|
|
return -PAL_ERROR_NOTCONNECTION;
|
|
@@ -905,7 +909,7 @@ static int udp_send (PAL_HANDLE handle, int offset, int len, const void * buf)
|
|
|
hdr.msg_controllen = 0;
|
|
|
hdr.msg_flags = 0;
|
|
|
|
|
|
- int bytes = INLINE_SYSCALL(sendmsg, 3, handle->sock.fd, &hdr, MSG_NOSIGNAL);
|
|
|
+ int64_t bytes = INLINE_SYSCALL(sendmsg, 3, handle->sock.fd, &hdr, MSG_NOSIGNAL);
|
|
|
|
|
|
if (IS_ERR(bytes))
|
|
|
switch(ERRNO(bytes)) {
|
|
@@ -927,8 +931,8 @@ static int udp_send (PAL_HANDLE handle, int offset, int len, const void * buf)
|
|
|
return bytes;
|
|
|
}
|
|
|
|
|
|
-static int udp_sendbyaddr (PAL_HANDLE handle, int offset, int len,
|
|
|
- const void * buf, const char * addr, int addrlen)
|
|
|
+static int64_t udp_sendbyaddr (PAL_HANDLE handle, uint64_t offset, uint64_t len,
|
|
|
+ const void * buf, const char * addr, int addrlen)
|
|
|
{
|
|
|
if (!IS_HANDLE_TYPE(handle, udpsrv))
|
|
|
return -PAL_ERROR_NOTCONNECTION;
|
|
@@ -964,7 +968,7 @@ static int udp_sendbyaddr (PAL_HANDLE handle, int offset, int len,
|
|
|
hdr.msg_controllen = 0;
|
|
|
hdr.msg_flags = 0;
|
|
|
|
|
|
- int bytes = INLINE_SYSCALL(sendmsg, 3, handle->sock.fd, &hdr, MSG_NOSIGNAL);
|
|
|
+ int64_t bytes = INLINE_SYSCALL(sendmsg, 3, handle->sock.fd, &hdr, MSG_NOSIGNAL);
|
|
|
|
|
|
if (IS_ERR(bytes))
|
|
|
switch(ERRNO(bytes)) {
|
|
@@ -1372,8 +1376,8 @@ err:
|
|
|
return NULL;
|
|
|
}
|
|
|
|
|
|
-static int mcast_send (PAL_HANDLE handle, int offset, int size,
|
|
|
- const void * buf)
|
|
|
+static int64_t mcast_send (PAL_HANDLE handle, uint64_t offset, uint64_t size,
|
|
|
+ const void * buf)
|
|
|
{
|
|
|
if (handle->mcast.srv == PAL_IDX_POISON)
|
|
|
return -PAL_ERROR_BADHANDLE;
|
|
@@ -1390,8 +1394,8 @@ static int mcast_send (PAL_HANDLE handle, int offset, int size,
|
|
|
hdr.msg_controllen = 0;
|
|
|
hdr.msg_flags = 0;
|
|
|
|
|
|
- int bytes = INLINE_SYSCALL(sendmsg, 3, handle->mcast.srv, &hdr,
|
|
|
- MSG_NOSIGNAL);
|
|
|
+ int64_t bytes = INLINE_SYSCALL(sendmsg, 3, handle->mcast.srv, &hdr,
|
|
|
+ MSG_NOSIGNAL);
|
|
|
|
|
|
if (IS_ERR(bytes))
|
|
|
switch(ERRNO(bytes)) {
|
|
@@ -1412,7 +1416,8 @@ static int mcast_send (PAL_HANDLE handle, int offset, int size,
|
|
|
return bytes;
|
|
|
}
|
|
|
|
|
|
-static int mcast_receive (PAL_HANDLE handle, int offset, int size, void * buf)
|
|
|
+static int64_t mcast_receive (PAL_HANDLE handle, uint64_t offset, uint64_t size,
|
|
|
+ void * buf)
|
|
|
{
|
|
|
if (handle->mcast.cli == PAL_IDX_POISON)
|
|
|
return -PAL_ERROR_BADHANDLE;
|
|
@@ -1429,7 +1434,7 @@ static int mcast_receive (PAL_HANDLE handle, int offset, int size, void * buf)
|
|
|
hdr.msg_controllen = 0;
|
|
|
hdr.msg_flags = 0;
|
|
|
|
|
|
- int bytes = INLINE_SYSCALL(recvmsg, 3, handle->mcast.cli, &hdr, 0);
|
|
|
+ int64_t bytes = INLINE_SYSCALL(recvmsg, 3, handle->mcast.cli, &hdr, 0);
|
|
|
|
|
|
if (IS_ERR(bytes))
|
|
|
return -PAL_ERROR_DENIED;
|