int v9fs_co_readlink(V9fsPDU *pdu, V9fsPath *path, V9fsString *buf)

{

    int err;

    ssize_t len;

    V9fsState *s = pdu->s;



    if (v9fs_request_cancelled(pdu)) {

        return -EINTR;

    }

    buf->data = g_malloc(PATH_MAX);

    v9fs_path_read_lock(s);

    v9fs_co_run_in_worker(

        {

            len = s->ops->readlink(&s->ctx, path,

                                   buf->data, PATH_MAX - 1);

            if (len > -1) {

                buf->size = len;

                buf->data[len] = 0;

                err = 0;

            } else {

                err = -errno;

            }

        });

    v9fs_path_unlock(s);

    if (err) {

        g_free(buf->data);

        buf->data = NULL;

        buf->size = 0;

    }

    return err;

}

int v9fs_co_readlink(V9fsPDU *pdu, V9fsPath *path, V9fsString *buf)

{

    int err;

    ssize_t len;

    V9fsState *s = pdu->s;



    if (v9fs_request_cancelled(pdu)) {

        return -EINTR;

    }

    buf->data = g_malloc(PATH_MAX);

    v9fs_path_read_lock(s);

    v9fs_co_run_in_worker(

        {

            len = s->ops->readlink(&s->ctx, path,

                                   buf->data, PATH_MAX - 1);

            if (len > -1) {

                buf->size = len;

                buf->data[len] = 0;

                err = 0;

            } else {

                err = -errno;

            }

        });

    v9fs_path_unlock(s);

    if (err) {

        g_free(buf->data);

        buf->data = NULL;

        buf->size = 0;

    }

    return err;

}

int FUNC_0(V9fsPDU *VAR_0, V9fsPath *VAR_1, V9fsString *VAR_2)

{

    int VAR_3;

    ssize_t len;

    V9fsState *s = VAR_0->s;



    if (v9fs_request_cancelled(VAR_0)) {

        return -EINTR;

    }

    VAR_2->data = g_malloc(PATH_MAX);

    v9fs_path_read_lock(s);

    v9fs_co_run_in_worker(

        {

            len = s->ops->readlink(&s->ctx, VAR_1,

                                   VAR_2->data, PATH_MAX - 1);

            if (len > -1) {

                VAR_2->size = len;

                VAR_2->data[len] = 0;

                VAR_3 = 0;

            } else {

                VAR_3 = -errno;

            }

        });

    v9fs_path_unlock(s);

    if (VAR_3) {

        g_free(VAR_2->data);

        VAR_2->data = NULL;

        VAR_2->size = 0;

    }

    return VAR_3;

}

int FUNC_0(V9fsPDU *VAR_0, V9fsPath *VAR_1, V9fsString *VAR_2)
{ int VAR_3; ssize_t len; V9fsState *s = VAR_0->s; if (v9fs_request_cancelled(VAR_0)) { return -EINTR; } VAR_2->data = g_malloc(PATH_MAX); v9fs_path_read_lock(s); v9fs_co_run_in_worker(
{ len = s->ops->readlink(&s->ctx, VAR_1,
VAR_2->data, PATH_MAX - 1); if (len > -1) { VAR_2->size = len; VAR_2->data[len] = 0; VAR_3 = 0; } else { VAR_3 = -errno; } }); v9fs_path_unlock(s); if (VAR_3) { g_free(VAR_2->data); VAR_2->data = NULL; VAR_2->size = 0; } return VAR_3; }