Changeset 1696 for zzuf


Ignore:
Timestamp:
Jan 18, 2007, 1:32:31 PM (14 years ago)
Author:
Sam Hocevar
Message:
  • Check recv() return type: int on Linux, ssize_t on OS X.
Location:
zzuf/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • zzuf/trunk/configure.ac

    r1695 r1696  
    3333 [AC_MSG_RESULT(int read(... unsigned int);)])
    3434
     35AC_MSG_CHECKING(for recv() return value)
     36ac_v_recv_t="int"
     37AC_TRY_COMPILE([#include <sys/types.h>
     38  #include <sys/socket.h>],
     39 [ssize_t recv(int s, void *buf, size_t len, int flags);],
     40 [ac_v_recv_t="ssize_t"])
     41AC_MSG_RESULT($ac_v_recv_t)
     42AC_DEFINE_UNQUOTED(RECV_T, $ac_v_recv_t, [Define to the recv() return type])
     43
    3544AC_CHECK_FUNCS(getopt_long,
    3645 [AC_DEFINE(HAVE_GETOPT_LONG, 1, Define to 1 if you have the `getopt_long' function.)],
  • zzuf/trunk/src/lib-fd.c

    r1695 r1696  
    8181#endif
    8282#if defined HAVE_RECV
    83 static int     (*recv_orig)    (int s, void *buf, size_t len, int flags);
     83static RECV_T  (*recv_orig)    (int s, void *buf, size_t len, int flags);
    8484#endif
    8585#if defined HAVE_RECVFROM
    86 static int     (*recvfrom_orig)(int s, void *buf, size_t len, int flags,
     86static RECV_T  (*recvfrom_orig)(int s, void *buf, size_t len, int flags,
    8787                                struct sockaddr *from, SOCKLEN_T *fromlen);
    8888#endif
    8989#if defined HAVE_RECVMSG
    90 static int     (*recvmsg_orig) (int s,  struct msghdr *hdr, int flags);
     90static RECV_T  (*recvmsg_orig) (int s,  struct msghdr *hdr, int flags);
    9191#endif
    9292#if defined READ_USES_SSIZE_T
     
    196196
    197197#if defined HAVE_RECV
    198 int recv(int s, void *buf, size_t len, int flags)
     198RECV_T recv(int s, void *buf, size_t len, int flags)
    199199{
    200200    int ret;
     
    228228
    229229#if defined HAVE_RECVFROM
    230 int recvfrom(int s, void *buf, size_t len, int flags,
     230RECV_T recvfrom(int s, void *buf, size_t len, int flags,
    231231             struct sockaddr *from, SOCKLEN_T *fromlen)
    232232{
     
    262262
    263263#if defined HAVE_RECVMSG
    264 int recvmsg(int s, struct msghdr *hdr, int flags)
     264RECV_T recvmsg(int s, struct msghdr *hdr, int flags)
    265265{
    266266    ssize_t ret;
Note: See TracChangeset for help on using the changeset viewer.