Even a compositor is unnecessary to fix screen tearing these days: https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests...
> The corrected standard C source code might look like this (still disregarding error handling and short writes):
>
> void
> write_string (int fd, const char \*s)
> {
> write (1, s, strlen (s));
> }
And disregarding the passed file descriptor! :)