TS_OPEN_RESTRICTED(3)

πŸ’– ts_open_restricted β€” the manual page, but make it make sense πŸ’–

okay bestie, welcome to tslib's ts_open_restricted(3) page, except now it's fun and also you'll actually remember it. sit down, hydrate, let's go 🫢


✨ NAME ✨

ts_open_restricted β€” the way you plug in your own little custom function for opening the touchscreen's input device file. yes, YOUR function. you're the main character now πŸ‘‘


🌸 SYNOPSIS 🌸

#include <tslib.h>

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

that's it, that's the whole vibe. a function pointer, living its best life ✨


πŸ¦‹ DESCRIPTION πŸ¦‹

so ts_open_restricted() is the icon we call when libts should not be run as root. like, imagine not wanting your whole touchscreen stack to have god-mode privileges. valid. iconic. security-conscious πŸ’…

if you implement a function like this yourself and assign it to the ts_open_restricted pointer, then ts_open() will call your function instead of hitting the open() system call directly. the way that works is literally chef's kiss πŸŽ€

your function should open the input device at path with flags, while user_data is currently unused. that's it. do your thing, bestie πŸ’–

heads up: user_data is currently unused β€” don't go building your whole personality around it, fr fr πŸ™ˆ

⭐ RETURN VALUE ⭐

the touchscreen input device's file descriptor. give it back, it's what the people want 🫢


πŸ”₯ SEE ALSO πŸ”₯

go read those too, they're all part of the same friendship group 🌈


and that's the whole page, bestie!! this one came out of the tslib crew β€” the ts_open_restricted(3) page, tslib edition, no cap πŸ’…βœ¨