cursor: handle running out of buffer space
cursor: handle running out of buffer space

If posix_fallocate is available, use it to detect when we are running
out of buffer space.

Propagate the failure properly through the various functions, stopping
loading cursors but keeping the cursors that were already successfully
loaded.

This may result in an animated cursor not having all of its images, or a
cursor theme not having all of its cursors. When that happens, the
failure is NOT communicated to the application. Instead, the application
will get NULL from wl_cursor_theme_get_cursor() for a cursor that was
not loaded successfully. If an animated cursor is missing only some
images, the animation is truncated but the cursor is still available.

This patch relies on the commit "os: use posix_fallocate in creating
sharable buffers" for defining HAVE_POSIX_FALLOCATE.

Signed-off-by: Pekka Paalanen <0f6ae7001e34c37b02fb2c1c2573ddf8f442136a@collabora.co.uk>

bitfactor/wayland,abooij/wayland,sir-murray/wayland,abooij/wayland,tulcod/wayland,eyolfson/wayland,tulcod/wayland,bitfactor/wayland,mchalupa/wayland,sir-murray/wayland,bitfactor/wayland,mchalupa/wayland,eyolfson/wayland,mchalupa/wayland,tulcod/wayland,abooij/wayland,eyolfson/wayland,sir-murray/wayland