summaryrefslogtreecommitdiffstats
path: root/sys-utils/ipcs.c
diff options
context:
space:
mode:
authorKarel Zak2006-12-07 00:25:43 +0100
committerKarel Zak2006-12-07 00:25:43 +0100
commit22853e4a82c6ef7b336527529acb94b14a0b0fd8 (patch)
treeee28e4598c8c449d7e811711d8ce8eb17caecfb6 /sys-utils/ipcs.c
parentImported from util-linux-2.10f tarball. (diff)
downloadkernel-qcow2-util-linux-22853e4a82c6ef7b336527529acb94b14a0b0fd8.tar.gz
kernel-qcow2-util-linux-22853e4a82c6ef7b336527529acb94b14a0b0fd8.tar.xz
kernel-qcow2-util-linux-22853e4a82c6ef7b336527529acb94b14a0b0fd8.zip
Imported from util-linux-2.10m tarball.
Diffstat (limited to 'sys-utils/ipcs.c')
-rw-r--r--sys-utils/ipcs.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/sys-utils/ipcs.c b/sys-utils/ipcs.c
index 09dec45a0..3990ad3fa 100644
--- a/sys-utils/ipcs.c
+++ b/sys-utils/ipcs.c
@@ -69,6 +69,11 @@ struct shm_info {
#define SEM_STAT 18
#define SEM_INFO 19
#endif
+
+/* Some versions of libc only define IPC_INFO when __USE_GNU is defined. */
+#ifndef IPC_INFO
+#define IPC_INFO 3
+#endif
/*-------------------------------------------------------------------*/
/* The last arg of semctl is a union semun, but where is it defined?
@@ -112,16 +117,16 @@ void print_sem (int id);
static char *progname;
-void usage(void)
-{
+static void
+usage(void) {
printf (_("usage : %s -asmq -tclup \n"), progname);
printf (_("\t%s [-s -m -q] -i id\n"), progname);
printf (_("\t%s -h for help.\n"), progname);
return;
}
-void help (void)
-{
+static void
+help (void) {
printf (_("%s provides information on ipc facilities for"), progname);
printf (_(" which you have read access.\n"));
printf (_("Resource Specification:\n\t-m : shared_mem\n\t-q : messages\n"));
@@ -133,8 +138,8 @@ void help (void)
return;
}
-int main (int argc, char **argv)
-{
+int
+main (int argc, char **argv) {
int opt, msg = 0, sem = 0, shm = 0, id=0, print=0;
char format = 0;
char options[] = "atcluphsmqi:";
@@ -222,8 +227,8 @@ int main (int argc, char **argv)
}
-void print_perms (int id, struct ipc_perm *ipcp)
-{
+static void
+print_perms (int id, struct ipc_perm *ipcp) {
struct passwd *pw;
struct group *gr;