USE THESE FUNCTIONS IN PLACE OF fprintf() AND sprintf() IN ALL CODE DUE TO STRUCTURE PACKING OPTIONS CAUSING SIGSEGV IN SOME ARCHITECTURES (specifically Solaris 32-bit) WITH 'GCC'
THIS FILE MUST BE COMPILED WITH STRUCTURE PACKING OFF (at least for the default GCC stdio library) OR IN THE SAME MANNER IN WHICH YOUR COMPILER'S RUNTIME LIBRARY HAS IT COMPILED. (You may get unexplainable SIGSEGV errors otherwise.)
Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
Licensed under the Apache License, Version 2.0 ("the License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and limitations under the License.
Definition in file stdio.c.
#include "arch.h"
#include <stdio.h>
#include <stdarg.h>
#include "jvmcfg.h"
#include "util.h"
Go to the source code of this file.
Macro support for local standard output utilities | |||||||||||||
#define | LOCAL_FPRINTF(FP) | ||||||||||||
#define | LOCAL_SPRINTF | ||||||||||||
Magic redirection of selected standard I/O functions. | |||||||||||||
In jvmcfg.h, there are several #define statements that redirect printf() and fprintf() and sprintf() from the <stdio.h> linkages to local linkages.
This magic redirection used the compile-time definition
| |||||||||||||
int | _fprintfLocal (FILE *fp, const rchar *fmt,...) | ||||||||||||
int | _printfLocal (const rchar *fmt,...) | ||||||||||||
int | _sprintfLocal (rchar *bfr, const rchar *fmt,...) | ||||||||||||
Local version of standard output routines. | |||||||||||||
Local implementations of sprintf(3) and fprintf(3) are provided for both stdout and stderr. These functions are intended to bypass the structure packing mismatch between the requirements of parts of this application and the manner in which any compiler's runtime library was compiled.In the same manner as the printf() style printing functions above, there are three versions of this routine. In this case, one writes to standard output, another to standard error, and the third formats a buffer.
| |||||||||||||
int | fprintfLocalStderr (rchar *fmt,...) | ||||||||||||
int | fprintfLocalStdout (rchar *fmt,...) | ||||||||||||
int | sprintfLocal (rchar *bfr, rchar *fmt,...) | ||||||||||||
printf() style printing to standard error and | |||||||||||||
buffer formatting. There are three versions of this routine. One conditionally prints a message to stderr based on a debug level. The others perform unconditional actions. Create a variable-argument message to standard error or a buffer in a fashion with a tag string on the front telling what type of error it is.
| |||||||||||||
int | sysDbgMsg (rint dml, rchar *fn, rchar *fmt,...) | ||||||||||||
int | sysErrMsg (rchar *fn, rchar *fmt,...) | ||||||||||||
int | sysErrMsgBfrFormat (rchar *bfr, rchar *fn, rchar *fmt,...) | ||||||||||||
Defines | |||||||||||||
#define | I_AM_STDIO_C | ||||||||||||
#define | SUPPRESS_STDIO_REDIRECTION | ||||||||||||
Functions | |||||||||||||
static void | stdio_c_dummy (void) | ||||||||||||
Variables | |||||||||||||
static char * | stdio_c_copyright = "\0" "$URL: https://svn.apache.org/path/name/stdio.c $ $Id: stdio.c 0 09/28/2005 dlydick $" " " "Copyright 2005 The Apache Software Foundation or its licensors, as applicable." |
|
|
|
|
|
Value: va_list ap; \ va_start(ap, fmt); \ \ int rc = vfprintf(FP, fmt, ap); \ \ va_end(ap); \ fflush(FP); \ JVMCFG_DEBUG_ECLIPSE_FLUSH_STDIO_BETTER; \ return(rc) Definition at line 179 of file stdio.c. Referenced by fprintfLocalStderr(), and fprintfLocalStdout(). |
|
Value: va_list ap; \ va_start(ap, fmt); \ \ int rc = vsprintf(bfr, fmt, ap); \ \ va_end(ap); \ return(rc) Definition at line 190 of file stdio.c. Referenced by sprintfLocal(). |
|
|
|
< Convenient size for any stdio msg Definition at line 96 of file stdio.c. References JVMCFG_DEBUG_ECLIPSE_FLUSH_STDIO_BETTER, JVMCFG_DEBUG_MESSAGE_ENABLE, JVMCFG_STDIO_BFR, jvmutil_get_dml(), rfalse, and sprintf. Referenced by cfattrib_loadattribute(), cfmsgs_typemsg(), classfile_loadclassdata(), and timeslice_tick(). |
|
< Convenient size for any stdio msg Definition at line 130 of file stdio.c. References JVMCFG_DEBUG_ECLIPSE_FLUSH_STDIO_BETTER, JVMCFG_STDIO_BFR, and sprintf. Referenced by _fprintfLocal(), _printfLocal(), _sprintfLocal(), argv_init(), heap_init_bimodal(), jvm_manual_thread_run(), jvm_run(), manifest_get_main(), object_run_method(), opcode_load_run_throwable(), opcode_run(), timeslice_init(), and timeslice_run(). |
|
< Convenient size for any stdio msg Definition at line 151 of file stdio.c. References JVMCFG_STDIO_BFR, and sprintf. |
|
Definition at line 226 of file stdio.c. References LOCAL_FPRINTF. |
|
Definition at line 233 of file stdio.c. References LOCAL_FPRINTF. Referenced by jvmutil_print_stack_common(), and opcode_load_run_throwable(). |
|
Definition at line 239 of file stdio.c. References LOCAL_SPRINTF. Referenced by cfmsgs_typemsg(), jvmutil_print_errtype_stack(), and thread_init(). |
|
Definition at line 276 of file stdio.c. References sysErrMsg(). |
|
Definition at line 283 of file stdio.c. References sysErrMsg(). |
|
Definition at line 290 of file stdio.c. References sysErrMsg(). |
|
|