@node Changes in 2.03, , Changes in 2.02, What Changed
@section Changes in 2.03

Here is a list of changes from DJGPP V2.02 to V2.03

Bugs in the @code{itimer} functions are fixed.  In particular:

@itemize @minus{}
@item
@cindex profiling
profiling (which was broken in v2.02) now works;

@item
@cindex interval timers, small intervals
the timers are now more accurate for small (100@dmn{ms} or less)
intervals;

@item
@findex setitimer
large values of the @code{tv_usec} member in @code{itimerval} structure
don't cause internal calculations in @code{setitimer} to overflow;

@item
@findex getitimer
@code{getitimer} now returns correct info in the @code{tv_usec} member;

@item
@findex uclock
@findex alarm
@cindex interval timers and uclock
the timers and the @code{alarm} function work correctly when the calling
program invokes the @code{uclock} library function before setting a
timer.
@end itemize

@findex mktime
@findex localtime
@findex ctime
@vindex TZ
@code{localtime}, @code{ctime} and @code{mktime} now notice changes in
the value of the @code{TZ} environment variable during the program run,
and adjust their computation accordingly.  They also don't fail for the
first date after the epoch.  @code{mktime} now avoids looping for
preposterously long time when passed very large values in the members of
@code{struct tm}.

@findex stat
When passed an empty string as the file name, @code{stat} now fails and
sets @code{errno} to @code{ENOENT}, instead of returning information
about the current directory.  Also, @code{stat} no longer reports
invalid time stamps for root directories of floppy disks that were
written on Windows 9X or Windows NT.

@cindex PC98, SIGINT and SIGQUIT
@cindex SIGINT and SIGQUIT, PC98
The startup code now correctly sets up the keys that generate
@code{SIGINT} and @code{SIGQUIT} signals on PC98 machines.

@findex putc
@findex fputc
@code{putc} and @code{fputc} no longer return -1 when they write the
value @code{(signed char)0xff} to a file.

@cindex wctype.h, pre-processor and compilation errors
The header @file{wctype.h} from v2.02 caused pre-processor errors, and
could not be included @emph{before} @file{ctype.h}.  This is now fixed.


@findex doprnt
@findex printf
@findex sprintf
@findex fprintf
@findex vprintf
@findex vfprintf
@findex vsprintf
@cindex unnormal numbers, printing
Functions of the @code{printf} family no longer cause the calling
program to crash when passed @code{long double} variables with invalid
bit patterns (the so-called @dfn{unnormal} numbers).  Such arguments are
now printed as @samp{Unnormal}.

@code{srand} now documented as returning a void.
@findex srand

@code{rand48} and friends are now in libc.
@findex rand48
@findex srand48

Many fixes to calls to @code{tolower}/@code{toupper} with signed chars.
@findex tolower
@findex toupper

The rmcb stub doesn't restore the flags so that you can return
different ones.
@findex _go32_dpmi_allocate_real_mode_callback_iret

Doc fixes for ansi/posix portability.

Handle error conditions in @file{bin2h}.
@pindex bin2h

@file{tests/libclink/check.cc} - remove duplicates.

Remove unneeded includes from @file{rand.c}.

Call @code{system} properly in termios (Ctrl-Z).
@findex system@r{, and Ctrl-Z in termios}
@pindex termios

Work around a gcc 2.8.1 bug in emu387.
@findex acos

Linking with -lemu should obviate the need for emu387.dxe.
@pindex emu387.dxe

The ``Hidden Features'' chapter of the Knowledge Base now actually
describes most of the special features provided by DJGPP.
@cindex hidden features, documentation

@code{redir} no longer fails to run programs when the program name
is a substring of the redirected I/O file(s).
@pindex redir

@findex glob@r{, and mixed-case letters in file names}
@cindex command-line arguments, globbing
@code{glob} correctly converts the letter-case of the file names when
the pattern include mixed upper- and lower-case letters.  In particular,
the letter-case of the command-line arguments expanded by the startup
code in the @code{argv[]} array is now correct in these cases.

@code{textcolor} and @code{textbackground} now support the 16 background
colors mode (e.g., after a call to @code{intensevideo}).  Previously,
@code{textbackground} would ignore the high intensity color bit in its
argument, and @code{textcolor} would clobber thatt bit sometimes.
@findex textcolor
@findex textbackground

A call to @code{lowvideo} doesn't clobber the background color anymore.
@findex lowvideo

The global variable @code{ScreenAttrib} now always matches the value of
the @code{attribute} member of the @code{text_info} struct returned by
@code{gettexinfo}.
@findex gettexinfo
@vindex ScreenAttrib

@cindex response file, ^Z at the end
@cindex ^Z character, at end of a response file
If the last character of a response file is @samp{^Z}, it is now
ignored.  Previous versions would pass it to the @code{main} function.
Use two @samp{^Z} characters in a row if you actually need to pass such
a character as part of the last element of the @code{argv[]} array.

@findex fputs
@code{fputs} now returns @code{EOF} when called on an unbuffered stream,
and there's some error (such as @code{ENOSPC}) in writing to that
stream.

@findex _rename
@findex rename
If both arguments of @code{_rename} and @code{rename} refer to the same
file, they no longer remove that file.

@findex scanf
@findex sscanf
@findex fscanf
@findex vscanf
@findex vsscanf
@findex vfscanf
Functions of the @code{scanf} family no longer crash or work incorrectly
when passed format specifiers with upper-case letters, such as
@samp{%lX} or @samp{%E}.  Non-@sc{ansi} extensions to the format
specifiers and qualifiers, such as @samp{%lld} and @samp{%U}, are now
documented and their portability information included in the library
docs.

@findex __crt0_load_environment_file
The function @code{__crt0_load_environment_file} called by the startup
code now strips trailing blanks and TABs from the @samp{[program]} lines
of the @file{DJGPP.ENV} file which define sections for individual
programs.  This is so editing @file{DJGPP.ENV} with some losing editors
that don't strip trailing whitespace when saving the file doesn't
prevent the startup code from recognizing section names.

@pindex dtou
@pindex utod
@code{dtou} and @code{utod} no longer overwrite the stack when invoked
on file names longer than 80 characters.

@findex system@r{, and redirection}
@code{system} works when its argument uses redirection to/from quoted
file names (e.g., when the file name includes embedded whitespace).

@findex getc
@findex putc
@findex fread
@findex fwrite
@findex _filbuf
@findex _flsbuf
@cindex termios, and buffered stdio
Buffered stdio functions, such as @code{getc}, @code{putc},
@code{fread}, @code{printf}, and all their relatives pay attention to
@code{termios} settings of the terminal device and behave accordingly.
For example, you can get single-character, no-echo input with the
following snippet:

@example
 struct termios charmode;

 tcgetattr (0, &charmode);
 charmode.c_lflag &= ~(ECHO | ICANON | ISIG);
 tcsetattr (0, &charmode);
@end example

@findex tcsetattr
If you reset the @code{ISIG} or @code{BRKINT} flags in the
@code{termios} structure, or set the @code{IGNBRK} flag,
@code{tcsetattr} now disables @code{SIGINT} generation by a
@kbd{Ctrl-@key{C}} or @kbd{Ctrl-@key{BREAK}} keypress, and generation of
@code{SIGQUIT} by pressing @kbd{Ctrl-@key{\}}.

@findex tcflush
A call like @samp{tcflush (0, TCIFLUSH);} now empties the BIOS keyboard
buffer in addition to the internal buffer maintained by the
@code{termios} input processing.  This is compatible with the Unix
specification that @code{tcflush} should ``discard all data received but
not read''.

@findex system@r{, and pipe symbols}
@pindex Make, crashes
@pindex Bash
Library function @code{system} no longer crashes when given invalid
command lines which involve pipe symbols @samp{|}.  Typically, such
command lines should have been run by a Unix-style shell, like Bash.
However, sometimes, due to some system configuration snafu, the
@code{SHELL} variable in the environment didn't point to such a shell,
and @code{system} would try to execute the command line using its
internal emulator of @file{COMMAND.COM}; it would then crash due to a
bug.  This is now solved: @code{system} prints appropriate error
message(s) and exits with an error code of -1.  We believe that some of
the rarely-reported and hard-to-reproduce crashes of the Make utility
were due to this bug.

@findex open@r{, when there are no more file handles}
Previously, when attempt was made to open a file, and all the available
file handles were exhausted, @code{open} would sometimes truncate an
existing file on Windows 9X.  This is now fixed.

@cindex SIGFPE@r{, on Windows 9X}
@cindex Crashes due to SIGFPE, on Windows 9X
All DJGPP programs now clear the FPU exceptions when they exit.  This
prevents the next DJGPP program that is run in the same DOS box on
Windows 9X from crashing during startup code.

@vindex _8087
@vindex 387@r{, and the value of} _8087
When the @code{387} environment variable overrides the FPU auto-detect
code, the value of the global variable @code{_8087} is now set by the
startup code according to the environment override: 3 if @code{387} is
set to @samp{y}, 0 otherwise.

@findex _put_path
@findex _put_path2
@cindex environment variables, in file names
You can use the special @file{/dev/env/foo/} construct in file names
to expand it into the value of the environment variable @code{foo}
at run time.  @file{/dev/env/foo~bar~} will expand to @file{bar} if
@code{foo} is undefined, or if its value is empty.

@findex getch
@findex getche
@cindex flushing buffered output
Calling @code{getch} and @code{getche} flushes the @code{stdout} and
@code{stderr} streams, if they are connected to the console and have any
pending buffered characters.

@pindex @r{Emacs, warnings from} GDB
@pindex GDB@r{, debugging Emacs}
@cindex @code{FILE} objects, allocation
A bug in the library caused programs like Emacs, which dump their data
and then restart, to use stale @code{FILE} objects created before they
were dumped.  This caused warning messages to be issued by GDB near the
end of debugging session.  This bug is now fixed.

@findex uclock@r{, on Windows}
Due to a peculiarity of the timer device virtualization, the values
returned by @code{uclock} on Windows during the first 54.9@dmn{msec}
after the first call (which reprograms the timer chip) were erratic,
some of them negative, some positive.  To work around this, the first
call to @code{uclock} on Windows now waits until the next timer tick
before returning, to ensure that all the values returned hence are
monotonously increasing.

@cindex termios, and binary I/O
The termios emulation now uses raw input/output only if the file handle
referring to a device is put into binary mode, and the device itself is
in raw mode.

@cindex termios, input and @code{SIGINT} and @code{SIGQUIT}
The termios input routines no longer generate the @code{SIGINT} and
@code{SIGQUIT} signals twice when @kbd{Ctrl-@key{C}} or
@kbd{Ctrl-@key{\}} are pressed.

@findex __djgpp_set_ctrl_c@r{, non-destructive query}
A call to @code{__djgpp_set_ctrl_c} with a negative argument returns the
current state of @code{SIGINT} and @code{SIGQUIT} generation without
altering it.

@cindex termios, and TAB expansion
The @code{termios} cooked-mode output now expands TABs into the
appropriate number of spaces when writing to the console device.

@findex setmode@r{, and termios}
The @code{setmode} function now switches character devices to raw/cooked
mode even when @code{termios} functions are used.

@findex freopen@r{, read/write access to files}
@code{freopen} now correctly sets the read/write access flags when
@samp{+} is the last (third) character of the @var{mode} string, like in
@samp{wt+} or @samp{ab+}.

@findex searchpath@r{, and file names with slashes}
Previously, @code{searchpath} would always return its argument unchanged
and signal a success, when the argument included slashes or a drive
letter, even if the file didn't actually exist.  This is now fixed:
non-existent files always cause @code{searchpath} to return a
@code{NULL} pointer.

@cindex debug support, and signals
The DJGPP debug support functions in @file{libdbg.a} now have the
capability to debug programs that catch signals such as @code{SIGINT}.
The signal interrupts the debuggee and is reported by the debugger,
instead of aborting the debuggee.  You can also deliver signals to
the debuggee, even if they didn't actually happen.  Most of the work
that made this possible was done by @email{muller@@cerbere.u-strasbg.fr,
Pierre Muller} and @email{pavenis@@lanet.lv, Andris Pavenis}.

@cindex debuggers, and @code{SIGQUIT}
The debugging support functions in @file{libdbg.a} now correctly handle
the @code{SIGQUIT} signal that happens while the debuggee runs.
Previously, a debugger would crash or report @code{SIGINT} in such cases.

@cindex debug support, and floating-point code
The DJGPP functions in @file{libdbg.a} support FP code much better now,
especially when FP exceptions happen in the debugged program.  The full
state of the numeric processor is saved and restored when the execution
thread jumps from the debugger to the debuggee and back.

@cindex debug support, and file redirection
It is now possible to debug programs that redirect their standard
handles, without the debugger losing those handles at the same time.
Debuggers which want to use this feature need to call the new
@code{redir_*} functions before and after jumping to the debuggee's
code.  @xref{redir_debug_init, , Redirection in the debugger, libc,
libc.a reference}.

@cindex debug support, documentation
The documentation for the debug support functions in @file{libdbg.a} is
now part of the library reference.

@cindex debuggers, and the stack length
@cindex debuggers, and the transfer buffer size
When a raw COFF image (i.e., without a stub) is debugged, its stack
length and the size of transfer buffer are now taken from the values
used by the debugger.  This means that you can have predictable results
by stubediting the debugger's executable.

@findex __dpmi_simulate_real_mode_procedure_retf_stack
@code{__dpmi_simulate_real_mode_procedure_retf_stack} no longer fills
part of the real-mode stack with garbage.  The parameters specification
was changed so that the second argument is now the number of 16-bit
words to copy to the real-mode stack, like the DPMI spec requires.

@pindex emu387.dxe@r{, comparison, addition and subtraction}
@pindex libemu.a@r{, comparison, addition and subtraction}
@cindex FP emulator, comparison, addition and subtraction
The floating-point emulator software had a bug in emulation of
subtraction, addition, and comparison instructions, whereby the results
produced for some rare pairs of numbers with the same exponent but
different mantissa were grossly incorrect.  This is now fixed.
This bug was known to cause all kinds of weird failures, like incorrect
values produced by functions @code{sin} and @code{cos}, programs being
trapped inside infinite loops when they called @code{acos}, etc.

@pindex libemu.a@r{, missing} npxsetup.o
The FP emulation library @file{libemu.a} omitted the specially-compiled
FPU setup module @file{npxsetup.o} which arranges for floating-point
instructions to call functions from @file{libemu.a}.  This caused
programs linked with @samp{-lemu} to require the dynamically-loaded
emulator, @file{emu387.dxe}, even though the emulation code was linked
into the program.  This bug is now fixed.

@findex rename@r{,} errno@r{ value when the file is open}
@code{rename} now sets @code{errno} to @code{EACCES} when an attempt is
made to rename an open file.  Previously, @code{errno} was set to
@code{ENOENT} in these cases.

@cindex 8-bit characters, and string-related functions
Library functions that process strings and file names, such as
@code{strupr}, @code{stricmp}, @code{strtol}, @code{fnmatch}, and the
functions from @code{printf} and @code{scanf} families, handle 8-bit
characters correctly when they call @code{ctype}
character-classification functions internally.

@cindex math functions, improved versions
@vindex errno@r{, set by math functions in @file{libc.a}}
New versions of mathematical functions, written by
@email{rudd@@cyberoptics.com, Eric Rudd}, are now included in the
standard C library, @file{libc.a}.  The new versions are
@sc{ansi}-compatible (they set @code{errno} in case of FP errors), yet
very fast and accurate.  Programs that require accurate floating-point
computations can now be linked without @samp{-lm}, unless they need the
@code{matherr} call-back or compliance to standards like X/Open or SVID.

@findex powi
@findex cbrt
@findex expm1
@findex exp2
@findex exp10
@findex sincos
New math functions are provided: @code{powi}, @code{cbrt}, @code{expm1},
@code{exp2}, @code{exp10}, and @code{sincos}.

@findex printf@r{, and negative zero}
@findex fprintf@r{, and negative zero}
@findex sprintf@r{, and negative zero}
@cindex negative zero, printing
If the format specifier for a floating-point number includes the
@samp{+} flag (meaning that the sign should be printed even if the
number is positive), the functions of the @code{printf} family will now
print the negative zero, @code{-0.0}, with an explicit negative sign.

@findex access@r{, loss of} FileFind @r{handle}
@code{access} no longer loses a @code{FileFind} handle on LFN platforms
when called on a root directory or a character device.

@findex _check_v2_prog@r{, leaks file descriptor}
@code{_check_v2_prog} no longer leaks file descriptors when called on a
corrupt executable by name.

@findex setitimer@r{, when called with} NULL@r{ argument}
@code{setitimer} no longer crashes when its second argument is a
@code{NULL} pointer, it simply returns after setting the third argument
to the value of the last timer set with a previous call to
@code{setitimer}.

@findex setitimer@r{, and system clock granularity}
@findex getitimer@r{, and system clock granularity}
@vindex __djgpp_clock_tick_interval@r{, introduced}
@cindex timer tick frequency, and @code{setitimer} function
@code{setitimer} now rounds up timer values smaller than the system
clock granularity to that granularity, before it uses the values.
Therefore, @code{setitimer} and @code{getitimer} will return rounded up
values for such small timers.  The global variable
@code{__djgpp_clock_tick_interval} is provided for changing the
granularity used by @code{setitimer}, in case an application reprograms
the timer chip to run with a non-standard frequency.

@findex ftruncate@r{, and file pointer position}
@code{ftruncate} now leaves the file pointer at the same byte position
as it were before the function was called.

@findex scanf@r{, and octal conversions}
@findex sscanf@r{, and octal conversions}
@findex fscanf@r{, and octal conversions}
@findex vscanf@r{, and octal conversions}
@findex vsscanf@r{, and octal conversions}
@findex vfscanf@r{, and octal conversions}
Functions of the @code{scanf} family now correctly stop the scan when
they encounter a digit larger than 7, and either the format specifies
octal conversion, like in @code{%o}, or the format is @code{%i} and the
leading digit is @code{0}, which implies octal conversion.

@findex scanf@r{, pointer conversions}
@findex sscanf@r{, pointer conversions}
@findex fscanf@r{, pointer conversions}
@findex vscanf@r{, pointer conversions}
@findex vsscanf@r{, pointer conversions}
@findex vfscanf@r{, pointer conversions}
Functions of the @code{scanf} family now use 16 as the base for
converting pointer values read with the @code{%p} format.  Thus, reading
back a pointer written with the @code{%p} format now yields the original
value.

@findex kill@r{, signals to other programs}
@code{kill} now sets @code{errno} to @code{ENOSYS} when called with a
@var{pid} argument that isn't the caller's PID, since DOS doesn't allow
sending signals to other processes.

@cindex template instantiation, improved support
@pindex crt0.S@r{, and long section names}
@pindex djgpp.djl@r{, and long section names}
The startup code and the linker script file @file{djgpp.djl} include
support for long section names.  Long section names are required by the
latest versions of GNU Binutils to support automatic template
instantiation in C++ programs.

@findex tcgetpgrp@r{, added}
@findex tcsetpgrp@r{, added}
The @code{tcgetpgrp} and @code{tcsetpgrp} are now provided in the
library.

@findex realloc@r{, crashes when memory is exhausted}
@code{realloc} no longer crashes when the avialable virtual memory is
not enough to satisfy the reallocation request.

@findex symlink@r{, source and target in different directories}
Previously, the @code{symlink} function would sometimes think that the
source and the target of the link were in the same directory, when in
fact they weren't.  This bug is now fixed.

@pindex djtar@r{, and the }@file{tarchange.lst}@r{ file}
@code{djtar} now creates the file @file{tarchange.lst} only if it
actually needs to rename some of the files during unpacking.  In
particular, simply listing the contents of an archive, as in @samp{djtar
foo.tgz}, will not produce an empty @file{tarchange.lst} file anymore.

@findex memicmp@r{, included in the library}
The function @code{memicmp} was omitted from the library in version
2.02.  This is fixed now.

@pindex fsdb@r{, Step Over bug}
@pindex fsdb@r{, support for }SIGQUIT
Previously, @code{fsdb} could not step over function calls when 4 or
more breakpoints were set: it would display an error message saying that
@samp{Exception 3 occurred}.  This is now fixed.  In addition,
@code{fsdb} now supports the @code{SIGQUIT} signal, if the program being
debugged generates it.

@pindex emu387.dxe@r{, on Windows}
@pindex libemu.a@r{, on Windows}
@cindex FP emulation, on Windows
The floating-point emulation now works on Windows.  Previously, a bug in
the emulation of the WAIT/FWAIT instructions caused the emulator to get
stuck in an endless loop on Windows.  (On MS-DOS, these two instructions
don't generate an FP exception, and so don't get into the emulator.)

@pindex redir@r{, and FP emulation}
@code{redir} no longer crashes when floating-point instructions are
emulated.

@cindex FP emulation, and @code{SIGFPE}
@cindex @code{SIGFPE} and FP emulation
The emulator setup in the startup code now correctly masks all FP
exceptions in the emulated control word, like the hardware FPU setup
does.  If some numeric exception is unmasked by an application and is
triggered by some abnormal condition in the emulator (e.g., if an
application attempts to compute a square root of a negative number), the
emulation simulates exception 16, the Coprocessor Error exception.
(Previously, the exception number in the DJGPP exception structure was
not set by the emulation, and was left at its old value set by the
Coprocessor Not Present exception generated by the emulated
instruction.  This caused incorrect message to be printed when the
program crashed, and defeated user-defined handlers for @code{SIGFPE}.)


@cindex FP emulation, and @code{Cn} condition codes
@cindex Condition codes and FP emulation
The emulator now correctly sets the condition code bits @code{C0},
@code{C1}, @code{C2}, and @code{C3} when an exceptional condition is
raised, and as result of emulating the @code{FPREM} and @code{FPREM1}
instructions.

@pindex emu387.dxe@r{, and FSQRT instruction}
@pindex libemu.a@r{, and FSQRT instruction}
@cindex FP emulator, and FSQRT instruction
The floating-point emulator software had a bug in emulation of the
@code{FSQRT} instruction, which could cause the calling program to hang.
This was due to incorrect optimization by the version of GCC used to
produce @file{djdev202.zip}.  The new version of the emulator works
around this bug by preventinging the compiler from performing these
incorrect optimizations.

@findex fsetpos@r{, return value}
@code{fsetpos} no longer returns zero when it fails to move the file
position pointer.

@pindex djtar@r{, file-name conversions}
@code{djtar} now converts @file{.info-} into @file{.i} only if the
character following @file{.info-} is a digit.  @file{.tar.gz} is
converted to @file{.tgz} only at the end of a file name.  @file{++} is
converted to @file{xx} (instead of @file{plus} in previous versions),
and this conversion is performed for all occurrences of @file{++} in a
file name (previous versions only converted the first occurrence).

@pindex gxx@r{, and missing libgpp.a}
@cindex @file{libstdcxx.a}, and @code{gxx}
The @code{gxx} compiler driver no longer reports an error if the
optional GNU C@t{++} class library @file{libgpp.a} is not installed.  If
@file{libgpp.a} cannot be found where @code{gcc} would look for it,
@code{gxx} does not pass the @samp{-lgpp} option to the linker.  Also,
if the standard C@t{++} library, @file{libstdcxx.a}, cannot be found,
@code{gxx} now tries @file{libstdcx.a} and @file{libstd~1.a}, in case
the user has some LFN-related installation @emph{snafu}.

@cindex FP emulation, abnormal results
The FP emulation behaves closer to a real FPU when an FP instruction
produces abnormal results, such as @code{Inf} or @code{NaN}.  In
particular:

@itemize @bullet
@item
@cindex Overflow in emulation of arithmetic FP instructions
@cindex Underflow in emulation of arithmetic FP instructions
Overflow and underflow are now correctly detected in addition,
subtraction, multiplication and division, and instructions that perform
these operations internally.  Overflow causes an @code{Inf} to be stored
in the results, while underflow usually results in a denormal or a zero.

@item
Undefined operations, such as division of zero by zero or of @code{Inf}
by an @code{Inf}, produce a @code{NaN}.

@item
@cindex FST/FSTP instructions, emulation of, over/underflow
Emulation of @code{FST} and @code{FSTP} instructions avoids overflowing
of the exponent when it is too large for the destination format; it
stores an @code{Inf} or a maximum finite number instead.  Operands that
are too small for the destination format cause either a denormal or a
zero to be stored.

@item
@cindex FXCH instruction, emulation, abnormal operands
The emulation of @code{FXCH} stores a @code{NaN} when one or both of its
operands is a @code{NaN}.

@item
@cindex FYL2X instruction, emulation pops the stack
@findex acosh@r{, }Inf@r{ or}NaN@r{ operands in emulator}
@findex asinh@r{, }Inf@r{ or}NaN@r{ operands in emulator}
The emulation of @code{FYL2X} always pops the operands from the FPU
stack, even if one of the operands is invalid (@code{Inf} or
@code{NaN}), or if the operand on top of the stack is negative.  This
affects functions @code{acosh} and @code{asinh}.

@item
@cindex FPREM/FPREM1 instruction, emulation for large arguments
@findex ceil@r{, for negative arguments, emulation}
The emulation of the @code{FPREM} and @code{FPREM1} instructions no
longer hangs the program when the difference of the exponents of the
operands is larger than 64.  Instead, it correctly implements the
``partial remainder'' algorithm defined by the Intel manuals.  Also, the
sign of the result of these instructions is now in accordance with the
Intel manuals (this affects the @code{ceil} function for small negative
arguments).

@item
@cindex FPTAN instruction, emulation, argument out of range
@findex tan@r{, emulation, argument out of range}
The emulation of @code{FPTAN} now correctly handles the case where its
operand is out of range.

@item
@cindex FPATAN instruction, emulation, accuracy
@findex atan@r{, accuracy of emulation}
@findex atan2@r{, accuracy of emulation}
@findex asin@r{, accuracy of emulation}
@findex acos@r{, accuracy of emulation}
@code{FPATAN} emulation now uses a better approximation which is
accurate to 63 bits, even when its argument is near 1.  (Previously, it
would suffer a catastrophic accuracy loss of up to 13 significant digits
for arguments near 1.)  This affects functions @code{atan},
@code{atan2}, @code{asin}, and @code{acos}.

@item
@cindex FSQRT instruction, emulation for infinite arguments
@findex sqrt@r{, emulation for infinite arguments}
The emulation of @code{FSQRT} behaves correctly for infinite arguments.

@item
@cindex FRNDINT instruction, emulation for negative arguments
@findex fmod@r{, emulation for negative arguments}
@code{FRNDINT} emulation returns a negative zero for negative
arguments.  This affects the @code{fmod} function for negative
arguments.

@item
@cindex FSCALE instruction, emulation, handles overflow
The emulation of @code{FSCALE} handles overflow correctly.

@item
@cindex FSINCOS instruction, emulation for large arguments
@cindex FSIN instruction, emulation for large arguments
@cindex FCOS instruction, emulation for large arguments
@findex sin@r{, emulation for large arguments}
@findex cos@r{, emulation for large arguments}
@findex sincos@r{, emulation for large arguments}
@findex tan@r{, emulation for large arguments}
The emulations of @code{FSINCOS}, @code{FSIN} and @code{FCOS} return a
@code{NaN} for an argument that is a @code{NaN}, and raise an Invalid
Operation exception for an @code{Inf} argument; this is what the Intel
manuals require.  This affects functions @code{sin}, @code{cos},
@code{sincos}, and @code{tan}.

@item
@cindex FST/FSTP instructions, emulation of, rounding
The emulation of instructions @code{FST} and @code{FSTP} that store
FP registers into @code{float} or @code{double} variables, now correctly
round the stored value according to the current rounding mode.
Previoulsy, the stored value was always chopped (truncated) at the last
stored bit of the mantissa.
@end itemize

@cindex @code{wchar_t} type, and Windows programs
The @code{wchar_t} data type is changed so that DJGPP now supports
16-bit wide characters.  This is required for @sc{rsxntdj} programs to
be compatible with Windows implementation of Unicode.

@findex _use_lfn@r{, and invalid drives}
@findex _USE_LFN@r{, and invalid drives}
@findex _get_volume_info@r{, and invalid drives}
@cindex LFN support and invalid drives
The long file-name (LFN) support is no longer disabled after
@code{_use_lfn} (or some other library functions that call it) were
called with a file name which refers to an invalid drive or a drive
whose media has been removed (e.g. an empty floppy drive).
@code{_get_volume_info} now returns @code{_FILESYS_UNKNOWN} for such
drives.

@pindex symify@r{, and long file/function names}
@code{symify} no longer crashes when the name of the function or source
file are too long to fit on a single screen line.  It also doesn't
overwrite the address on the next screen line.  Instead, @code{symify}
truncates the long names to fit on a single screen line.

@findex tmpfile@r{, when file handles are exhausted}
@code{tmpfile} no longer gets stuck in an endless loop when all the
available file handles are exhausted.
