cc_t
getcc(termios_ref, ccix)
POSIX::Termios termios_ref
- int ccix
+ unsigned int ccix
CODE:
#ifdef I_TERMIOS /* References a termios structure member so ifdef it out. */
if (ccix >= NCCS)
void
setcc(termios_ref, ccix, cc)
POSIX::Termios termios_ref
- int ccix
+ unsigned int ccix
cc_t cc
CODE:
#ifdef I_TERMIOS /* References a termios structure member so ifdef it out. */
SV** svp;
SV** sigsvp;
+ if (sig < 0) {
+ croak("Negative signals are not allowed");
+ }
+
if (sig == 0 && SvPOK(ST(0))) {
const char *s = SvPVX_const(ST(0));
int i = whichsig(s);
/* Remember old disposition if desired. */
if (oldaction) {
- svp = hv_fetch(oldaction, "HANDLER", 7, TRUE);
+ svp = hv_fetchs(oldaction, "HANDLER", TRUE);
if(!svp)
croak("Can't supply an oldaction without a HANDLER");
if(SvTRUE(*sigsvp)) { /* TBD: what if "0"? */
if(RETVAL == -1)
XSRETURN_UNDEF;
/* Get back the mask. */
- svp = hv_fetch(oldaction, "MASK", 4, TRUE);
+ svp = hv_fetchs(oldaction, "MASK", TRUE);
if (sv_isa(*svp, "POSIX::SigSet")) {
IV tmp = SvIV((SV*)SvRV(*svp));
sigset = INT2PTR(sigset_t*, tmp);
*sigset = oact.sa_mask;
/* Get back the flags. */
- svp = hv_fetch(oldaction, "FLAGS", 5, TRUE);
+ svp = hv_fetchs(oldaction, "FLAGS", TRUE);
sv_setiv(*svp, oact.sa_flags);
/* Get back whether the old handler used safe signals. */
- svp = hv_fetch(oldaction, "SAFE", 4, TRUE);
+ svp = hv_fetchs(oldaction, "SAFE", TRUE);
sv_setiv(*svp,
/* compare incompatible pointers by casting to integer */
PTR2nat(oact.sa_handler) == PTR2nat(PL_csighandlerp));
/* Safe signals use "csighandler", which vectors through the
PL_sighandlerp pointer when it's safe to do so.
(BTW, "csighandler" is very different from "sighandler".) */
- svp = hv_fetch(action, "SAFE", 4, FALSE);
+ svp = hv_fetchs(action, "SAFE", FALSE);
act.sa_handler =
DPTR2FPTR(
void (*)(),
/* Vector new Perl handler through %SIG.
(The core signal handlers read %SIG to dispatch.) */
- svp = hv_fetch(action, "HANDLER", 7, FALSE);
+ svp = hv_fetchs(action, "HANDLER", FALSE);
if (!svp)
croak("Can't supply an action without a HANDLER");
sv_setsv(*sigsvp, *svp);
}
/* Set up any desired mask. */
- svp = hv_fetch(action, "MASK", 4, FALSE);
+ svp = hv_fetchs(action, "MASK", FALSE);
if (svp && sv_isa(*svp, "POSIX::SigSet")) {
IV tmp = SvIV((SV*)SvRV(*svp));
sigset = INT2PTR(sigset_t*, tmp);
sigemptyset(& act.sa_mask);
/* Set up any desired flags. */
- svp = hv_fetch(action, "FLAGS", 5, FALSE);
+ svp = hv_fetchs(action, "FLAGS", FALSE);
act.sa_flags = svp ? SvIV(*svp) : 0;
/* Don't worry about cleaning up *sigsvp if this fails,
STRLEN dstlen;
char *p = SvPV(src,srclen);
srclen++;
- ST(0) = sv_2mortal(NEWSV(800,srclen*4+1));
+ ST(0) = sv_2mortal(newSV(srclen*4+1));
dstlen = strxfrm(SvPVX(ST(0)), p, (size_t)srclen);
if (dstlen > srclen) {
dstlen++;