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/pxfsigpending.c 92.1 06/29/99 11:36:06" 00038 00039 00040 /* 00041 * PXFSIGSIGPENDING -- Examine pending signals. 00042 * (section 3.3.6 of Posix 1003.9-1992) 00043 * 00044 * Synopsis: 00045 * 00046 * SUBROUTINE PXFSIGPENDING(jsigset, ierror) 00047 * INTEGER jsigset, ierror 00048 * 00049 * Where: 00050 * 00051 * jsigset is a default integer input variable containing a 00052 * handle created by PXFSTRUCTCREATE('sigset',...) 00053 * ierror is a default integer output variable containing 00054 * status: 00055 * zero - PXFSIGPENDING was successful. 00056 * 00057 * nonzero - PXFSIGPENDING was not successful. 00058 * 00059 * DESCRIPTION: 00060 * 00061 * Subroutine procedure PXFSIGPENDING uses sigpending() function 00062 * to retrieve the signal set in the handle jsigset. 00063 * 00064 * PXFSIGPENDING may return one of the following error values: 00065 * 00066 * EFAULT The jsigset argument points outside the 00067 * allocated space. 00068 * 00069 * EBADHANDLE The jsigset argument is invalid. 00070 * 00071 */ 00072 00073 #include <errno.h> 00074 #include <fortran.h> 00075 #include <liberrno.h> 00076 #include <string.h> 00077 #include <sys/signal.h> 00078 #include "pxfstruct.h" 00079 #include "pxfstructtable.h" 00080 #include "table.h" 00081 00082 #ifndef _UNICOS 00083 #include <stddef.h> 00084 #endif 00085 00086 #ifdef _UNICOS 00087 void 00088 PXFSIGPENDING( 00089 #else /* _UNICOS */ 00090 void 00091 _PXFSIGPENDING( 00092 #endif /* _UNICOS */ 00093 _f_int *jsigset, 00094 _f_int *ierror 00095 ) 00096 { 00097 int stat; 00098 sigset_t mask; 00099 struct pxfhandle pxfhand; 00100 *ierror = 0; 00101 pxfhand = _pxfhandle_table_lookup(&_pxfhandle_table, *jsigset); 00102 if (pxfhand.pxfstructptr == NULL || pxfhand.pxftype != PXF_SIGSET) { 00103 *ierror = EBADHANDLE; 00104 return; 00105 } 00106 mask = ((struct sig_set *)(pxfhand.pxfstructptr))->samask; 00107 if ((stat = (_f_int) sigpending(&mask)) == -1) 00108 *ierror = errno; 00109 else 00110 ((struct sig_set *)(pxfhand.pxfstructptr))->samask = mask; 00111 return; 00112 } 00113 00114 #ifndef _UNICOS 00115 void 00116 pxfsigpending_( 00117 _f_int *jsigset, 00118 _f_int *ierror 00119 ) 00120 { 00121 _PXFSIGPENDING(jsigset, ierror); 00122 } 00123 #endif /* not _UNICOS */
1.5.6