4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
23 * Copyright (c) 1999 by Sun Microsystems, Inc.
24 * All rights reserved.
27 #pragma ident "%Z%%M% %I% %E% SMI"
34 #include <fcode/private.h>
40 user_abort(fcode_env_t
*env
)
42 forth_abort(env
, "user-abort called");
45 static fstack_t alarm_xt
;
46 static fstack_t alarm_ms
;
47 static fcode_env_t
*alarm_env
;
50 catch_alarm(int signo
)
52 fcode_env_t
*env
= alarm_env
;
54 if (env
&& alarm_xt
&& alarm_ms
) {
57 signal(SIGALRM
, catch_alarm
);
58 alarm((alarm_ms
+ 999)/1000);
66 do_alarm(fcode_env_t
*env
)
70 CHECK_DEPTH(env
, 2, "alarm");
75 signal(SIGALRM
, SIG_DFL
);
80 signal(SIGALRM
, catch_alarm
);
84 alarm((ms
+ 999)/1000);
93 fcode_env_t
*env
= initial_env
;
98 P1275(0x213, 0, "alarm", do_alarm
);
100 P1275(0x219, 0, "user-abort", user_abort
);