On Thu, Jan 15, 2015 at 08:32:30PM +0100, Gabriel Laskar wrote:
> Android Alarms are parametered by the alarm type. This change add the
> output with the correct string.
> 
> * ioctl.c (evdev_decode_number): Add android_alarm_decode_number call and 
> implementation.
> * xlat/android_alarm_type.in: New file.
> 
> Signed-off-by: Gabriel Laskar <[email protected]>
> ---
>  ioctl.c                    | 24 ++++++++++++++++++++++++
>  xlat/android_alarm_type.in |  6 ++++++
>  2 files changed, 30 insertions(+)
>  create mode 100644 xlat/android_alarm_type.in
> 
> diff --git a/ioctl.c b/ioctl.c
> index 050ec28..2833df3 100644
> --- a/ioctl.c
> +++ b/ioctl.c
> @@ -31,6 +31,8 @@
>  #include "defs.h"
>  #include <asm/ioctl.h>
>  
> +#include "xlat/android_alarm_type.h"

All constants used by xlat files must be defined before xlat files are
included.

> +
>  static int
>  compare(const void *a, const void *b)
>  {
> @@ -70,6 +72,26 @@ ioctl_next_match(const struct_ioctlent *iop)
>  }
>  
>  int
> +android_alarm_decode_number(unsigned long arg)
> +{
> +     switch (_IOC_NR(arg) >> 4) {
> +             case 2:
> +                     tprintf("ANDROID_ALARM_SET(type=%lu)", _IOC_NR(arg & 
> 0xf));
> +                     return 1;
> +             case 3:
> +                     tprintf("ANDROID_ALARM_SET_AND_WAIT(type=%lu)", 
> _IOC_NR(arg & 0xf));
> +                     return 1;
> +             case 4:
> +                     tprints("ANDROID_ALARM_GET_TIME(");
> +                     printxval(android_alarm_type, _IOC_NR(arg & 0xf), 
> "invalid alarm type");
> +                     tprints(")");
> +                     return 1;

_IOC_DIR(arg) needs to be checked just in case.

In this case, _IOC_SIZE(arg) also needs to be checked,
to avoid collisions with ATMIOC numbers.  


-- 
ldv

Attachment: pgppvjzN42duk.pgp
Description: PGP signature

------------------------------------------------------------------------------
New Year. New Location. New Benefits. New Data Center in Ashburn, VA.
GigeNET is offering a free month of service with a new server in Ashburn.
Choose from 2 high performing configs, both with 100TB of bandwidth.
Higher redundancy.Lower latency.Increased capacity.Completely compliant.
http://p.sf.net/sfu/gigenet
_______________________________________________
Strace-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/strace-devel

Reply via email to