2 .\" Copyright (c) 2006, Sun Microsystems, Inc. All Rights Reserved.
3 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
4 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
5 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
6 .TH EXTENDEDFILE 5 "Apr 18, 2006"
8 extendedFILE \- enable extended FILE facility usage
12 $ ulimit \fB-n\fR \fIN_file_descriptors\fR
13 $ LD_PRELOAD_32=/usr/lib/extendedFILE.so.1 \fIapplication\fR [\fIarg\fR...]
19 The \fBextendedFILE.so.1\fR is not a library but an enabler of the extended
23 The extended FILE facility allows 32-bit processes to use any valid file
24 descriptor with the standard I/O (see \fBstdio\fR(3C)) C library functions.
25 Historically, 32-bit applications have been limited to using the first 256
26 numerical file descriptors for use with standard I/O streams. By using the
27 extended FILE facility this limitation is lifted. Any valid file descriptor can
28 be used with standard I/O. See the NOTES section of
29 \fBenable_extended_FILE_stdio\fR(3C).
32 The extended FILE facility is enabled from the shell level before an
33 application is launched. The file descriptor limit must also be raised. The
34 syntax for raising the file descriptor limit is
38 $ ulimit -n \fImax_file_descriptors\fR
39 $ LD_PRELOAD_32=/usr/lib/extendedFILE.so.1 \fIapplication\fR [\fIarg\fR...]
45 where \fImax_file_descriptors\fR is the maximum number of file descriptors
46 desired. See \fBlimit\fR(1). The maximum value is the same as the maximum value
48 .SH ENVIRONMENT VARIABLES
51 The following environment variables control the behavior of the extended FILE
56 \fB\fB_STDIO_BADFD\fR\fR
59 This variable takes an integer representing the lowest file descriptor, which
60 will be made unallocatable. This action provides a protection mechanism so that
61 applications that abuse interfaces do not experience silent data corruption.
62 The value must be between 3 and 255 inclusive.
68 \fB\fB_STDIO_BADFD_SIGNAL\fR\fR
71 This variable takes an integer or string representing any valid signal. See
72 \fBsignal.h\fR(3HEAD) for valid values or strings. This environment variable
73 causes the specified signal to be sent to the application if certain
74 exceptional cases are detected during the use of this facility. The default
75 signal is \fBSIGABRT\fR.
80 \fBExample 1 \fRLimit the number of file descriptors and FILE standard I/O
84 The following example limits the number of file descriptors and FILE standard
85 I/O structures to 1000.
91 $ LD_PRELOAD_32=/usr/lib/extendedFILE.so.1 application [arg...]
96 \fBExample 2 \fREnable the extended FILE facility.
99 The following example enables the extended FILE facility. See
100 \fBenable_extended_FILE_stdio\fR(3C) for more examples.
106 $ _STDIO_BADFD=100 _STDIO_BADFD_SIGNAL=SIGABRT \e
107 LD_PRELOAD_32=/usr/lib/extendedFILE.so.1 \e
108 application [arg ...]
113 \fBExample 3 \fRSet up the extended FILE environment and start the application.
116 The following shell script first sets up the proper extended FILE environment
117 and then starts the application:
124 echo "usage: $0 application [arguments...]"
128 # _STDIO_BADFD=196; export _STDIO_BADFD
129 # _STDIO_BADFD_SIGNAL=SIGABRT; export _STDIO_BADFD_SIGNAL
130 LD_PRELOAD_32=/usr/lib/extendedFILE.so.1; export LD_PRELOAD_32
139 \fB\fB/usr/lib/extendedFILE.so.1\fR\fR
148 See \fBattributes\fR(5) for descriptions of the following attributes:
156 ATTRIBUTE TYPE ATTRIBUTE VALUE
158 Interface Stability Stable
166 \fBlimit\fR(1), \fBopen\fR(2), \fBenable_extended_FILE_stdio\fR(3C),
167 \fBfdopen\fR(3C), \fBfopen\fR(3C), \fBpopen\fR(3C), \fBsignal.h\fR(3HEAD),
168 \fBstdio\fR(3C), \fBattributes\fR(5)
172 The following displayed message
176 Application violated extended FILE safety mechanism.
177 Please read the man page for extendedFILE.
185 is an indication that your application is modifying the internal file
186 descriptor field of the \fBFILE\fR structure from standard I/O. Continued use
187 of this extended FILE facility could harm your data. Do not use the extended
188 FILE facility with your application.