You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
175 lines
2.8 KiB
175 lines
2.8 KiB
diff -u -r ../util-linux-2.32/sys-utils/ipcutils.c ./sys-utils/ipcutils.c
|
|
--- ../util-linux-2.32/sys-utils/ipcutils.c 2017-10-20 10:37:04.297168101 +0000
|
|
+++ ./sys-utils/ipcutils.c 2018-05-19 00:56:13.647850483 +0000
|
|
@@ -18,6 +18,9 @@
|
|
|
|
int ipc_msg_get_limits(struct ipc_limits *lim)
|
|
{
|
|
+#ifdef __ANDROID__
|
|
+ return -1;
|
|
+#else
|
|
if (path_exist(_PATH_PROC_IPC_MSGMNI) &&
|
|
path_exist(_PATH_PROC_IPC_MSGMNB) &&
|
|
path_exist(_PATH_PROC_IPC_MSGMAX)) {
|
|
@@ -36,10 +39,14 @@
|
|
}
|
|
|
|
return 0;
|
|
+#endif
|
|
}
|
|
|
|
int ipc_sem_get_limits(struct ipc_limits *lim)
|
|
{
|
|
+#ifdef __ANDROID__
|
|
+ return -1;
|
|
+#else
|
|
FILE *f;
|
|
int rc = 0;
|
|
|
|
@@ -66,10 +73,14 @@
|
|
}
|
|
|
|
return 0;
|
|
+#endif
|
|
}
|
|
|
|
int ipc_shm_get_limits(struct ipc_limits *lim)
|
|
{
|
|
+#ifdef __ANDROID__
|
|
+ return -1;
|
|
+#else
|
|
lim->shmmin = SHMMIN;
|
|
|
|
if (path_exist(_PATH_PROC_IPC_SHMALL) &&
|
|
@@ -93,10 +104,14 @@
|
|
}
|
|
|
|
return 0;
|
|
+#endif
|
|
}
|
|
|
|
int ipc_shm_get_info(int id, struct shm_data **shmds)
|
|
{
|
|
+#ifdef __ANDROID__
|
|
+ return -1;
|
|
+#else
|
|
FILE *f;
|
|
int i = 0, maxid;
|
|
char buf[BUFSIZ];
|
|
@@ -201,17 +216,23 @@
|
|
if (i == 0)
|
|
free(*shmds);
|
|
return i;
|
|
+#endif
|
|
}
|
|
|
|
void ipc_shm_free_info(struct shm_data *shmds)
|
|
{
|
|
+#ifdef __ANDROID__
|
|
+ return;
|
|
+#else
|
|
while (shmds) {
|
|
struct shm_data *next = shmds->next;
|
|
free(shmds);
|
|
shmds = next;
|
|
}
|
|
+#endif
|
|
}
|
|
|
|
+#ifndef __ANDROID__
|
|
static void get_sem_elements(struct sem_data *p)
|
|
{
|
|
size_t i;
|
|
@@ -242,9 +263,13 @@
|
|
err(EXIT_FAILURE, _("%s failed"), "semctl(GETPID)");
|
|
}
|
|
}
|
|
+#endif
|
|
|
|
int ipc_sem_get_info(int id, struct sem_data **semds)
|
|
{
|
|
+#ifdef __ANDROID__
|
|
+ return -1;
|
|
+#else
|
|
FILE *f;
|
|
int i = 0, maxid;
|
|
struct sem_data *p;
|
|
@@ -339,20 +364,28 @@
|
|
if (i == 0)
|
|
free(*semds);
|
|
return i;
|
|
+#endif
|
|
}
|
|
|
|
void ipc_sem_free_info(struct sem_data *semds)
|
|
{
|
|
+#ifdef __ANDROID__
|
|
+ return;
|
|
+#else
|
|
while (semds) {
|
|
struct sem_data *next = semds->next;
|
|
free(semds->elements);
|
|
free(semds);
|
|
semds = next;
|
|
}
|
|
+#endif
|
|
}
|
|
|
|
int ipc_msg_get_info(int id, struct msg_data **msgds)
|
|
{
|
|
+#ifdef __ANDROID__
|
|
+ return -1;
|
|
+#else
|
|
FILE *f;
|
|
int i = 0, maxid;
|
|
struct msg_data *p;
|
|
@@ -451,19 +484,27 @@
|
|
if (i == 0)
|
|
free(*msgds);
|
|
return i;
|
|
+#endif
|
|
}
|
|
|
|
void ipc_msg_free_info(struct msg_data *msgds)
|
|
{
|
|
+#ifdef __ANDROID__
|
|
+ return;
|
|
+#else
|
|
while (msgds) {
|
|
struct msg_data *next = msgds->next;
|
|
free(msgds);
|
|
msgds = next;
|
|
}
|
|
+#endif
|
|
}
|
|
|
|
void ipc_print_perms(FILE *f, struct ipc_stat *is)
|
|
{
|
|
+#ifdef __ANDROID__
|
|
+ return;
|
|
+#else
|
|
struct passwd *pw;
|
|
struct group *gr;
|
|
|
|
@@ -488,11 +529,15 @@
|
|
fprintf(f, " %-10s\n", gr->gr_name);
|
|
else
|
|
fprintf(f, " %-10u\n", is->gid);
|
|
+#endif
|
|
}
|
|
|
|
void ipc_print_size(int unit, char *msg, uint64_t size, const char *end,
|
|
int width)
|
|
{
|
|
+#ifdef __ANDROID__
|
|
+ return;
|
|
+#else
|
|
char format[32];
|
|
|
|
if (!msg)
|
|
@@ -531,4 +576,5 @@
|
|
|
|
if (end)
|
|
printf("%s", end);
|
|
+#endif
|
|
}
|
|
|