diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2000-06-01 13:03:56 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2000-06-01 13:03:56 +0000 |
commit | 64ca3a6502a07a2652bb713108527be0e9066745 (patch) | |
tree | bdae1e21c52d16e08db1307a9a7bf06bd00136a6 | |
parent | 53fe373b05b06f68094ed67e5c78b4dda7f0d5b8 (diff) | |
download | perl-64ca3a6502a07a2652bb713108527be0e9066745.tar.gz |
Signals-be-gone for microperl.
p4raw-id: //depot/cfgperl@6193
-rw-r--r-- | Todo.micro | 8 | ||||
-rw-r--r-- | doop.c | 2 | ||||
-rw-r--r-- | mg.c | 2 | ||||
-rw-r--r-- | perl.c | 4 | ||||
-rw-r--r-- | perl.h | 4 | ||||
-rw-r--r-- | pp_sys.c | 6 | ||||
-rw-r--r-- | util.c | 9 |
7 files changed, 25 insertions, 10 deletions
diff --git a/Todo.micro b/Todo.micro index c813271141..76759b1951 100644 --- a/Todo.micro +++ b/Todo.micro @@ -2,14 +2,6 @@ - make creating Makefile.micro automatic (by pumpkin) -- clean up compilation warnings as much as possible: - most of them seem to stem from not including enough headers (as planned) - to have enough prototypes, these may be correctible with some simple casts - -- do away with signals? (not very portable outside UNIX lands) - (missing signal API prototypes cause the majority of the compilation - warnings anyway) - - do away with fork/exec/wait? (system, popen should be enough?) - some of the uconfig.sh really needs to be probed (using cc) in buildtime: @@ -15,9 +15,11 @@ #define PERL_IN_DOOP_C #include "perl.h" +#ifndef PERL_MICRO #if !defined(NSIG) || defined(M_UNIX) || defined(M_XENIX) #include <signal.h> #endif +#endif STATIC I32 S_do_trans_CC_simple(pTHX_ SV *sv) @@ -950,6 +950,7 @@ Perl_magic_clear_all_env(pTHX_ SV *sv, MAGIC *mg) return 0; } +#ifndef PERL_MICRO int Perl_magic_getsig(pTHX_ SV *sv, MAGIC *mg) { @@ -1066,6 +1067,7 @@ Perl_magic_setsig(pTHX_ SV *sv, MAGIC *mg) } return 0; } +#endif /* !PERL_MICRO */ int Perl_magic_setisa(pTHX_ SV *sv, MAGIC *mg) @@ -1180,6 +1180,7 @@ print \" \\@INC:\\n @INC\\n\";"); validate_suid(validarg, scriptname,fdscript); +#ifndef PERL_MICRO #if defined(SIGCHLD) || defined(SIGCLD) { #ifndef SIGCHLD @@ -1194,6 +1195,7 @@ print \" \\@INC:\\n @INC\\n\";"); } } #endif +#endif #ifdef MACOS_TRADITIONAL if (PL_doextract || gMacPerl_AlwaysExtract) { @@ -1239,9 +1241,11 @@ print \" \\@INC:\\n @INC\\n\";"); if (xsinit) (*xsinit)(aTHXo); /* in case linked C routines want magical variables */ +#ifndef PERL_MICRO #if defined(VMS) || defined(WIN32) || defined(DJGPP) || defined(__CYGWIN__) init_os_extras(); #endif +#endif #ifdef USE_SOCKS SOCKSinit(argv[0]); @@ -2809,10 +2809,14 @@ EXT MGVTBL PL_vtbl_envelem = {0, MEMBER_TO_FPTR(Perl_magic_setenv), 0, MEMBER_TO_FPTR(Perl_magic_clearenv), 0}; EXT MGVTBL PL_vtbl_sig = {0, 0, 0, 0, 0}; +#ifdef PERL_MICRO +EXT MGVTBL PL_vtbl_sigelem = {0, 0, 0, 0, 0}; +#else EXT MGVTBL PL_vtbl_sigelem = {MEMBER_TO_FPTR(Perl_magic_getsig), MEMBER_TO_FPTR(Perl_magic_setsig), 0, MEMBER_TO_FPTR(Perl_magic_clearsig), 0}; +#endif EXT MGVTBL PL_vtbl_pack = {0, 0, MEMBER_TO_FPTR(Perl_magic_sizepack), MEMBER_TO_FPTR(Perl_magic_wipepack), 0}; EXT MGVTBL PL_vtbl_packelem = {MEMBER_TO_FPTR(Perl_magic_getpack), @@ -3749,7 +3749,7 @@ PP(pp_system) } } PERL_FLUSHALL_FOR_CHILD; -#if (defined(HAS_FORK) || defined(AMIGAOS)) && !defined(VMS) && !defined(OS2) && !defined(__CYGWIN__) +#if (defined(HAS_FORK) || defined(AMIGAOS)) && !defined(VMS) && !defined(OS2) && !defined(__CYGWIN__) || defined(PERL_MICRO) if (PerlProc_pipe(pp) >= 0) did_pipes = 1; while ((childpid = vfork()) == -1) { @@ -3768,13 +3768,17 @@ PP(pp_system) if (childpid > 0) { if (did_pipes) PerlLIO_close(pp[1]); +#ifndef PERL_MICRO rsignal_save(SIGINT, SIG_IGN, &ihand); rsignal_save(SIGQUIT, SIG_IGN, &qhand); +#endif do { result = wait4pid(childpid, &status, 0); } while (result == -1 && errno == EINTR); +#ifndef PERL_MICRO (void)rsignal_restore(SIGINT, &ihand); (void)rsignal_restore(SIGQUIT, &qhand); +#endif STATUS_NATIVE_SET(result == -1 ? -1 : status); do_execfree(); /* free any memory child malloced on vfork */ SP = ORIGMARK; @@ -16,6 +16,7 @@ #define PERL_IN_UTIL_C #include "perl.h" +#ifndef PERL_MICRO #if !defined(NSIG) || defined(M_UNIX) || defined(M_XENIX) #include <signal.h> #endif @@ -23,6 +24,7 @@ #ifndef SIG_ERR # define SIG_ERR ((Sighandler_t) -1) #endif +#endif /* XXX If this causes problems, set i_unistd=undef in the hint file. */ #ifdef I_UNISTD @@ -2494,7 +2496,7 @@ dup2(int oldfd, int newfd) } #endif - +#ifndef PERL_MICRO #ifdef HAS_SIGACTION Sighandler_t @@ -2597,6 +2599,7 @@ Perl_rsignal_restore(pTHX_ int signo, Sigsave_t *save) } #endif /* !HAS_SIGACTION */ +#endif /* !PERL_MICRO */ /* VMS' my_pclose() is in VMS.c; same with OS/2 */ #if (!defined(DOSISH) || defined(HAS_FORK) || defined(AMIGAOS)) && !defined(VMS) && !defined(__OPEN_VM) && !defined(EPOC) && !defined(MACOS_TRADITIONAL) @@ -2638,15 +2641,19 @@ Perl_my_pclose(pTHX_ PerlIO *ptr) #ifdef UTS if(PerlProc_kill(pid, 0) < 0) { return(pid); } /* HOM 12/23/91 */ #endif +#ifndef PERL_MICRO rsignal_save(SIGHUP, SIG_IGN, &hstat); rsignal_save(SIGINT, SIG_IGN, &istat); rsignal_save(SIGQUIT, SIG_IGN, &qstat); +#endif do { pid2 = wait4pid(pid, &status, 0); } while (pid2 == -1 && errno == EINTR); +#ifndef PERL_MICRO rsignal_restore(SIGHUP, &hstat); rsignal_restore(SIGINT, &istat); rsignal_restore(SIGQUIT, &qstat); +#endif if (close_failed) { SETERRNO(saved_errno, saved_vaxc_errno); return -1; |