]> granicus.if.org Git - strace/commitdiff
2003-07-15 Anton Blanchard <anton@samba.org>
authorRoland McGrath <roland@redhat.com>
Thu, 17 Jul 2003 09:03:04 +0000 (09:03 +0000)
committerRoland McGrath <roland@redhat.com>
Thu, 17 Jul 2003 09:03:04 +0000 (09:03 +0000)
* ipc.c: Add SHM_HUGETLB field.
Mask out permission bits in msgget, semget and shmget before
printing resource_flags.
Mask execute permission bits (even though we dont currently
use them).

ipc.c

diff --git a/ipc.c b/ipc.c
index a747868335d4c9f7b5f69c8f7a600561c9e4cdbf..5f9a4f79fe5594e8c03c37bf19d1eb4da4e5a62e 100644 (file)
--- a/ipc.c
+++ b/ipc.c
@@ -115,6 +115,9 @@ static struct xlat resource_flags[] = {
        { IPC_CREAT,    "IPC_CREAT"     },
        { IPC_EXCL,     "IPC_EXCL"      },
        { IPC_NOWAIT,   "IPC_NOWAIT"    },
+#ifdef SHM_HUGETLB
+       { SHM_HUGETLB,  "SHM_HUGETLB"   },
+#endif
        { 0,            NULL            },
 };
 
@@ -145,9 +148,9 @@ struct tcb *tcp;
                else
                        tprintf("IPC_PRIVATE");
                tprintf(", ");
-               if (printflags(resource_flags, tcp->u_arg[1]) != 0)
+               if (printflags(resource_flags, tcp->u_arg[1] & ~0777) != 0)
                        tprintf("|");
-               tprintf("%#lo", tcp->u_arg[1] & 0666);
+               tprintf("%#lo", tcp->u_arg[1] & 0777);
        }
        return 0;
 }
@@ -285,9 +288,9 @@ struct tcb *tcp;
                        tprintf("IPC_PRIVATE");
                tprintf(", %lu", tcp->u_arg[1]);
                tprintf(", ");
-               if (printflags(resource_flags, tcp->u_arg[2] & ~0666) != 0)
+               if (printflags(resource_flags, tcp->u_arg[2] & ~0777) != 0)
                        tprintf("|");
-               tprintf("%#lo", tcp->u_arg[2] & 0666);
+               tprintf("%#lo", tcp->u_arg[2] & 0777);
        }
        return 0;
 }
@@ -314,9 +317,9 @@ struct tcb *tcp;
                        tprintf("IPC_PRIVATE");
                tprintf(", %lu", tcp->u_arg[1]);
                tprintf(", ");
-               if (printflags(resource_flags, tcp->u_arg[2]) != 0)
+               if (printflags(resource_flags, tcp->u_arg[2] & ~0777) != 0)
                        tprintf("|");
-               tprintf("%#lo", tcp->u_arg[2] & 0666);
+               tprintf("%#lo", tcp->u_arg[2] & 0777);
        }
        return 0;
 }