00001 /* 00002 00003 Copyright (C) 2000, 2001 Silicon Graphics, Inc. All Rights Reserved. 00004 00005 This program is free software; you can redistribute it and/or modify it 00006 under the terms of version 2.1 of the GNU Lesser General Public License 00007 as published by the Free Software Foundation. 00008 00009 This program is distributed in the hope that it would be useful, but 00010 WITHOUT ANY WARRANTY; without even the implied warranty of 00011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 00012 00013 Further, this software is distributed without any warranty that it is 00014 free of the rightful claim of any third person regarding infringement 00015 or the like. Any license provided herein, whether implied or 00016 otherwise, applies only to this software file. Patent licenses, if 00017 any, provided herein do not apply to combinations of this program with 00018 other software, or any other product whatsoever. 00019 00020 You should have received a copy of the GNU Lesser General Public 00021 License along with this program; if not, write the Free Software 00022 Foundation, Inc., 59 Temple Place - Suite 330, Boston MA 02111-1307, 00023 USA. 00024 00025 Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pky, 00026 Mountain View, CA 94043, or: 00027 00028 http://www.sgi.com 00029 00030 For further information regarding this notice, see: 00031 00032 http://oss.sgi.com/projects/GenInfo/NoticeExplan 00033 00034 */ 00035 00036 00037 #pragma ident "@(#) libf/pxf/pxfpause.c 92.1 06/29/99 11:36:06" 00038 00039 00040 /* 00041 * PXFPAUSE -- Suspend Process Execution. 00042 * (section 3.4.2 of Posix 1003.9-1992) 00043 * 00044 * Synopsis: 00045 * 00046 * SUBROUTINE PXFPAUSE(ierror) 00047 * INTEGER ierror 00048 * 00049 * Where: 00050 * 00051 * ierror - default integer output variable containing 00052 * status. The pause function is never 00053 * successful. 00054 * 00055 * nonzero - PXFPAUSE returned. 00056 * 00057 * The following error may be returned: 00058 * 00059 * EINTR - Signal is caught by the calling process and 00060 * control is returned from the signal-catching 00061 * function. 00062 * 00063 * DESCRIPTION: 00064 * 00065 * The subroutine procedure PXFPAUSE uses the pause() system call 00066 * to suspend process execution. 00067 * 00068 * NOTE: 00069 * 00070 * Replace the use of subprocedure PAUSE() with the PXFPAUSE() 00071 * interface in Fortran programs for portability. 00072 * 00073 * On UNICOS and UNICOS/mk systems, pause() is a function or 00074 * a subroutine reference. On IRIX systems, pause() is a 00075 * function reference. 00076 */ 00077 00078 #include <errno.h> 00079 #include <fortran.h> 00080 #include <sys/types.h> 00081 #include <unistd.h> 00082 00083 #ifdef _UNICOS 00084 void 00085 PXFPAUSE( 00086 #else /* _UNICOS */ 00087 void 00088 _PXFPAUSE( 00089 #endif /* _UNICOS */ 00090 _f_int *ierror 00091 ) 00092 { 00093 int stat; 00094 *ierror = 0; 00095 /* possible EINTR for interrupt */ 00096 if ((stat = pause()) < 0) { 00097 *ierror = errno; 00098 } 00099 return; 00100 } 00101 00102 #ifndef _UNICOS 00103 void 00104 pxfpause_( 00105 _f_int *ierror 00106 ) 00107 { 00108 _PXFPAUSE(ierror); 00109 } 00110 #endif /* not _UNICOS */
1.5.6