---
name: "gensio_open"
section: "3"
platform: "linux"
package: "gensio"
version: "3.0.4-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/gensio_open"
---

# gensio\_open(3)

Start a connecting gensio

## NAME

gensio\_open, gensio\_open\_s, gensio\_open\_nochild, gensio\_open\_nochild\_s - Start a connecting gensio

## SYNOPSIS

**#include \<gensio/gensio.h\>**

- **typedef void (\*gensio\_done\_err)(struct gensio \*io, int err,**

  **void \*open\_data);**

- **int gensio\_open(struct gensio \*io, gensio\_done\_err open\_done,**

  **void \*open\_data);**

- **int gensio\_open\_s(struct gensio \*io);**

  - **int gensio\_open\_nochild(struct gensio \*io, gensio\_done\_err open\_done,**

  **void \*open\_data);**

- int gensio\_open\_nochild\_s(struct gensio \*io);

  ## DESCRIPTION

**gensio\_open** starts the gensio.  gensios received from an accepter are open upon receipt, but connecting gensios are started closed and need to be opened before use.  If no error is returned, the *open\_done* callback will be called, if there is no error in the callback *err* value the gensio will be open.  This will open all children, too.

Note that the **open\_done** callback will always be called even if you close the gensio before the **open\_done** callback happens or if an error occurs.  This is guaranteed.

**gensio\_open\_s** is like **gensio\_open, but waits for the open to complete. Normal gensio** processing will happen while waiting.  Note that you must be careful to not call this from a callback, you should only call this from a non-callback thread or a runner (see [gensio\_os\_funcs(3)](/gensio_os_funcs/3.md) for details on runners).

**gensio\_open\_nochild** is like **gensio\_open,** but assumes any child gensios are already open and just opens this gensio.  This can be useful if you have a gensio that is already opened (like you received it from an accepter) and you want to stack another gensio on top of it.  Only filter gensios will support this.

**gensio\_open\_nochild\_s** is like **gensio\_open\_nochild,** but waits for the open to complete.  See the notes on **gensio\_open\_s** above for warnings.

## RETURN VALUES

Zero is returned on success, or a gensio error on failure.

## SEE ALSO

[gensio\_err(3)](/gensio_err/3.md), [gensio(5)](/gensio/5.md), [gensio\_os\_funcs(3)](/gensio_os_funcs/3.md)
