1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

Merge pull request #20 from benpicco/master

Make sendto() and accept() interfaces conform to POSIX,
This commit is contained in:
Oleg 2013-03-07 09:51:07 -08:00
commit 5eb5b1b4e9
2 changed files with 4 additions and 4 deletions

View File

@ -888,7 +888,7 @@ int32_t recvfrom(int s, void *buf, uint32_t len, int flags, sockaddr6_t *from, u
}
}
int32_t sendto(int s, void *msg, uint32_t len, int flags, sockaddr6_t *to, uint32_t tolen)
int32_t sendto(int s, const void *msg, uint32_t len, int flags, sockaddr6_t *to, uint32_t tolen)
{
if (isUDPSocket(s) && (getSocket(s)->socket_values.foreign_address.sin6_port == 0))
{
@ -1176,7 +1176,7 @@ int handle_new_tcp_connection(socket_internal_t *current_queued_int_socket, sock
return current_queued_int_socket->socket_id;
}
int accept(int s, sockaddr6_t *addr, uint32_t addrlen)
int accept(int s, sockaddr6_t *addr, uint32_t *addrlen)
{
socket_internal_t *server_socket = getSocket(s);
if (isTCPSocket(s) && (server_socket->socket_values.tcp_control.state == LISTEN))

View File

@ -194,13 +194,13 @@ int connect(int socket, sockaddr6_t *addr, uint32_t addrlen);
socket_internal_t *getWaitingConnectionSocket(int socket, ipv6_hdr_t *ipv6_header, tcp_hdr_t *tcp_header);
void close_socket(socket_internal_t *current_socket);
int32_t recvfrom( int s, void *buf, uint32_t len, int flags, sockaddr6_t *from, uint32_t *fromlen );
int32_t sendto( int s, void *msg, uint32_t len, int flags, sockaddr6_t *to, uint32_t tolen);
int32_t sendto( int s, const void *msg, uint32_t len, int flags, sockaddr6_t *to, uint32_t tolen);
int32_t send(int s, void *msg, uint32_t len, int flags);
int recv(int s, void *buf, uint32_t len, int flags);
int close(int s);
int bind(int s, sockaddr6_t *name, int namelen);
int listen(int s, int backlog);
int accept(int s, sockaddr6_t *addr, uint32_t addrlen);
int accept(int s, sockaddr6_t *addr, uint32_t *addrlen);
void socket_init(void);
socket_internal_t *get_udp_socket(ipv6_hdr_t *ipv6_header, udp_hdr_t *udp_header);
socket_internal_t *get_tcp_socket(ipv6_hdr_t *ipv6_header, tcp_hdr_t *tcp_header);