termux-packages/packages/util-linux/sys-utils-ipcmk.c.patch
vhqtvn d220576dfb
fix some non-building packages (#7058)
* fix ccache building failed due to sse

* gogs require go-bindata to be built

* mariadb's cmake need to change END to ENDIF

* fix neovim building due to gitsubmodule usage

* php-redis: add blacklist from php dep

* rlwrap update to new version

* stfl disable perl and ruby

* util-linux comment out shm & sem support

* weechat disable ruby

* tor building need glob
2021-06-27 17:33:45 +03:00

53 lines
1.0 KiB
Diff

--- ./sys-utils/ipcmk.c.orig 2021-06-05 14:50:46.811230515 +0000
+++ ./sys-utils/ipcmk.c 2021-06-05 14:52:14.776138430 +0000
@@ -26,8 +26,10 @@
#include <stdlib.h>
#include <sys/ipc.h>
#include <sys/msg.h>
+#ifndef __ANDROID__
#include <sys/sem.h>
#include <sys/shm.h>
+#endif
#include <sys/time.h>
#include "c.h"
@@ -38,26 +40,38 @@
static int create_shm(size_t size, int permission)
{
+#ifdef __ANDROID__
+ return -1;
+#else
key_t key;
ul_random_get_bytes(&key, sizeof(key));
return shmget(key, size, permission | IPC_CREAT);
+#endif
}
static int create_msg(int permission)
{
+#ifdef __ANDROID__
+ return -1;
+#else
key_t key;
ul_random_get_bytes(&key, sizeof(key));
return msgget(key, permission | IPC_CREAT);
+#endif
}
static int create_sem(int nsems, int permission)
{
+#ifdef __ANDROID__
+ return -1;
+#else
key_t key;
ul_random_get_bytes(&key, sizeof(key));
return semget(key, nsems, permission | IPC_CREAT);
+#endif
}
static void __attribute__((__noreturn__)) usage(void)