[request-sponsor] Re: Adding status support to dd

2007-04-06 Thread Richard L. Hamilton
I suppose that *BSD ignores SIGINFO by default, so that programs
that don't wish to support it aren't bothered?

Seems like this _could_ be added, insofar as slots 16-19 of termios c_cc[]
are still unused.  Have to add another signal too (eating into the number of
realtime signals, I suppose).   And a few lines to os/sig.c,
a #define for VSTATUS to sys/termios.h, io/ldterm.c (looks like VSTATUS
should only be interpreted if IEXTEN is enabled?) and
I'm not sure what else.  And of course a bit of research to see if one could
do it in a way reasonably source compatible with Linux and/or *BSD.

Alternatively to some of that work, Linux seems to maybe overload
SIGINFO as a synonym for SIGPWR, but I'm wondering if that might not
be potentially dangerous (I can see someone logged in as root on the
console hitting ^T and causing something to shut down!).

Still, I don't see that it would necessarily break anything to add SIGINFO
support to Solaris, as long as the initial default tty settings didn't enable
that special character.  And as long as there was some clear understanding
how to safely add support for SIGINFO to programs (maybe with the
help of a library routine?), it might be kind of cool to be able to ask a
long-running program what sort of progress it's making.
 
 
This message posted from opensolaris.org



[request-sponsor] Re: Adding status support to dd

2007-04-06 Thread Frank Van Der Linden
Richard L. Hamilton wrote:
> I suppose that *BSD ignores SIGINFO by default, so that programs
> that don't wish to support it aren't bothered?
>   
Yep.
> Seems like this _could_ be added, insofar as slots 16-19 of termios c_cc[]
> are still unused.  Have to add another signal too (eating into the number of
> realtime signals, I suppose).   And a few lines to os/sig.c,
> a #define for VSTATUS to sys/termios.h, io/ldterm.c (looks like VSTATUS
> should only be interpreted if IEXTEN is enabled?) and
> I'm not sure what else.  And of course a bit of research to see if one could
> do it in a way reasonably source compatible with Linux and/or *BSD.
>   
Sure. It's pretty much the same as the handling for ^C and, for example.

- Frank




[request-sponsor] Re: Adding status support to dd

2007-04-06 Thread Richard L. Hamilton
I'm very tempted to try to do the addition of SIGINFO, but it'd be sort of in
the blind, because I don't have the space to try to actually build it, nor
a system I'd be eager to reload to test it.

Let's see,

usr/src/uts/common/sys/iso/signal_iso.h:
add
#define SIGINFO 41/* information request */

change value of _SIGRTMIN from 41 to 42

usr/src/uts/common/sys/termios.h:
add
#define VSTATUS 16

add
#define CSTATUS CTL('t')

usr/src/uts/common/io/ldterm.c:

break apart the test for IEXTEN and VDSUSP into an outer if for just IEXTEN,
and two inner if's, one for VDSUSP and one for VSTATUS (latter action should
use ldterm_dosig() arguments like those for SIGINT, except for the
signal name).

usr/src/uts/common/os/sig.c:

add SIGINFO to the initializer for ignoredefault.

Is that really all it would take???
 
 
This message posted from opensolaris.org



[request-sponsor] Re: Adding status support to dd

2007-04-07 Thread Richard L. Hamilton
Oh, and changes to

usr/src/cmd/ttymon/stty.c
usr/src/cmd/ttymon/sttyparse.c
usr/src/ucbcmd/stty/stty.c
usr/src/ucbcmd/stty/sttyparse.c

which I'm too sleepy to figure out right now...
 
 
This message posted from opensolaris.org



[request-sponsor] Re: Adding status support to dd

2007-04-07 Thread William Kucharski

On Apr 7, 2007, at 12:35 AM, Richard L. Hamilton wrote:

> usr/src/uts/common/sys/iso/signal_iso.h:
> add
> #define   SIGINFO 41/* information request */
>
> change value of _SIGRTMIN from 41 to 42

This works in actual implementation but beware of the side effect  
that now
any binary compiled prior to your change that does anything with  
_SIGRTMIN
will now be doing it with SIGINFO.  That could lead to some interesting
compatibility issues down the road.

 William Kucharski
 william dot kucharski at sun dot com



[request-sponsor] Re: Adding status support to dd

2007-04-07 Thread Frank Van Der Linden
William Kucharski wrote:
>
> This works in actual implementation but beware of the side effect that 
> now
> any binary compiled prior to your change that does anything with 
> _SIGRTMIN
> will now be doing it with SIGINFO.  That could lead to some interesting
> compatibility issues down the road.
Applications should not use _SIGRT*, otherwise they get what they ask 
for :-) It looks like SIGRT* (no leading _) have been defined as 
sysconf(2) calls since 1993, I assume with the intent of making it 
possible to add signals in a backward compatible way. This has happened 
once already, in 1999, when SIGJVM1 and SIGJVM2 were added, and 
_SIGRTMIN was bumped according to the instruction in the comment in 
sys/iso/signal_iso.h.

Like the signal.h(3HEAD) manpage says:

 SIGRTMIN *   ExitFirst real time signal
 (SIGRTMIN+1) *   ExitSecond real time signal
 ...
 (SIGRTMAX-1) *   ExitSecond-to-last real time signal
 SIGRTMAX *   ExitLast real time signal


 The symbols SIGRTMIN through SIGRTMAX are evaluated  dynami-
 cally to permit future configurability.


- Frank




[request-sponsor] Re: Adding status support to dd

2007-04-07 Thread John Zolnowsky x69422/408-404-5064
Richard,

On the signals side, you'll also need to update a variety of libc
arrays holding signal information:
usr/src/lib/libc/port/gen/siglist.c
usr/src/lib/libc/port/gen/str2sig.c
usr/src/lib/libc/i386/gen/siginfolst.c
usr/src/lib/libc/sparc/gen/siginfolst.c
usr/src/lib/libc/sparcv9/gen/siginfolst.c

-JZ

> Date: Fri, 06 Apr 2007 23:35:10 -0700 (PDT)
> From: "Richard L. Hamilton" 
> 
> I'm very tempted to try to do the addition of SIGINFO, but it'd be sort of in
> the blind, because I don't have the space to try to actually build it, nor
> a system I'd be eager to reload to test it.
> 
> Let's see,
> 
> usr/src/uts/common/sys/iso/signal_iso.h:
> add
> #define   SIGINFO 41/* information request */
> 
> change value of _SIGRTMIN from 41 to 42
> 
> usr/src/uts/common/sys/termios.h:
> add
> #define VSTATUS 16
> 
> add
> #define CSTATUS CTL('t')
> 
> usr/src/uts/common/io/ldterm.c:
> 
> break apart the test for IEXTEN and VDSUSP into an outer if for just IEXTEN,
> and two inner if's, one for VDSUSP and one for VSTATUS (latter action should
> use ldterm_dosig() arguments like those for SIGINT, except for the
> signal name).
> 
> usr/src/uts/common/os/sig.c:
> 
> add SIGINFO to the initializer for ignoredefault.
> 
> Is that really all it would take???
>  
>  
> This message posted from opensolaris.org
> ___
> request-sponsor mailing list
> request-sponsor at opensolaris.org
> 



[request-sponsor] Re: Adding status support to dd

2007-04-11 Thread Frank Van Der Linden
Richard L. Hamilton wrote:
> I'm very tempted to try to do the addition of SIGINFO, but it'd be sort of in
> the blind, because I don't have the space to try to actually build it, nor
> a system I'd be eager to reload to test it.
>   
Hi Richard,

The changes you propose look right. I'll take ownership of  the CR that 
James filed (6310532), and will set things in motion to get SIGINFO 
supported.

- Frank