+2009-03-01 Bruno Haible <bruno@clisp.org>
+
+ Use socklen_t in the native Windows replacements prototypes.
+ * lib/sys_socket.in.h (rpl_getsockopt, rpl_setsockopt): Use socklen_t
+ instead of 'int'.
+ * lib/getsockopt.c (rpl_getsockopt): Likewise.
+ * lib/setsockopt.c (rpl_setsockopt): Likewise.
+ * modules/getsockopt (Depends-on): Add socklen.
+ * modules/setsockopt (Depends-on): Add socklen.
+
2009-03-01 Bruno Haible <bruno@clisp.org>
* gnulib-tool (sed): Do alias as "sed --posix" if sed's version is at
/* getsockopt.c --- wrappers for Windows getsockopt function
- Copyright (C) 2008 Free Software Foundation, Inc.
+ Copyright (C) 2008-2009 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
#undef getsockopt
int
-rpl_getsockopt (int fd, int level, int optname, void *optval, int *optlen)
+rpl_getsockopt (int fd, int level, int optname, void *optval, socklen_t *optlen)
{
int r;
SOCKET sock = FD_TO_SOCKET (fd);
tv.tv_usec = (milliseconds - 1000 * tv.tv_sec) * 1000;
n = sizeof (struct timeval);
if (n > *optlen)
- n = *optlen;
+ n = *optlen;
memcpy (optval, &tv, n);
*optlen = n;
}
/* setsockopt.c --- wrappers for Windows setsockopt function
- Copyright (C) 2008 Free Software Foundation, Inc.
+ Copyright (C) 2008-2009 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
#undef setsockopt
int
-rpl_setsockopt (int fd, int level, int optname, const void *optval, int optlen)
+rpl_setsockopt (int fd, int level, int optname, const void *optval, socklen_t optlen)
{
int r;
SOCKET sock = FD_TO_SOCKET (fd);
/* Provide a sys/socket header file for systems lacking it (read: MinGW)
and for systems where it is incomplete.
- Copyright (C) 2005-2008 Free Software Foundation, Inc.
+ Copyright (C) 2005-2009 Free Software Foundation, Inc.
Written by Simon Josefsson.
This program is free software; you can redistribute it and/or modify
# if @HAVE_WINSOCK2_H@
# undef getsockopt
# define getsockopt rpl_getsockopt
-extern int rpl_getsockopt (int, int, int, void *, int *);
+extern int rpl_getsockopt (int, int, int, void *, socklen_t *);
# endif
# elif @HAVE_WINSOCK2_H@
# undef getsockopt
# if @HAVE_WINSOCK2_H@
# undef setsockopt
# define setsockopt rpl_setsockopt
-extern int rpl_setsockopt (int, int, int, const void *, int);
+extern int rpl_setsockopt (int, int, int, const void *, socklen_t);
# endif
# elif @HAVE_WINSOCK2_H@
# undef setsockopt
Depends-on:
sys_socket
sys_time
+socklen
errno
configure.ac:
Depends-on:
sys_socket
sys_time
+socklen
errno
configure.ac: