Skip to content

Commit

Permalink
process.c: update (sys_prctl)
Browse files Browse the repository at this point in the history
2008-04-19  Dmitry V. Levin <ldv@altlinux.org>

	* process.c (sys_prctl): Decode PR_SET_PDEATHSIG, PR_GET_PDEATHSIG,
	PR_SET_DUMPABLE, PR_GET_DUMPABLE, PR_SET_KEEPCAPS, PR_GET_KEEPCAPS.
	Fix PR_GET_UNALIGN decoder.

Change-Id: I1cbf933b89ee3d62300856969afd1ea2a971d262
  • Loading branch information
ldv-alt authored and Patrick Jacques committed Nov 18, 2010
1 parent e8b1f8e commit ba4a004
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 13 deletions.
5 changes: 4 additions & 1 deletion ChangeLog
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
2008-04-19 Dmitry V. Levin <ldv@altlinux.org>

* process.c (prctl_options): Add more constants.
* process.c (sys_prctl): Decode PR_SET_PDEATHSIG, PR_GET_PDEATHSIG,
PR_SET_DUMPABLE, PR_GET_DUMPABLE, PR_SET_KEEPCAPS, PR_GET_KEEPCAPS.
Fix PR_GET_UNALIGN decoder.
(prctl_options): Add more constants.

* linux/syscallent.h: Use sys_prctl() decoder for "prctl" syscall.
* linux/alpha/syscallent.h: Likewise.
Expand Down
50 changes: 38 additions & 12 deletions process.c
Original file line number Diff line number Diff line change
Expand Up @@ -306,10 +306,24 @@ struct tcb *tcp;
case PR_GETNSHARE:
break;
#endif
#ifdef PR_SET_DEATHSIG
#ifdef PR_SET_PDEATHSIG
case PR_SET_PDEATHSIG:
tprintf(", %lu", tcp->u_arg[1]);
break;
#endif
#ifdef PR_GET_PDEATHSIG
case PR_GET_PDEATHSIG:
break;
#endif
#ifdef PR_SET_DUMPABLE
case PR_SET_DUMPABLE:
tprintf(", %lu", tcp->u_arg[1]);
break;
#endif
#ifdef PR_GET_DUMPABLE
case PR_GET_DUMPABLE:
break;
#endif
#ifdef PR_SET_UNALIGN
case PR_SET_UNALIGN:
tprintf(", %s", unalignctl_string(tcp->u_arg[1]));
Expand All @@ -319,6 +333,15 @@ struct tcb *tcp;
case PR_GET_UNALIGN:
tprintf(", %#lx", tcp->u_arg[1]);
break;
#endif
#ifdef PR_SET_KEEPCAPS
case PR_SET_KEEPCAPS:
tprintf(", %lu", tcp->u_arg[1]);
break;
#endif
#ifdef PR_GET_KEEPCAPS
case PR_GET_KEEPCAPS:
break;
#endif
default:
for (i = 1; i < tcp->u_nargs; i++)
Expand All @@ -329,23 +352,26 @@ struct tcb *tcp;
switch (tcp->u_arg[0]) {
#ifdef PR_GET_PDEATHSIG
case PR_GET_PDEATHSIG:
for (i=1; i<tcp->u_nargs; i++)
tprintf(", %#lx", tcp->u_arg[i]);
if (umove(tcp, tcp->u_arg[1], &i) < 0)
tprintf(", %#lx", tcp->u_arg[1]);
else
tprintf(", {%u}", i);
break;
#endif
#ifdef PR_SET_UNALIGN
case PR_SET_UNALIGN:
break;
#ifdef PR_GET_DUMPABLE
case PR_GET_DUMPABLE:
return RVAL_UDECIMAL;
#endif
#ifdef PR_GET_UNALIGN
case PR_GET_UNALIGN:
{
int ctl;

umove(tcp, tcp->u_arg[1], &ctl);
tcp->auxstr = unalignctl_string(ctl);
if (syserror(tcp) || umove(tcp, tcp->u_arg[1], &i) < 0)
break;
tcp->auxstr = unalignctl_string(i);
return RVAL_STR;
}
#endif
#ifdef PR_GET_KEEPCAPS
case PR_GET_KEEPCAPS:
return RVAL_UDECIMAL;
#endif
default:
break;
Expand Down

0 comments on commit ba4a004

Please sign in to comment.