=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/Attic/client-fn.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- src/usr.bin/tmux/Attic/client-fn.c 2009/07/29 14:17:26 1.3 +++ src/usr.bin/tmux/Attic/client-fn.c 2009/07/30 16:32:12 1.4 @@ -1,4 +1,4 @@ -/* $OpenBSD: client-fn.c,v 1.3 2009/07/29 14:17:26 nicm Exp $ */ +/* $OpenBSD: client-fn.c,v 1.4 2009/07/30 16:32:12 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -20,6 +20,7 @@ #include #include +#include #include "tmux.h" @@ -73,4 +74,24 @@ if (buf != NULL && len > 0) buffer_write(cctx->srv_out, buf, len); +} + +void +client_suspend(void) +{ + struct sigaction act; + + memset(&act, 0, sizeof act); + sigemptyset(&act.sa_mask); + act.sa_flags = SA_RESTART; + + act.sa_handler = SIG_DFL; + if (sigaction(SIGTSTP, &act, NULL) != 0) + fatal("sigaction failed"); + + act.sa_handler = sighandler; + if (sigaction(SIGCONT, &act, NULL) != 0) + fatal("sigaction failed"); + + kill(getpid(), SIGTSTP); }