static int v9fs_receive_status(V9fsProxy *proxy,

                               struct iovec *reply, int *status)

{

    int retval;

    ProxyHeader header;



    *status = 0;

    reply->iov_len = 0;

    retval = socket_read(proxy->sockfd, reply->iov_base, PROXY_HDR_SZ);

    if (retval < 0) {

        return retval;

    }

    reply->iov_len = PROXY_HDR_SZ;

    proxy_unmarshal(reply, 0, "dd", &header.type, &header.size);

    if (header.size != sizeof(int)) {

        *status = -ENOBUFS;

        return 0;

    }

    retval = socket_read(proxy->sockfd,

                         reply->iov_base + PROXY_HDR_SZ, header.size);

    if (retval < 0) {

        return retval;

    }

    reply->iov_len += header.size;

    proxy_unmarshal(reply, PROXY_HDR_SZ, "d", status);

    return 0;

}

static int v9fs_receive_status(V9fsProxy *proxy,

                               struct iovec *reply, int *status)

{

    int retval;

    ProxyHeader header;



    *status = 0;

    reply->iov_len = 0;

    retval = socket_read(proxy->sockfd, reply->iov_base, PROXY_HDR_SZ);

    if (retval < 0) {

        return retval;

    }

    reply->iov_len = PROXY_HDR_SZ;

    proxy_unmarshal(reply, 0, "dd", &header.type, &header.size);

    if (header.size != sizeof(int)) {

        *status = -ENOBUFS;

        return 0;

    }

    retval = socket_read(proxy->sockfd,

                         reply->iov_base + PROXY_HDR_SZ, header.size);

    if (retval < 0) {

        return retval;

    }

    reply->iov_len += header.size;

    proxy_unmarshal(reply, PROXY_HDR_SZ, "d", status);

    return 0;

}

static int FUNC_0(V9fsProxy *VAR_0,

                               struct iovec *VAR_1, int *VAR_2)

{

    int VAR_3;

    ProxyHeader header;



    *VAR_2 = 0;

    VAR_1->iov_len = 0;

    VAR_3 = socket_read(VAR_0->sockfd, VAR_1->iov_base, PROXY_HDR_SZ);

    if (VAR_3 < 0) {

        return VAR_3;

    }

    VAR_1->iov_len = PROXY_HDR_SZ;

    proxy_unmarshal(VAR_1, 0, "dd", &header.type, &header.size);

    if (header.size != sizeof(int)) {

        *VAR_2 = -ENOBUFS;

        return 0;

    }

    VAR_3 = socket_read(VAR_0->sockfd,

                         VAR_1->iov_base + PROXY_HDR_SZ, header.size);

    if (VAR_3 < 0) {

        return VAR_3;

    }

    VAR_1->iov_len += header.size;

    proxy_unmarshal(VAR_1, PROXY_HDR_SZ, "d", VAR_2);

    return 0;

}

static int FUNC_0(V9fsProxy *VAR_0,
struct iovec *VAR_1, int *VAR_2)
{ int VAR_3; ProxyHeader header; *VAR_2 = 0; VAR_1->iov_len = 0; VAR_3 = socket_read(VAR_0->sockfd, VAR_1->iov_base, PROXY_HDR_SZ); if (VAR_3 < 0) { return VAR_3; } VAR_1->iov_len = PROXY_HDR_SZ; proxy_unmarshal(VAR_1, 0, "dd", &header.type, &header.size); if (header.size != sizeof(int)) { *VAR_2 = -ENOBUFS; return 0; } VAR_3 = socket_read(VAR_0->sockfd,
VAR_1->iov_base + PROXY_HDR_SZ, header.size); if (VAR_3 < 0) { return VAR_3; } VAR_1->iov_len += header.size; proxy_unmarshal(VAR_1, PROXY_HDR_SZ, "d", VAR_2); return 0; }