---
name: "gensio_acc_set_sync"
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_acc_accept_s"
---

# gensio\_acc\_set\_sync(3)

Synchronous I/O operations on a gensio accepter

Part of [gensio\_acc\_accept\_s(3)](/gensio_acc_accept_s/3.md).

## NAME

gensio\_acc\_set\_sync, gensio\_acc\_accept\_s, gensio\_acc\_accept\_s\_intr - Synchronous I/O operations on a gensio accepter

## SYNOPSIS

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

- **int gensio\_acc\_set\_sync(struct gensio\_accepter \*acc);**

  - **int gensio\_acc\_accept\_s(struct gensio\_accepter \*acc,**

  **struct gensio\_time \*timeout,**\
   **struct gensio \*\*new\_io);**

- **int gensio\_acc\_accept\_s\_intr(struct gensio\_accepter \*acc,**

  **struct gensio\_time \*timeout,**\
   **struct gensio \*\*new\_io);**

## DESCRIPTION

Normal gensio accepter operation is asynchronous callback based.  This serves most programs fairly well, especially if they need to handle multiple accepts on the same or different accepters.

But occasionally you need to do something synchronous with the program execution, especially if you have a simple program that just accepts one connection and then does something.

**gensio\_acc set\_sync** sets up the gensio accepter for synchronous accepts.  If you do this, the event callback that is currently registered will no longer receive new connection events.  It \*will\* receive other callbacks.  You must call this before starting up the gensio accepter, and once you call it the gensio accepter is in sync mode until you shut it down.

**gensio\_accept\_s** Waits for an incoming connection on the gensio accepter. This function waits for the amount of time in *timeout.* *timeout* is updated to the amount of time left to wait.  If *timeout* is NULL, wait forever.  If no error is returned, the new incoming connection is returned in *new\_io.*

**gensio\_accept\_s\_intr** is like **gensio\_accept\_s,** but it return immediately if an signal interrupt occurs.  On systems without signals, this is the same as **gensio\_accept\_s.**

## RETURN VALUES

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

## SEE ALSO

[gensio\_err(3)](/gensio_err/3.md), [gensio\_set\_sync(3)](/gensio_set_sync/3.md), [gensio(5)](/gensio/5.md)
