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

# ts\_open\_restricted(3)

use a custom function for opening the touchscreen's input device file

## NAME

ts\_open\_restricted - use a custom function for opening the touchscreen's input device file

## SYNOPSIS

```
#include <tslib.h>

int (*ts_open_restricted)(const char *path, int flags, void *user_data);

```

## DESCRIPTION

**ts\_open\_restricted**() is useful if libts should not be run as root. If such a function is implemented by the user and assigned to the ts\_open\_restricted pointer, it will be called by ts\_open() instead of the open() system call directly.

It should open the input device at **path** with **flags** while **user\_data** is currently unused.

## RETURN VALUE

the touchscreen input device' file descriptor

## SEE ALSO

[**ts\_close\_restricted**(3)](/ts_close_restricted/3.md), [**ts\_open**(3)](/ts_open/3.md), [**ts\_setup**(3)](/ts_setup/3.md), [**ts\_close**(3)](/ts_close/3.md), [**ts.conf**(5)](/ts.conf/5.md)
