This file is indexed.

/usr/lib/x86_64-linux-gnu/fis-gtm/V6.3-000A_x86_64/gtm_stdio.h is in fis-gtm-6.3-000a 6.3-000A-1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
/****************************************************************
 *								*
 * Copyright (c) 2010-2015 Fidelity National Information	*
 * Services, Inc. and/or its subsidiaries. All rights reserved.	*
 *								*
 *	This source code contains the intellectual property	*
 *	of its copyright holder(s), and is made available	*
 *	under a license.  If you do not know the terms of	*
 *	the license, please stop and do not read further.	*
 *								*
 ****************************************************************/

/* gtm_stdio.h - gtm interface to stdio.h */

#ifndef GTM_STDIOH
#define GTM_STDIOH

/* This header is split between sr_unix and sr_vvms because there are several test system and standalone modules
 * that do not #define UNIX or VMS for us to know which defines to proceed with. So now this split makes
 * that determination unnecessary. Note we still use the definition of UNIX or not in THIS header to indicate the
 * compilation of a GTM source file or a standalone file not needing (or able to get to) libgtmshr wrappers.
 */

#include <stdio.h>

#ifdef UNIX
/* If interrupted, the following functions have previously caused hangs, so defer interrupts for their duration to be safe. However,
 * since gtm_stdio.h may be included in a non-GT.M compilation, we define the macros differently based on the UNIX compiler switch,
 * which should only be defined within GT.M.
 */
#  define FDOPEN(VAR, FILE_DES, MODE)					\
{									\
	intrpt_state_t		prev_intrpt_state;			\
									\
	DEFER_INTERRUPTS(INTRPT_IN_FDOPEN, prev_intrpt_state);		\
	VAR = fdopen(FILE_DES, MODE);					\
	ENABLE_INTERRUPTS(INTRPT_IN_FDOPEN, prev_intrpt_state);		\
}

/* Fopen() is not fully capitalized because there is an FOPEN() macro on AIX. */
#  define Fopen(VAR, PATH, MODE)						\
{										\
	intrpt_state_t		prev_intrpt_state;				\
										\
	DEFER_INTERRUPTS(INTRPT_IN_FUNC_WITH_MALLOC, prev_intrpt_state);	\
	VAR = fopen(PATH, MODE);						\
	ENABLE_INTERRUPTS(INTRPT_IN_FUNC_WITH_MALLOC, prev_intrpt_state);	\
}
#else
#  define FDOPEN(VAR, FILE_DES, MODE)			\
{							\
	VAR = fdopen(FILD_DES, MODE);			\
}

#  define Fopen(VAR, PATH, MODE)			\
{							\
	VAR = fopen(PATH, MODE);			\
}
#endif

#define FGETS(strg, n, strm, fgets_res)	(fgets_res = fgets(strg,n,strm))
#define GETS(buffer, gets_res)		syntax error
#define PERROR				perror
#define	POPEN				popen
#define TEMPNAM				tempnam
#ifndef P_tmpdir
#define P_tmpdir			"/tmp"
#endif
#define	DEFAULT_GTM_TMP			P_tmpdir
#define RENAME				rename
#define SETVBUF				setvbuf

#ifdef UNIX
/* We are compiling a GTM source module if UNIX is defined */
#  define FPRINTF			gtm_fprintf
#  define PRINTF			gtm_printf
#  define SPRINTF			gtm_sprintf
#  define SNPRINTF			gtm_snprintf
int	gtm_printf(const char *format, ...);
int	gtm_fprintf(FILE *stream, const char *format, ...);
int	gtm_sprintf(char *str, const char *format, ...);
int	gtm_snprintf(char *str, size_t size, const char *format, ...);
#else
/* We are compiling a standalone or test system module so no override (This is NOT VMS)  */
#  define FPRINTF			fprintf
#  define PRINTF			printf
#  define SPRINTF			sprintf
#  define SNPRINTF			snprintf
#endif

/* Similar to above for *scanf invocations. Note however that TRU64 does NOT have
 * the v*scanf functions used by the wrappers so always use the non-wrapper versions.
 */
#if defined(UNIX) && !defined(__osf__)
#  define SCANF				gtm_scanf
#  define SSCANF			gtm_sscanf
#  define FSCANF			gtm_fscanf
int	gtm_scanf(const char *format, ...);
int	gtm_fscanf(FILE *stream, const char *format, ...);
int	gtm_sscanf(char *str, const char *format, ...);
#else
#  define SCANF				scanf
#  define SSCANF			sscanf
#  define FSCANF			fscanf
#endif

#define VPRINTF(FORMAT, VALUE, RC)				\
{								\
	do							\
	{							\
		RC = vprintf(FORMAT, VALUE);			\
	} while(-1 == RC && EINTR == errno);			\
}
#define VFPRINTF(STREAM, FORMAT, VALUE, RC)			\
{								\
	do							\
	{							\
		RC = vfprintf(STREAM, FORMAT, VALUE);		\
	} while(-1 == RC && EINTR == errno);			\
}
#define VSPRINTF(STRING, FORMAT, VALUE, RC)			\
{								\
	do							\
	{							\
		RC = vsprintf(STRING, FORMAT, VALUE);		\
	} while(-1 == RC && EINTR == errno);			\
}
#define VSNPRINTF(STRING, SIZE, FORMAT, VALUE, RC)		\
{								\
	do							\
	{							\
		RC = vsnprintf(STRING, SIZE, FORMAT, VALUE);	\
	} while(-1 == RC && EINTR == errno);			\
}

/* Note TRU64 does not have these v*scanf() functions so they will generate errors if used */
#define VSCANF(FORMAT, POINTER, RC)				\
{								\
	do							\
	{							\
		RC = vscanf(FORMAT, POINTER);			\
	} while(-1 == RC && EINTR == errno);			\
}
#define VSSCANF(STRING, FORMAT, POINTER, RC)			\
{								\
	do							\
	{							\
		RC = vsscanf(STRING, FORMAT, POINTER);		\
	} while(-1 == RC && EINTR == errno);			\
}
#define VFSCANF(STREAM, FORMAT, POINTER, RC)			\
{								\
	do							\
	{							\
		RC = vfscanf(STREAM, FORMAT, POINTER);		\
	} while(-1 == RC && EINTR == errno);			\
}

#define SPRINTF_ENV_NUM(BUFF, ENV_VAR, ENV_VAL, ENV_IND)						\
{													\
	assert(NULL == strchr(ENV_VAR, '='));	/* strchr() done in ojstartchild() relies on this */	\
	SPRINTF(BUFF, "%s=%d", ENV_VAR, ENV_VAL); *ENV_IND++ = BUFF;					\
}

#define SPRINTF_ENV_STR(BUFF, ENV_VAR, ENV_VAL, ENV_IND)						\
{													\
	assert(NULL == strchr(ENV_VAR, '='));	/* strchr() done in ojstartchild() relies on this */	\
	SPRINTF(BUFF, "%s=%s", ENV_VAR, ENV_VAL); *ENV_IND++ = BUFF;					\
}

#endif