1extendedFILE(5) Standards, Environments, and Macros extendedFILE(5)
2
3
4
6 extendedFILE - enable extended FILE facility usage
7
9 $ ulimit -n N_file_descriptors
10 $ LD_PRELOAD_32=/usr/lib/extendedFILE.so.1 application [arg...]
11
12
14 The extendedFILE.so.1 is not a library but an enabler of the extended
15 FILE facility.
16
17
18 The extended FILE facility allows 32-bit processes to use any valid
19 file descriptor with the standard I/O (see stdio(3C)) C library func‐
20 tions. Historically, 32-bit applications have been limited to using the
21 first 256 numerical file descriptors for use with standard I/O streams.
22 By using the extended FILE facility this limitation is lifted. Any
23 valid file descriptor can be used with standard I/O. See the NOTES sec‐
24 tion of enable_extended_FILE_stdio(3C).
25
26
27 The extended FILE facility is enabled from the shell level before an
28 application is launched. The file descriptor limit must also be raised.
29 The syntax for raising the file descriptor limit is
30
31 $ ulimit -n max_file_descriptors
32 $ LD_PRELOAD_32=/usr/lib/extendedFILE.so.1 application [arg...]
33
34
35
36 where max_file_descriptors is the maximum number of file descriptors
37 desired. See limit(1). The maximum value is the same as the maximum
38 value for open(2).
39
41 The following environment variables control the behavior of the
42 extended FILE facility.
43
44 _STDIO_BADFD This variable takes an integer representing the
45 lowest file descriptor, which will be made unal‐
46 locatable. This action provides a protection
47 mechanism so that applications that abuse inter‐
48 faces do not experience silent data corruption.
49 The value must be between 3 and 255 inclusive.
50
51
52 _STDIO_BADFD_SIGNAL This variable takes an integer or string repre‐
53 senting any valid signal. See signal.h(3HEAD)
54 for valid values or strings. This environment
55 variable causes the specified signal to be sent
56 to the application if certain exceptional cases
57 are detected during the use of this facility.
58 The default signal is SIGABRT.
59
60
62 Example 1 Limit the number of file descriptors and FILE standard I/O
63 structures.
64
65
66 The following example limits the number of file descriptors and FILE
67 standard I/O structures to 1000.
68
69
70 $ ulimit -n 1000
71 $ LD_PRELOAD_32=/usr/lib/extendedFILE.so.1 application [arg...]
72
73
74 Example 2 Enable the extended FILE facility.
75
76
77 The following example enables the extended FILE facility. See
78 enable_extended_FILE_stdio(3C) for more examples.
79
80
81 $ ulimit -n 1000
82 $ _STDIO_BADFD=100 _STDIO_BADFD_SIGNAL=SIGABRT \
83 LD_PRELOAD_32=/usr/lib/extendedFILE.so.1 \
84 application [arg ...]
85
86
87 Example 3 Set up the extended FILE environment and start the applica‐
88 tion.
89
90
91 The following shell script first sets up the proper extended FILE envi‐
92 ronment and then starts the application:
93
94
95 #!/bin/sh
96 if [ $# = 0 ]; then
97 echo "usage: $0 application [arguments...]"
98 exit 1
99 fi
100 ulimit -n 1000
101 # _STDIO_BADFD=196; export _STDIO_BADFD
102 # _STDIO_BADFD_SIGNAL=SIGABRT; export _STDIO_BADFD_SIGNAL
103 LD_PRELOAD_32=/usr/lib/extendedFILE.so.1; export LD_PRELOAD_32
104 "$@"
105
106
108 /usr/lib/extendedFILE.so.1 enabling library
109
110
112 See attributes(5) for descriptions of the following attributes:
113
114
115
116
117 ┌─────────────────────────────┬─────────────────────────────┐
118 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
119 ├─────────────────────────────┼─────────────────────────────┤
120 │Availability │SUNWcsl (32-bit) │
121 ├─────────────────────────────┼─────────────────────────────┤
122 │Interface Stability │Stable │
123 ├─────────────────────────────┼─────────────────────────────┤
124 │MT-Level │Safe │
125 └─────────────────────────────┴─────────────────────────────┘
126
128 limit(1), open(2), enable_extended_FILE_stdio(3C), fdopen(3C),
129 fopen(3C), popen(3C), signal.h(3HEAD), stdio(3C), attributes(5)
130
132 The following displayed message
133
134 Application violated extended FILE safety mechanism.
135 Please read the man page for extendedFILE.
136 Aborting
137
138
139
140
141 is an indication that your application is modifying the internal file
142 descriptor field of the FILE structure from standard I/O. Continued use
143 of this extended FILE facility could harm your data. Do not use the
144 extended FILE facility with your application.
145
146
147
148SunOS 5.11 18 Apr 2006 extendedFILE(5)