---
name: "ts_close_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_close_restricted"
---

# ts\_close\_restricted(3)

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

## NAME

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

## SYNOPSIS

```
#include <tslib.h>

void (*ts_close_restricted)(int fd, void *user_data);

```

## DESCRIPTION

**ts\_close\_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\_close\_restricted pointer, it will be called by ts\_close() instead of the close() system call directly.

It should obviously close the device with file descriptor **fd** while **user\_data** is currently unused.

## SEE ALSO

[**ts\_open\_restricted**(3)](/ts_open_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)
