1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
-
+
|
/*
* tclUnixTest.c --
*
* Contains platform specific test commands for the Unix platform.
*
* Copyright (c) 1996-1997 Sun Microsystems, Inc.
* Copyright (c) 1998 by Scriptics Corporation.
*
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
* RCS: @(#) $Id: tclUnixTest.c,v 1.14 2003/02/15 22:30:29 kennykb Exp $
* RCS: @(#) $Id: tclUnixTest.c,v 1.14.2.1 2003/10/13 01:00:38 hobbs Exp $
*/
#include "tclInt.h"
#include "tclPort.h"
/*
* The headers are needed for the testalarm command that verifies the
|
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
|
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
|
-
+
-
-
-
|
memset((void *)&action.sa_mask, 0, sizeof(sigset_t));
action.sa_flags = SA_RESTART;
if (sigaction(SIGALRM, &action, NULL) < 0) {
Tcl_AppendResult(interp, "sigaction: ", Tcl_PosixError(interp), NULL);
return TCL_ERROR;
}
if (alarm(sec) < 0) {
(void)alarm(sec);
Tcl_AppendResult(interp, "alarm: ", Tcl_PosixError(interp), NULL);
return TCL_ERROR;
}
return TCL_OK;
#else
Tcl_AppendResult(interp, "warning: sigaction SA_RESTART not support on this platform", NULL);
return TCL_ERROR;
#endif
}
|