| version 1.5, 2003/12/05 14:02:23 |
version 1.10, 2015/10/10 11:29:46 |
|
|
| /* $OpenXM: OpenXM/src/k097/ox_k0.c,v 1.4 2003/11/19 00:11:02 takayama Exp $ */ |
/* $OpenXM: OpenXM/src/k097/ox_k0.c,v 1.9 2013/11/07 07:29:47 takayama Exp $ */ |
| #include <stdio.h> |
#include <stdio.h> |
| #include <sys/types.h> |
#include <sys/types.h> |
| #include <sys/socket.h> |
#include <sys/socket.h> |
|
|
| #include <netdb.h> |
#include <netdb.h> |
| #include <signal.h> |
#include <signal.h> |
| #include <setjmp.h> |
#include <setjmp.h> |
| |
#include <string.h> |
| |
#include <stdlib.h> |
| /* -lnsl -lsocket /usr/ucblib/libucb.a */ |
/* -lnsl -lsocket /usr/ucblib/libucb.a */ |
| #include "../kxx/ox_kan.h" |
#include "../kxx/ox_kan.h" |
| #include "../kxx/serversm.h" |
#include "../kxx/serversm.h" |
| Line 18 int PacketMonitor = 0; |
|
| Line 20 int PacketMonitor = 0; |
|
| extern int SerialOX; /* Serial number of the packets sent. */ |
extern int SerialOX; /* Serial number of the packets sent. */ |
| extern int SerialCurrent; /* Current Serial number of the recieved packet. */ |
extern int SerialCurrent; /* Current Serial number of the recieved packet. */ |
| extern int OXprintMessage; /* print oxmessages? */ |
extern int OXprintMessage; /* print oxmessages? */ |
| |
extern int Calling_ctrlC_hook; |
| |
|
| #if defined(__CYGWIN__) |
#if defined(__CYGWIN__) |
| sigjmp_buf EnvOfChildServer; |
sigjmp_buf EnvOfChildServer; |
| Line 68 nullserver(int fdStreamIn,int fdStreamOut) { |
|
| Line 71 nullserver(int fdStreamIn,int fdStreamOut) { |
|
| ox_stream ostreamIn; |
ox_stream ostreamIn; |
| ox_stream ostreamOut; |
ox_stream ostreamOut; |
| char sreason[1024]; |
char sreason[1024]; |
| |
extern int RestrictedMode, RestrictedMode_saved; |
| extern void controlResetHandler(); |
extern void controlResetHandler(); |
| #if defined(__CYGWIN__) |
#if defined(__CYGWIN__) |
| extern sigjmp_buf EnvOfStackMachine; |
extern sigjmp_buf EnvOfStackMachine; |
| Line 118 nullserver(int fdStreamIn,int fdStreamOut) { |
|
| Line 122 nullserver(int fdStreamIn,int fdStreamOut) { |
|
| if (OxInterruptFlag == 0) { |
if (OxInterruptFlag == 0) { |
| fprintf(stderr," ?! \n"); fflush(NULL); |
fprintf(stderr," ?! \n"); fflush(NULL); |
| } |
} |
| KSexecuteString(" ctrlC-hook "); /* Execute User Defined functions. */ |
if (!Calling_ctrlC_hook) { |
| |
Calling_ctrlC_hook = 1; RestrictedMode = 0; |
| |
KSexecuteString(" ctrlC-hook "); /* Execute User Defined functions. */ |
| |
RestrictedMode = RestrictedMode_saved; |
| |
} |
| |
Calling_ctrlC_hook = 0; |
| KSexecuteString(" (Computation is interrupted.) "); |
KSexecuteString(" (Computation is interrupted.) "); |
| InSendmsg2 = 0; |
InSendmsg2 = 0; |
| signal(SIGUSR1,controlResetHandler); goto aaa; |
signal(SIGUSR1,controlResetHandler); goto aaa; |
| Line 152 nullserver(int fdStreamIn,int fdStreamOut) { |
|
| Line 161 nullserver(int fdStreamIn,int fdStreamOut) { |
|
| */ |
*/ |
| Sm1_pushError2(SerialCurrent,-1,"Global jump by sm1 error"); |
Sm1_pushError2(SerialCurrent,-1,"Global jump by sm1 error"); |
| |
|
| KSexecuteString(" ctrlC-hook "); /* Execute User Defined functions. */ |
if (!Calling_ctrlC_hook) { |
| |
Calling_ctrlC_hook = 1; RestrictedMode = 0; |
| |
KSexecuteString(" ctrlC-hook "); /* Execute User Defined functions. */ |
| |
RestrictedMode = RestrictedMode_saved; |
| |
} |
| |
Calling_ctrlC_hook = 0; |
| InSendmsg2=0; |
InSendmsg2=0; |
| signal(SIGUSR1,controlResetHandler); goto aaa ; |
signal(SIGUSR1,controlResetHandler); goto aaa ; |
| } else { |
} else { |
| Line 330 nullserver_simplest(int fd) { |
|
| Line 344 nullserver_simplest(int fd) { |
|
| int c; |
int c; |
| while(1) { |
while(1) { |
| c = readOneByte(fd); |
c = readOneByte(fd); |
| if (c == '@') { return; } |
if (c == '@') { return 0; } |
| } |
} |
| } |
} |
| |
|
| Line 345 void controlResetHandler(sig) |
|
| Line 359 void controlResetHandler(sig) |
|
| if (OxCritical) { |
if (OxCritical) { |
| return; |
return; |
| }else{ |
}else{ |
| |
(void) traceShowStack(); traceClearStack(); |
| #if defined(__CYGWIN__) |
#if defined(__CYGWIN__) |
| siglongjmp(EnvOfChildServer,2); /* returns 2 for ctrl-C */ |
siglongjmp(EnvOfChildServer,2); /* returns 2 for ctrl-C */ |
| #else |
#else |