/* open a file and send fd on success return -errno on error  */
static int do_open(struct iovec *iovec)
/* open a file and send fd on success return -errno on error  */
static int do_open(struct iovec *iovec)
{
    int flags, ret;
    V9fsString path;
    v9fs_string_init(&path);
    ret = proxy_unmarshal(iovec, PROXY_HDR_SZ, "sd", &path, &flags);
    if (ret < 0) {
        goto err_out;
    }
    ret = open(path.data, flags);
    if (ret < 0) {
        ret = -errno;
    }
err_out:
    v9fs_string_free(&path);
    return ret;
}