static abi_long unlock_iovec(struct iovec *vec, abi_ulong target_addr,

                             int count, int copy)

{

    struct target_iovec *target_vec;

    abi_ulong base;

    int i;



    target_vec = lock_user(VERIFY_READ, target_addr, count * sizeof(struct target_iovec), 1);

    if (!target_vec)

        return -TARGET_EFAULT;

    for(i = 0;i < count; i++) {

        base = tswapl(target_vec[i].iov_base);

        unlock_user(vec[i].iov_base, base, copy ? vec[i].iov_len : 0);

    }

    unlock_user (target_vec, target_addr, 0);



    return 0;

}

static abi_long unlock_iovec(struct iovec *vec, abi_ulong target_addr,

                             int count, int copy)

{

    struct target_iovec *target_vec;

    abi_ulong base;

    int i;



    target_vec = lock_user(VERIFY_READ, target_addr, count * sizeof(struct target_iovec), 1);

    if (!target_vec)

        return -TARGET_EFAULT;

    for(i = 0;i < count; i++) {

        base = tswapl(target_vec[i].iov_base);

        unlock_user(vec[i].iov_base, base, copy ? vec[i].iov_len : 0);

    }

    unlock_user (target_vec, target_addr, 0);



    return 0;

}

static abi_long FUNC_0(struct iovec *vec, abi_ulong target_addr,

                             int count, int copy)

{

    struct target_iovec *VAR_0;

    abi_ulong base;

    int VAR_1;



    VAR_0 = lock_user(VERIFY_READ, target_addr, count * sizeof(struct target_iovec), 1);

    if (!VAR_0)

        return -TARGET_EFAULT;

    for(VAR_1 = 0;VAR_1 < count; VAR_1++) {

        base = tswapl(VAR_0[VAR_1].iov_base);

        unlock_user(vec[VAR_1].iov_base, base, copy ? vec[VAR_1].iov_len : 0);

    }

    unlock_user (VAR_0, target_addr, 0);



    return 0;

}

static abi_long FUNC_0(struct iovec *vec, abi_ulong target_addr,
int count, int copy)
{ struct target_iovec *VAR_0; abi_ulong base; int VAR_1; VAR_0 = lock_user(VERIFY_READ, target_addr, count * sizeof(struct target_iovec), 1); if (!VAR_0)
return -TARGET_EFAULT; for(VAR_1 = 0;VAR_1 < count; VAR_1++) { base = tswapl(VAR_0[VAR_1].iov_base); unlock_user(vec[VAR_1].iov_base, base, copy ? vec[VAR_1].iov_len : 0); } unlock_user (VAR_0, target_addr, 0); return 0; }