broadway backend: allow building on OpenBSD
On OpenBSD shm_open(3) is part of libc and there is not librt, so add an according check. Check if we have posix_fallocate before using it. https://bugzilla.gnome.org/show_bug.cgi?id=728272
This commit is contained in:
@ -540,12 +540,14 @@ map_named_shm (char *name, gsize size)
|
||||
res = ftruncate (fd, size);
|
||||
g_assert (res != -1);
|
||||
|
||||
#ifdef HAVE_POSIX_FALLOCATE
|
||||
res = posix_fallocate (fd, 0, size);
|
||||
if (res != 0)
|
||||
{
|
||||
shm_unlink (name);
|
||||
g_error ("Not enough shared memory for window surface");
|
||||
}
|
||||
#endif
|
||||
|
||||
ptr = mmap(0, size, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user