No longer implies BSD */
| 158 | |
| 159 | #ifdef SUSPEND /* No longer implies BSD */ |
| 160 | int |
| 161 | dosuspend(void) |
| 162 | { |
| 163 | #ifdef SYSCF |
| 164 | /* NB: check_user_string() is port-specific. */ |
| 165 | if (!sysopt.shellers || !sysopt.shellers[0] |
| 166 | || !check_user_string(sysopt.shellers)) { |
| 167 | Norep("Suspend command not available."); |
| 168 | return 0; |
| 169 | } |
| 170 | #endif |
| 171 | #if defined(SIGTSTP) && !defined(NO_SIGNAL) |
| 172 | if (signal(SIGTSTP, SIG_IGN) == SIG_DFL) { |
| 173 | suspend_nhwindows((char *) 0); |
| 174 | #ifdef _M_UNIX |
| 175 | sco_mapon(); |
| 176 | #endif |
| 177 | #ifdef __linux__ |
| 178 | linux_mapon(); |
| 179 | #endif |
| 180 | (void) signal(SIGTSTP, SIG_DFL); |
| 181 | #ifdef AUX |
| 182 | (void) kill(0, SIGSTOP); |
| 183 | #else |
| 184 | (void) kill(0, SIGTSTP); |
| 185 | #endif |
| 186 | #ifdef _M_UNIX |
| 187 | sco_mapoff(); |
| 188 | #endif |
| 189 | #ifdef __linux__ |
| 190 | linux_mapoff(); |
| 191 | #endif |
| 192 | resume_nhwindows(); |
| 193 | } else { |
| 194 | pline("I don't think your shell has job control."); |
| 195 | } |
| 196 | #else |
| 197 | pline("Sorry, it seems we have no SIGTSTP here. Try ! or S."); |
| 198 | #endif |
| 199 | return (0); |
| 200 | } |
| 201 | #endif /* SUSPEND */ |
no test coverage detected