New condition for Unix signals.

This commit is contained in:
Juan Jose Garcia Ripoll 2010-08-20 23:41:30 +02:00
parent dc2ce379ec
commit b54f17085c
4 changed files with 18 additions and 1 deletions

View file

@ -1945,5 +1945,9 @@ cl_symbols[] = {
{EXT_ "SSE-PACK-ELEMENT-TYPE", EXT_ORDINARY, si_sse_pack_element_type, 1, OBJNULL},
#endif
{EXT_ "UNIX-SIGNAL-RECEIVED", EXT_ORDINARY, NULL, -1, OBJNULL},
{EXT_ "UNIX-SIGNAL-RECEIVED-CODE", EXT_ORDINARY, NULL, -1, OBJNULL},
{KEY_ "CODE", KEYWORD, NULL, -1, OBJNULL},
/* Tag for end of list */
{NULL, CL_ORDINARY, NULL, -1, OBJNULL}};

View file

@ -1945,5 +1945,9 @@ cl_symbols[] = {
{EXT_ "SSE-PACK-ELEMENT-TYPE","si_sse_pack_element_type"},
#endif
{EXT_ "UNIX-SIGNAL-RECEIVED",NULL},
{EXT_ "UNIX-SIGNAL-RECEIVED-CODE",NULL},
{KEY_ "CODE",NULL},
/* Tag for end of list */
{NULL,NULL}};

View file

@ -367,7 +367,7 @@ handle_signal_now(cl_object signal_code)
{
switch (type_of(signal_code)) {
case t_fixnum:
FEerror("Serious signal ~D caught.", 1, signal_code);
cl_error(3, @'ext::unix-signal-received', @':code', signal_code);
break;
case t_symbol:
cl_error(1, signal_code);

View file

@ -515,6 +515,15 @@ or return to an outer frame, undoing all the function calls so far."
(format stream "Memory limit reached. Please jump to an outer pointer, quit program and enlarge the
memory limits before executing the program again."))))
(define-condition ext:unix-signal-received ()
((code :type fixnum
:initform 0
:initarg :signal-code
:accessor ext:unix-signal-received-code))
(:report (lambda (condition stream)
(format stream "Serious signal ~D caught."
(ext:unix-signal-received-code condition)))))
(define-condition type-error (error)
((datum :INITARG :DATUM :READER type-error-datum)
(expected-type :INITARG :EXPECTED-TYPE :READER type-error-expected-type))