On Thu, Aug 8, 2013 at 11:23 PM, Cedric Blancher
<[email protected]> wrote:
> On 1 August 2013 16:00, David Korn <[email protected]> wrote:
>> cc: [email protected]
>> Subject: Re: [ast-developers] RFE: Renaming .sh.sig.code to match Opengroup  
>> <signal.h> spec?
>> --------
>>
>>> Could we just avoid this and just use the uppercase names defined by
>>> Opengroup in <signal.h>, i.e.
>>> http://pubs.opengroup.org/onlinepubs/009696699/basedefs/signal.h.html?
>>> Otherwise ksh93(1) must be updated to list each signal and the names
>>> or numbers (which aren't portable BTW) used.
>>
>> I will switch to upper case and use the same names but without
>> the prefix for generic ones so that CLD_xxx will just be xxx.
>> The SI_ prefix will be kept.
>
> This doesn't work in ast-ksh.20130807:
> ksh -c 'trap "print \${.sh.sig.code}" USR1 ; kill -q4 -s USR1 $$ ; true'
> QUEUE
>
> It should print SI_QUEUE because SI_QUEUE is a generic siginfo value
> not specific to a signal.

Attached (as "astksh20130807_sigfixes001.diff.txt") is a fix which
fixes this and the following other issues:
1. siginfo SI_* names now have the "SI_" prefix in .sh.sig.code
2. SIGPOLL |si_band| and |si_fd| are now supported
3. On systems which support Solaris Zones and process "contracts"
|si_ctid| and |si_zoneid| are now available in .sh.sig as .sh.sig.ctid
and .sh.sig.zoneid

David: Are the changes Ok for you ?

----

Bye,
Roland

-- 
  __ .  . __
 (o.\ \/ /.o) [email protected]
  \__\/\/__/  MPEG specialist, C&&JAVA&&Sun&&Unix programmer
  /O /==\ O\  TEL +49 641 3992797
 (;O/ \/ \O;)
diff -r -u original/src/cmd/ksh93/data/signals.c 
build_sigfixes/src/cmd/ksh93/data/signals.c
--- src/cmd/ksh93/data/signals.c        2013-08-01 20:27:47.000000000 +0200
+++ src/cmd/ksh93/data/signals.c        2013-08-09 01:34:18.705475037 +0200
@@ -287,43 +287,43 @@
         * codes
         */
 #   ifdef SI_USER
-       { 0,            SI_USER,        "USER"          },
+       { 0,            SI_USER,        "SI_USER"       },
 #   endif
 #   ifdef SI_QUEUE
-       { 0,            SI_QUEUE,       "QUEUE"         },
+       { 0,            SI_QUEUE,       "SI_QUEUE"      },
 #   endif
 #   ifdef SI_TIMER
-       { 0,            SI_TIMER,       "TIMER"         },
+       { 0,            SI_TIMER,       "SI_TIMER"      },
 #   endif
 #   ifdef SI_ASYNCIO
-       { 0,            SI_ASYNCIO,     "ASYNCIO"       },
+       { 0,            SI_ASYNCIO,     "SI_ASYNCIO"    },
 #   endif
 #   ifdef SI_MESGQ
-       { 0,            SI_MESGQ,       "MESGQ"         },
+       { 0,            SI_MESGQ,       "SI_MESGQ"      },
 #   endif
 #   ifdef SI_NOINFO
-       { 0,            SI_NOINFO,      "NOINFO"        },
+       { 0,            SI_NOINFO,      "SI_NOINFO"     },
 #   endif
 #   ifdef SI_DTRACE
-       { 0,            SI_DTRACE,      "DTRACE"        },
+       { 0,            SI_DTRACE,      "SI_DTRACE"     },
 #   endif
 #   ifdef SI_RCTL
-       { 0,            SI_RCTL,        "RCTL"          },
+       { 0,            SI_RCTL,        "SI_RCTL"       },
 #   endif
 #   ifdef SI_LWP
-       { 0,            SI_LWP,         "LWP"           },
+       { 0,            SI_LWP,         "SI_LWP"        },
 #   endif
 #   ifdef SI_KERNEL
-       { 0,            SI_KERNEL,      "KERNEL"        },
+       { 0,            SI_KERNEL,      "SI_KERNEL"     },
 #   endif
 #   ifdef SI_SIGIO
-       { 0,            SI_SIGIO,       "SIGIO"         },
+       { 0,            SI_SIGIO,       "SI_SIGIO"      },
 #   endif
 #   ifdef SI_TKILL
-       { 0,            SI_TKILL,       "TKILL"         },
+       { 0,            SI_TKILL,       "SI_TKILL"      },
 #   endif
 #   ifdef SI_ASYNCNL
-       { 0,            SI_ASYNCNL,     "ASYNCNL"       },
+       { 0,            SI_ASYNCNL,     "SI_ASYNCNL"    },
 #   endif
        { 0,            0,              NULL            }
    };
diff -r -u original/src/cmd/ksh93/data/variables.c 
build_sigfixes/src/cmd/ksh93/data/variables.c
--- src/cmd/ksh93/data/variables.c      2013-07-22 16:42:34.000000000 +0200
+++ src/cmd/ksh93/data/variables.c      2013-08-09 01:58:21.083327851 +0200
@@ -119,13 +119,28 @@
 const Shtable_t        shtab_siginfo[] =
 {
        "addr",         NV_RDONLY|NV_MINIMAL|NV_NOFREE|NV_INTEGER|NV_LONG,
-       "band",         NV_RDONLY|NV_MINIMAL|NV_NOFREE|NV_INTEGER|NV_LONG,
        "code",         NV_RDONLY|NV_MINIMAL|NV_NOFREE|NV_INTEGER,
        "errno",        NV_RDONLY|NV_MINIMAL|NV_NOFREE|NV_INTEGER,
        "name",         NV_RDONLY|NV_MINIMAL|NV_NOFREE,
        "pid",          NV_RDONLY|NV_MINIMAL|NV_NOFREE|NV_INTEGER,
+#ifdef si_ctid
+       /* Solaris "contracts" (|ctid_t| )*/
+       "ctid",         NV_RDONLY|NV_MINIMAL|NV_NOFREE|NV_INTEGER,
+#endif
+#ifdef si_zoneid
+       /* Solaris "Zones" (|zoneid_t|) */
+       "zoneid",       NV_RDONLY|NV_MINIMAL|NV_NOFREE|NV_INTEGER,
+#endif
        "signo",        NV_RDONLY|NV_MINIMAL|NV_NOFREE|NV_INTEGER,
        "status",       NV_RDONLY|NV_MINIMAL|NV_NOFREE|NV_INTEGER,
+#ifdef SIGPOLL
+#ifdef si_band
+       "band",         NV_RDONLY|NV_MINIMAL|NV_NOFREE|NV_INTEGER|NV_LONG,
+#endif
+#ifdef si_fd
+       "fd",           NV_RDONLY|NV_MINIMAL|NV_NOFREE|NV_INTEGER,
+#endif
+#endif
        "uid",          NV_RDONLY|NV_MINIMAL|NV_NOFREE|NV_INTEGER,
        "value",        NV_RDONLY|NV_MINIMAL|NV_NOFREE,
        "value.int",    NV_RDONLY|NV_MINIMAL|NV_NOFREE|NV_INTEGER,
@@ -153,4 +168,3 @@
        "",                     0
 };
 #endif /* SHOPT_STATS */
-
diff -r -u original/src/cmd/ksh93/sh/init.c 
build_sigfixes/src/cmd/ksh93/sh/init.c
--- src/cmd/ksh93/sh/init.c     2013-07-31 19:30:18.000000000 +0200
+++ src/cmd/ksh93/sh/init.c     2013-08-09 01:56:28.167366928 +0200
@@ -2084,12 +2084,24 @@
        nv_putval(np,sfstruse(sp->sh->strbuf),NV_RDONLY);
        np = create_svar(SH_SIG,"pid",0, fp);
        np->nvalue.idp = &sip->si_pid;
+#ifdef si_ctid
+       /* Solaris "contracts" */
+       np = create_svar(SH_SIG,"ctid",0, fp);
+       nv_setsize(np,10);
+       np->nvalue.ip = &(sip->si_ctid);
+#endif
+#ifdef si_zoneid
+       /* Solaris Zones */
+       np = create_svar(SH_SIG,"zoneid",0, fp);
+       nv_setsize(np,10);
+       np->nvalue.ip = &(sip->si_zoneid);
+#endif
        np = create_svar(SH_SIG,"uid",0, fp);
        np->nvalue.idp = &sip->si_uid;
        np = create_svar(SH_SIG,"code",0, fp);
-       nv_offattr(np,NV_INTEGER);
        if(sistr = siginfocode2str(sip->si_signo, sip->si_code))
        {
+               nv_offattr(np,NV_INTEGER);
                np->nvalue.cp = sistr;
                nv_onattr(np,NV_NOFREE);
        }
@@ -2103,6 +2115,18 @@
        np = create_svar(SH_SIG,"addr",0, fp);
        nv_setsize(np,16);
        np->nvalue.llp = (Sflong_t*)&sip->si_addr;
+#ifdef SIGPOLL
+#ifdef si_band
+       np = create_svar(SH_SIG,"band",0, fp);
+       nv_setsize(np,10);
+       np->nvalue.ip = (Sflong_t*)&(sip->si_band);
+#endif
+#ifdef si_fd
+       np = create_svar(SH_SIG,"fd",0, fp);
+       nv_setsize(np,10);
+       np->nvalue.ip = &(sip->si_fd);
+#endif
+#endif
        np = create_svar(SH_SIG,"value",0,fp);
        np = create_svar(SH_SIG,"value.int",0,fp);
        nv_setsize(np,10);
_______________________________________________
ast-developers mailing list
[email protected]
http://lists.research.att.com/mailman/listinfo/ast-developers

Reply via email to