00001 /* 00002 * Copyright 2004 PathScale, Inc. All Rights Reserved. 00003 */ 00004 00005 /* 00006 00007 Copyright (C) 2000, 2001 Silicon Graphics, Inc. All Rights Reserved. 00008 00009 This program is free software; you can redistribute it and/or modify it 00010 under the terms of version 2.1 of the GNU Lesser General Public License 00011 as published by the Free Software Foundation. 00012 00013 This program is distributed in the hope that it would be useful, but 00014 WITHOUT ANY WARRANTY; without even the implied warranty of 00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 00016 00017 Further, this software is distributed without any warranty that it is 00018 free of the rightful claim of any third person regarding infringement 00019 or the like. Any license provided herein, whether implied or 00020 otherwise, applies only to this software file. Patent licenses, if 00021 any, provided herein do not apply to combinations of this program with 00022 other software, or any other product whatsoever. 00023 00024 You should have received a copy of the GNU Lesser General Public 00025 License along with this program; if not, write the Free Software 00026 Foundation, Inc., 59 Temple Place - Suite 330, Boston MA 02111-1307, 00027 USA. 00028 00029 Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pky, 00030 Mountain View, CA 94043, or: 00031 00032 http://www.sgi.com 00033 00034 For further information regarding this notice, see: 00035 00036 http://oss.sgi.com/projects/GenInfo/NoticeExplan 00037 00038 */ 00039 00040 00041 /* $Header: /proj/osprey/CVS/open64/osprey1.0/libF77/s_paus.c,v 1.1.1.1 2005/10/21 19:00:00 marcel Exp $ */ 00042 00043 #include <stdio.h> 00044 #include <stdlib.h> 00045 #include <unistd.h> 00046 #include <signal.h> /* DAG */ 00047 #include <string.h> 00048 #include "cmplrs/host.h" 00049 00050 extern void f_exit (void); 00051 static void waitpause(int); /* DAG */ 00052 00053 void 00054 s_paus(string s, fsize_t n) 00055 { 00056 fsize_t i; 00057 00058 fprintf(stderr, "PAUSE "); 00059 for(i = 0; i < n; ++i) putc(*s++, stderr); 00060 fprintf(stderr, " statement executed\n"); 00061 if( isatty(fileno(stdin)) ) { 00062 fprintf(stderr, "To resume execution, type go. Any other input will terminate job.\n"); 00063 if( getchar()!='g' || getchar()!='o' || getchar()!='\n' ) { 00064 fprintf(stderr, "STOP\n"); 00065 #ifndef FTN90_IO 00066 f_exit(); 00067 #endif 00068 exit(0); 00069 } 00070 } else { 00071 fprintf(stderr, 00072 "To resume execution, execute a kill -%d %d command\n", 00073 SIGTERM, getpid() ); 00074 (void)signal(SIGTERM, waitpause); /* DAG */ 00075 pause(); 00076 } 00077 fprintf(stderr, "Execution resumes after PAUSE.\n"); 00078 } 00079 00080 00081 00082 00083 00084 static void /* DAG */ 00085 waitpause(int x) 00086 { 00087 return; 00088 } 00089 00090
1.5.6