MCPcopy Create free account
hub / github.com/NetHack/NetHack / dosuspend

Function dosuspend

sys/share/ioctl.c:160–200  ·  view source on GitHub ↗

No longer implies BSD */

Source from the content-addressed store, hash-verified

158
159#ifdef SUSPEND /* No longer implies BSD */
160int
161dosuspend(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 */

Callers 1

catch_stpFunction · 0.70

Calls 7

NorepFunction · 0.85
sco_maponFunction · 0.85
linux_maponFunction · 0.85
sco_mapoffFunction · 0.85
linux_mapoffFunction · 0.85
check_user_stringFunction · 0.50
plineFunction · 0.50

Tested by

no test coverage detected