1 <!-- Copyright (C) 2003 Red Hat, Inc. -->
2 <!-- This material may be distributed only subject to the terms -->
3 <!-- and conditions set forth in the Open Publication License, v1.0 -->
4 <!-- or later (the latest version is presently available at -->
5 <!-- http://www.opencontent.org/openpub/). -->
6 <!-- Distribution of the work or derivative of the work in any -->
7 <!-- standard (paper) book form is prohibited unless prior -->
8 <!-- permission is obtained from the copyright holder. -->
12 >C and math library overview</TITLE
13 ><meta name="MSSmartTagsPreventParsing" content="TRUE">
16 CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
19 TITLE="eCos Reference Manual"
20 HREF="ecos-ref.html"><LINK
22 TITLE="The ISO Standard C and Math Libraries"
23 HREF="libc.html"><LINK
25 TITLE="The ISO Standard C and Math Libraries"
26 HREF="libc.html"><LINK
28 TITLE="Math library compatibility modes"
29 HREF="math-library-compatibility-modes.html"></HEAD
40 SUMMARY="Header navigation table"
49 >eCos Reference Manual</TH
71 HREF="math-library-compatibility-modes.html"
84 NAME="C-AND-MATH-LIBRARY-OVERVIEW">Chapter 13. C and math library overview</H1
94 HREF="c-and-math-library-overview.html#INCLUDE-NON-ISO-FUNCTIONS"
95 >Included non-ISO functions</A
99 HREF="math-library-compatibility-modes.html"
100 >Math library compatibility modes</A
104 HREF="libc-implementation-details.html"
105 >Some implementation details</A
109 HREF="libc-thread-safety.html"
114 HREF="c-library-startup.html"
115 >C library startup</A
120 NAME="ISO-C-AND-MATH-LIBRARIES"
129 > provides compatibility with the
130 ISO 9899:1990 specification for the standard C library, which
131 is essentially the same as the better-known ANSI C3.159-1989
132 specification (C-89).</P
134 >There are three aspects of this compatibility supplied by <SPAN
145 implements the functions defined by the ISO standard, except for the
146 mathematical functions. This is provided by the eCos C library
156 library, which implements the mathematical functions from the ISO
157 C library. This distinction between C and math libraries is frequently
158 drawn — most standard C library implementations provide
159 separate linkable files for the two, and the math library contains
160 all the functions from the <TT
166 >There is a third element to the ISO C library, which is the
167 environment in which applications run when they use the standard
168 C library. This environment is set up by the C library startup procedure
170 HREF="c-library-startup.html"
171 >the Section called <I
172 >C library startup</I
175 and it provides (among other things) a <TT
179 point function, an <TT
183 does the cleanup required by the standard (including handlers registered
187 > function), and an environment
188 that can be read with <TT
193 >The description in this manual focuses on the <SPAN
200 aspects of the C library (mostly related to <SPAN
207 configurability) as well as mentioning the omissions from the standard
208 in this release. We do not attempt to define the semantics of each
209 function, since that information can be found in the ISO, ANSI,
210 POSIX and IEEE standards, and the many good books that have been
211 written about the standard C library, that cover usage of these
212 functions in a more general and useful way.</P
218 NAME="INCLUDE-NON-ISO-FUNCTIONS">Included non-ISO functions</H1
220 >The following functions from the POSIX specification
221 are included for convenience: </P
233 (for setting up the environment for use with <TT
279 > provides the following additional
280 implementation-specific functions within the standard C library
281 to adjust the date and time settings:</P
289 CLASS="PROGRAMLISTING"
292 >cyg_libc_time_setdst</TT
294 cyg_libc_time_dst state
300 >This function sets the state of Daylight Savings Time. The
301 values for state are:</P
309 CLASS="PROGRAMLISTING"
310 >CYG_LIBC_TIME_DSTNA unknown
311 CYG_LIBC_TIME_DSTOFF off
312 CYG_LIBC_TIME_DSTON on</PRE
323 CLASS="PROGRAMLISTING"
326 >cyg_libc_time_setzoneoffsets</TT
328 time_t stdoffset, time_t dstoffset
334 >This function sets the offsets from UTC used when Daylight
335 Savings Time is enabled or disabled. The offsets are in time_t’s,
336 which are seconds in the current inplementation.</P
344 CLASS="PROGRAMLISTING"
347 >Cyg_libc_time_dst cyg_libc_time_getzoneoffsets</TT
349 time_t *stdoffset, time_t *dstoffset
355 >This function retrieves the current setting for Daylight Savings
356 Time along with the offsets used for both STD and DST. The offsets
357 are both in time_t’s, which are seconds in the
358 current implementation.</P
366 CLASS="PROGRAMLISTING"
369 >cyg_bool cyg_libc_time_settime</TT
377 >This function sets the current time for the system The time
378 is specified as a <SPAN
382 It returns non-zero on error.</P
390 SUMMARY="Footer navigation table"
419 HREF="math-library-compatibility-modes.html"
429 >The ISO Standard C and Math Libraries</TD
443 >Math library compatibility modes</TD