static abi_long do_bind(int sockfd, abi_ulong target_addr,

                        socklen_t addrlen)

{

    void *addr;

    abi_long ret;



    if (addrlen < 0)

        return -TARGET_EINVAL;



    addr = alloca(addrlen+1);



    ret = target_to_host_sockaddr(addr, target_addr, addrlen);

    if (ret)

        return ret;



    return get_errno(bind(sockfd, addr, addrlen));

}

static abi_long do_bind(int sockfd, abi_ulong target_addr,

                        socklen_t addrlen)

{

    void *addr;

    abi_long ret;



    if (addrlen < 0)

        return -TARGET_EINVAL;



    addr = alloca(addrlen+1);



    ret = target_to_host_sockaddr(addr, target_addr, addrlen);

    if (ret)

        return ret;



    return get_errno(bind(sockfd, addr, addrlen));

}

static abi_long FUNC_0(int sockfd, abi_ulong target_addr,

                        socklen_t addrlen)

{

    void *VAR_0;

    abi_long ret;



    if (addrlen < 0)

        return -TARGET_EINVAL;



    VAR_0 = alloca(addrlen+1);



    ret = target_to_host_sockaddr(VAR_0, target_addr, addrlen);

    if (ret)

        return ret;



    return get_errno(bind(sockfd, VAR_0, addrlen));

}

static abi_long FUNC_0(int sockfd, abi_ulong target_addr,
socklen_t addrlen)
{ void *VAR_0; abi_long ret; if (addrlen < 0)
return -TARGET_EINVAL; VAR_0 = alloca(addrlen+1); ret = target_to_host_sockaddr(VAR_0, target_addr, addrlen); if (ret)
return ret; return get_errno(bind(sockfd, VAR_0, addrlen)); }