mirror of
git://sourceware.org/git/newlib-cygwin.git
synced 2025-01-18 04:19:21 +08:00
* net.cc (cygwin_sendto): Define appropriate parameters using
socklen_t type according to SUSv3. (cygwin_recvfrom): Ditto. (cygwin_setsockopt): Ditto. (cygwin_getsockopt): Ditto. (cygwin_connect): Ditto. (cygwin_accept): Ditto. (cygwin_bind): Ditto. (cygwin_getsockname): Ditto. (cygwin_getpeername): Ditto. (cygwin_recv): Ditto. (cygwin_send): Ditto. * include/cygwin/socket.h (socklen_t): Typedef and define. * include/sys/socket.h: Declare socket functions using socklen_t type.
This commit is contained in:
parent
37b43cde0c
commit
78db7dff2c
@ -1,3 +1,20 @@
|
||||
2006-07-03 Corinna Vinschen <corinna@vinschen.de>
|
||||
|
||||
* net.cc (cygwin_sendto): Define appropriate parameters using
|
||||
socklen_t type according to SUSv3.
|
||||
(cygwin_recvfrom): Ditto.
|
||||
(cygwin_setsockopt): Ditto.
|
||||
(cygwin_getsockopt): Ditto.
|
||||
(cygwin_connect): Ditto.
|
||||
(cygwin_accept): Ditto.
|
||||
(cygwin_bind): Ditto.
|
||||
(cygwin_getsockname): Ditto.
|
||||
(cygwin_getpeername): Ditto.
|
||||
(cygwin_recv): Ditto.
|
||||
(cygwin_send): Ditto.
|
||||
* include/cygwin/socket.h (socklen_t): Typedef and define.
|
||||
* include/sys/socket.h: Declare socket functions using socklen_t type.
|
||||
|
||||
2006-07-02 Christopher Faylor <cgf@timesys.com>
|
||||
|
||||
* include/cygwin/version.h: Bump DLL minor version number to 21.
|
||||
|
@ -17,8 +17,11 @@ extern "C" {
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
/* Not unsigned for backward compatibility. Keep #define for backward
|
||||
compatibility. */
|
||||
#ifndef socklen_t
|
||||
#define socklen_t int /* Not unsigned for backward compat. */
|
||||
typedef int socklen_t;
|
||||
#define socklen_t socklen_t
|
||||
#endif
|
||||
|
||||
typedef uint16_t sa_family_t;
|
||||
|
@ -26,22 +26,24 @@ extern "C"
|
||||
#define SHUT_RDWR 2 /* == Win32 SD_BOTH */
|
||||
|
||||
#ifndef __INSIDE_CYGWIN_NET__
|
||||
int accept (int, struct sockaddr *__peer, int *);
|
||||
int bind (int, const struct sockaddr *__my_addr, int __addrlen);
|
||||
int connect (int, const struct sockaddr *, int);
|
||||
int getpeername (int, struct sockaddr *__peer, int *);
|
||||
int getsockname (int, struct sockaddr *__addr, int *);
|
||||
int accept (int, struct sockaddr *__peer, socklen_t *);
|
||||
int bind (int, const struct sockaddr *__my_addr, socklen_t __addrlen);
|
||||
int connect (int, const struct sockaddr *, socklen_t);
|
||||
int getpeername (int, struct sockaddr *__peer, socklen_t *);
|
||||
int getsockname (int, struct sockaddr *__addr, socklen_t *);
|
||||
int listen (int, int __n);
|
||||
int recv (int, void *__buff, int __len, int __flags);
|
||||
int recvfrom (int, void *__buff, int __len, int __flags,
|
||||
struct sockaddr *__from, int *__fromlen);
|
||||
int recv (int, void *__buff, size_t __len, int __flags);
|
||||
int recvfrom (int, void *__buff, size_t __len, int __flags,
|
||||
struct sockaddr *__from, socklen_t *__fromlen);
|
||||
int recvmsg(int s, struct msghdr *msg, int flags);
|
||||
int send (int, const void *__buff, int __len, int __flags);
|
||||
int send (int, const void *__buff, size_t __len, int __flags);
|
||||
int sendmsg(int s, const struct msghdr *msg, int flags);
|
||||
int sendto (int, const void *, int __len, int __flags,
|
||||
const struct sockaddr *__to, int __tolen);
|
||||
int setsockopt (int __s, int __level, int __optname, const void *optval, int __optlen);
|
||||
int getsockopt (int __s, int __level, int __optname, void *__optval, int *__optlen);
|
||||
int sendto (int, const void *, size_t __len, int __flags,
|
||||
const struct sockaddr *__to, socklen_t __tolen);
|
||||
int setsockopt (int __s, int __level, int __optname, const void *optval,
|
||||
socklen_t __optlen);
|
||||
int getsockopt (int __s, int __level, int __optname, void *__optval,
|
||||
socklen_t *__optlen);
|
||||
int shutdown (int, int);
|
||||
int socket (int __family, int __type, int __protocol);
|
||||
int socketpair (int __domain, int __type, int __protocol, int *__socket_vec);
|
||||
|
@ -623,8 +623,8 @@ done:
|
||||
|
||||
/* exported as sendto: standards? */
|
||||
extern "C" int
|
||||
cygwin_sendto (int fd, const void *buf, int len, int flags,
|
||||
const struct sockaddr *to, int tolen)
|
||||
cygwin_sendto (int fd, const void *buf, size_t len, int flags,
|
||||
const struct sockaddr *to, socklen_t tolen)
|
||||
{
|
||||
int res;
|
||||
sig_dispatch_pending ();
|
||||
@ -645,8 +645,8 @@ cygwin_sendto (int fd, const void *buf, int len, int flags,
|
||||
|
||||
/* exported as recvfrom: standards? */
|
||||
extern "C" int
|
||||
cygwin_recvfrom (int fd, void *buf, int len, int flags,
|
||||
struct sockaddr *from, int *fromlen)
|
||||
cygwin_recvfrom (int fd, void *buf, size_t len, int flags,
|
||||
struct sockaddr *from, socklen_t *fromlen)
|
||||
{
|
||||
int res;
|
||||
sig_dispatch_pending ();
|
||||
@ -689,7 +689,7 @@ convert_ws1_ip_optname (int optname)
|
||||
/* exported as setsockopt: standards? */
|
||||
extern "C" int
|
||||
cygwin_setsockopt (int fd, int level, int optname, const void *optval,
|
||||
int optlen)
|
||||
socklen_t optlen)
|
||||
{
|
||||
int res;
|
||||
fhandler_socket *fh = get (fd);
|
||||
@ -753,7 +753,8 @@ cygwin_setsockopt (int fd, int level, int optname, const void *optval,
|
||||
|
||||
/* exported as getsockopt: standards? */
|
||||
extern "C" int
|
||||
cygwin_getsockopt (int fd, int level, int optname, void *optval, int *optlen)
|
||||
cygwin_getsockopt (int fd, int level, int optname, void *optval,
|
||||
socklen_t *optlen)
|
||||
{
|
||||
int res;
|
||||
fhandler_socket *fh = get (fd);
|
||||
@ -803,7 +804,7 @@ getpeereid (int fd, __uid32_t *euid, __gid32_t *egid)
|
||||
|
||||
/* exported as connect: standards? */
|
||||
extern "C" int
|
||||
cygwin_connect (int fd, const struct sockaddr *name, int namelen)
|
||||
cygwin_connect (int fd, const struct sockaddr *name, socklen_t namelen)
|
||||
{
|
||||
int res;
|
||||
sig_dispatch_pending ();
|
||||
@ -986,7 +987,7 @@ cygwin_gethostbyaddr (const char *addr, int len, int type)
|
||||
|
||||
/* exported as accept: standards? */
|
||||
extern "C" int
|
||||
cygwin_accept (int fd, struct sockaddr *peer, int *len)
|
||||
cygwin_accept (int fd, struct sockaddr *peer, socklen_t *len)
|
||||
{
|
||||
int res;
|
||||
sig_dispatch_pending ();
|
||||
@ -1017,7 +1018,7 @@ cygwin_accept (int fd, struct sockaddr *peer, int *len)
|
||||
|
||||
/* exported as bind: standards? */
|
||||
extern "C" int
|
||||
cygwin_bind (int fd, const struct sockaddr *my_addr, int addrlen)
|
||||
cygwin_bind (int fd, const struct sockaddr *my_addr, socklen_t addrlen)
|
||||
{
|
||||
int res;
|
||||
sig_dispatch_pending ();
|
||||
@ -1035,7 +1036,7 @@ cygwin_bind (int fd, const struct sockaddr *my_addr, int addrlen)
|
||||
|
||||
/* exported as getsockname: standards? */
|
||||
extern "C" int
|
||||
cygwin_getsockname (int fd, struct sockaddr *addr, int *namelen)
|
||||
cygwin_getsockname (int fd, struct sockaddr *addr, socklen_t *namelen)
|
||||
{
|
||||
int res;
|
||||
sig_dispatch_pending ();
|
||||
@ -1137,7 +1138,7 @@ cygwin_herror (const char *s)
|
||||
|
||||
/* exported as getpeername: standards? */
|
||||
extern "C" int
|
||||
cygwin_getpeername (int fd, struct sockaddr *name, int *len)
|
||||
cygwin_getpeername (int fd, struct sockaddr *name, socklen_t *len)
|
||||
{
|
||||
int res;
|
||||
sig_dispatch_pending ();
|
||||
@ -1156,14 +1157,14 @@ cygwin_getpeername (int fd, struct sockaddr *name, int *len)
|
||||
|
||||
/* exported as recv: standards? */
|
||||
extern "C" int
|
||||
cygwin_recv (int fd, void *buf, int len, int flags)
|
||||
cygwin_recv (int fd, void *buf, size_t len, int flags)
|
||||
{
|
||||
return cygwin_recvfrom (fd, buf, len, flags, NULL, NULL);
|
||||
}
|
||||
|
||||
/* exported as send: standards? */
|
||||
extern "C" int
|
||||
cygwin_send (int fd, const void *buf, int len, int flags)
|
||||
cygwin_send (int fd, const void *buf, size_t len, int flags)
|
||||
{
|
||||
return cygwin_sendto (fd, buf, len, flags, NULL, 0);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user