DJGPP 2.04

[ Introduction ] [ News ] [ Timeline ] [ Features already in 2.04 ] [ Features that could go in 2.04 ] [ Features that won't go in 2.04 ] [ Incompatibilities between 2.03 and 2.04 ] [ Outstanding Issues ] [ Uninvestigated Issues ] [ Investigated Issues ] [ Resolved Issues ] [ Links ]


DJGPP 2.04 will be the next release of DJGPP. The current contents of DJGPP CVS will become DJGPP 2.04. On this page "DJGPP 2.04" refers to DJGPP CVS, unless otherwise stated.

If you are interested in helping out with the DJGPP 2.04 release, please join the djgpp-workers mailing list.

The current DJGPP beta 1 release is available from DJ Delorie's server: Please read readme.1st, before installing it.

Martin Stromberg has automatically-built snapshots of DJGPP CVS, which can be downloaded from here: .


2004-01-11Document a possible problem with statfs on FAT16 partitions on Windows '98 SE. needs updating. roundl clashes with a static function in doprnt.c. Issue with exclusively opening symlinks has been resolved.
2003-12-06DJGPP 2.04 beta 1 has been released! Please read readme.1st, before installing it.

I have resigned as DJGPP 2.04 release manager.

Document a bug in __internal_readlink. Note that: we need better locale tests; the remaining warnings in tests/cygnus need fixing; new timezone files & code are available; query whether dxe3gen work on big-endian machines; query whether fstat and lseek work correctly on stdout on Windows NT/2000; tests/libc/dos does not build with gcc 3.x.

2003-11-12Decided on a date for 2.04 beta 1. Update status of open and O_EXCL|O_CREAT on symlinks.
2003-10-18Add a link to MartinS's CVS snapshots. Despite the lack of updates, work has been proceeding slowly. I've been working on integrating nmalloc and KB Williams's C99 maths work.
2003-08-14Push back date of next alpha. DJGPP CVS builds with gcc 3.3.x. Document the bug in rename, when moving a directory into itself. Describe the issue with the inode number of "." changing.
2003-05-10uclock has been fixed to work on Windows 2000/XP.

DJGPP 2.04 alpha 1 has been released! Please read readme.1st, before installing it.

[ 2003-12-06: These have been removed from DJ's server, so I updated the links to point to my local copy. ]

2003-04-25Updated the dates for alpha 1. The issues are now sorted on priority. Updated DXE is now a feature of 2.04. The issues with Perl 5.6.1 have been solved. Updated notes on the problems with Emacs on NT, 2000 and XP. Thanks to Andrew Cottrell, Charles Sandmann & Martin Stromberg for their recent feedback.
2003-04-23Added: a note about the build problems with gcc 3.3; links to CB Falconer's new malloc package; a column for CVS tags in the timeline; a note about strtold needing some tests. Resolved: stack size issues; more documentation added for DJGPP utilities. The stat bug was a misdiagnosis of the fstat bug - mark it as resolved. Updated: bash issue; find & which issues; RHIDE issue; UPX issue is with binutils, not gcc; gdb & i786.
2003-04-21Added a note about __canonicalize_path and UNCs.
2003-04-12Added a link to the latest revision of the fstat patch.
2003-03-27Adjusted the timeline to be more realistic.
2003-03-25Added a note about the problem with open, symlinks and O_CREAT|O_EXCL.
2003-03-19Added a note about why the new DXE features are important. Added a note about users wanting smaller images.
2003-03-18Added a note about sub-optimal free behaviour.
2003-03-14remove, select, llseek and fchown now have tests.
2003-02-19Moved the POSIX information into a separate page.
2003-02-18Updated the comment about FreeDOS & LFNs. Most DJGPP utilities have documentation now.
2003-02-10Added a note about %n$ printf- and scanf-formats. Added more information about the problem with _creatnew and an associated problem in open. Update the section on problems with symlinks.
2003-02-05Added some zoneinfo-related issues.
2003-01-20Lower the _creatnew bug to priority 4.
2003-01-19strlcat and strlcpy are now in DJGPP CVS. Added a description of the current problems with resolution of symlinks.
2003-01-09The problem with df reporting the wrong disk sizes has been fixed. It was a bug in *statvfs. /dev/* is now handled correctly, if it refers to a real file or directory; the virtual files under /dev are handled as before. Updated the timeline.
2002-12-18Added a link to the C99 compliance page.
2002-12-16Added more issues: stat'ing directories on Windows 2000 and XP; Perl 5.6.1 problems; documentation for utilities; _creatnew bug; added links to some POSIX conformance test suites.
2002-12-14delay on Windows 2000 and XP has been fixed. All code now uses <libc/getdinfo.h>'s constants, rather than hard-coding values. More updates, after comments from Charles Sandmann & Martin Stromberg.
2002-12-11Added link for the Large File Summit. Expanded on the problem with df & moved it to the 2.04-specific section. Explained what needs doing for SIGFPE and SIGINT. Added notes about uclock and Emacs on Windows 2000. Updated the notes on iconv. Adjusted some priorities. Thanks to Andrew Cottrell, Charles Sandmann & Martin Stromberg for their information.
2002-12-10Moved the gdb & fileutils issues into the resolved section. Added updated DXE as a possible feature for 2.04. Large File Summit support probably won't make it into 2.04. Merged in Andrew Cottrell's to-do list. Added priorities. Merged in my to-do list.
2002-12-08Problems with gdb & binutils are not specific to DJGPP. Moved them to a new section.
2002-11-27Updated the timeline. The original alpha deadline was missed, so I bumped the alpha & beta deadlines back a month or so.
2002-10-14Added description of problem with Emacs under Windows NT 4. Added link to patch for possible solution to problems with rm from fileutils 4.1 built against DJGPP CVS. Added description of debugging problem with UPX-compressed gcc-3.2-built executables.
2002-10-13Updated the links to point to Andrew Cottrell's nice, new revised 2.04 testing pages.
2002-09-22Put this page on the web. Thanks to Andrew Cottrell, Charles Sandmann and Andris Pavenis for their suggestions.


DateEventCVS tagBy
28th April 2003

Release first alpha of DJGPP 2.04

Goal: Mostly C99 compliant, except for maths, wide-characters

-D "2003-04-24 12:00:00 GMT"

Richard Dawe (DJGPP packaging), Andrew Cottrell (re-building packages)

Goal: Ship with & test Charles's new DXE code; simple fix for fstat

6th December 2003 Release first beta of DJGPP 2.04 -D "2003-11-30 20:00:00 GMT" Richard Dawe (DJGPP packaging), Andrew Cottrell (re-building packages)
? 2004 Release second beta of DJGPP 2.04   ? (DJGPP packaging), Andrew Cottrell (re-building packages)
? 2004 Release DJGPP 2.04   ? (DJGPP packaging), Andrew Cottrell (re-building packages)

NB: We will probably do more than 4 pre-releases. Maybe an extra beta release will be added.

Features already in 2.04

Please see the list of what has changed in 2.04 for a detailed list. Also available are lists of changes between 2.03 & 2.04 alpha1 and 2.03 and 2.04 beta 1.

Here is a higher-level list:

Features that could go in 2.04

Features that won't go in 2.04

Incompatibilities between 2.03 and 2.04

Outstanding Issues

[ Please also see the 2.04 testing page maintained by Andrew Cottrell and Charles Sandmann. ]

Please also see the list of open bugs in the DJGPP bug tracker.

0Cataclysmic - totally broken - fix as soon as possible
1Showstopper - major bug - fix before release
2Serious - major bug - fix, if possible, before release
3Normal - fix, if possible, before release
4Low - feature requests and minor bugs

Issues specific to DJGPP 2.04

There are some problems with resolving symlinks:

  1. symlinks with relative paths that try to go higher than the root directory using "..";
  2. symlinks with paths like /dev/env/FOO, where the environment variable FOO expands to a relative path. Later: This has been fixed.

Problem 1 is not reproducible on Windows 2000, because it supports paths that try to go higher than the root directory using ".."s. DOS does not support this.


__canonicalize_path does not process Universal Naming Convention (UNC) paths like \\machine\share\file correctly.


Do fstat and lseek work correctly on stdout on Windows NT/2000? Is the LFN TSR required on Windows NT for correct operation?

1roundl clashes with a static function in doprnt.c. The function in doprnt.c should be renamed to doprnt_roundl. exponentl should be renamed, for consistency.
2bash 2.05b needed on Windows 2000 and XP.
2Compatibility with distributions built against 2.03 - symlinks, etc.

Update to the latest of the following packages, to resolve build or crash issues:

  1. find 4.1.7 beta from GNU sources. Changes sent to find maintainer by Andrew Cottrell.
  2. Which 2.13 from sources. Changes sent to Which maintainer by Andrew Cottrell.

2Test programs that catch SIGFPE and SIGINT. These both need testing, to check that they can be caught on Windows 2000 and XP. Charles Sandmann said: "SIGINT is probably something we can't do anything about - sometimes CTRL-C is caught someplace else and the image just exits (we don't see signal). Don't think it's fixable." Martin Stromberg reports: "Note that this happens often with bash even in W98. That might be of a different bug though."
2The knowledge base ( needs updating to reflect the new features in DJGPP 2.04.
3On Windows 2000 and XP, use RHIDE 1.5.0 or later. Do not use RHIDE 1.4.9.x. RHIDE ocassionaly crashes on Windows 2000 and XP.
3Stale packages: these may have bitrot and need updating to build with 2.04.
3gdb serial debugging does not work under Windows 2000. (XP too?)
3__internal_readlink doesn't work with file handle 0. It takes a filename or a file handle and it interprets a file handle of 0 to mean "use the filename".
3Does dxe3gen work on big-endian platforms? I.e.: when cross-compiling DJGPP?
3statfs seems to behave strangely on Windows '98 SE on a path such as c: to a FAT16 partition. Sequence: call with c: - fails; call with c:\ - succeeds; call with c: - returns results for c:\. Perhaps we need fix the path up with a trailing slash?
4The _os_trueversion variable has been committed to CVS. Potentially we should use a run-time check for behavior to handle bugs instead of punishing NT-type systems using the LFN TSR.
4Fix the remaining warnings in tests/cygnus. This may happen, when KB Williams's C99 maths patches are integrated.

Issues not specific to DJGPP 2.04, but could be fixed in it
1Linker script issues - C++ support, DWARF-2 debug info issues?
2Emacs crashes under Windows NT 4. This seems to occur on start-up with Ctrl held down for Emacs built with Unixy sbrk.

Emacs crashes under Windows 2000 (and XP?). Charles Sandmann has a patch to improve things. This needs testing. He says:

"The EMACS crash under Win2K is actually a problem with unixy sbrk and disabling hardware (keyboard) interrupts. (Same with NT). They are buggy and ignore the DPMI call to disable interrupts. At least Win2K seems to pay attention to CLI/STI as emulation as the patch. Yes, we need to test this before I commit it (worried it might break Win9x or Win31 systems - I think ARDI did this to call to fix problems with old Win9x which would sometimes forget to reenable interrupts?). IIRC, there wasn't a fix at all for NT systems (short of unhooking the keyboard interrupt during sbrk calls). Given the small number of unixy sbrk() users - and the platform issues - I'm not sure what to safely do here. By the way - this is an old bug - so I'm not sure if this should be in the specific to V2.04 or the "could be fixed in" section."

2free behaves sub-optimally: "someone needs to fix the current libc free() to early out if there are lots of items in the free list" - Charles Sandmann. CB Falconer's new malloc package may fix this problem.
2stat may not generate the same inode number for the directory ".", before and after changing into it. This affects rm from fileutils 4.1 and coreutils 5.0, which checks that the inode number hasn't changed.
2tests/libc/dos does not build with gcc 3.x.
3What should we do about iconv in packages - some form of dynamic linking? (This would probably be implemented in DJGPP 2.04, though.) Charles Sandmann reports: "We have the technology. We are just trying to decide how to best package it right now. I'm pretty sure the improved dynamic image support will be in 2.04, so improved iconv will also be available."
3The fstat function tries to get the SFT entry for a file, so it can get its cluster number. The cluster number is used as the inode field. If the SFT entry cannot be obtained, then an inode is invented. Every time fstat is called for a file without an SFT entry, a new inode is generated. Perhaps fstat should use the fixed-up filename to generate the inode. See the following messages from djgpp-workers: (1), (2), (3). Later: Andrew Cottrell produced a patch for this, which was extended by Richard Dawe. The fstat patch needs reviewing and testing.
3C99 Compliance - See the DJGPP 2.04 & C99 Compliance page.
3"make zoneinfo/src/makefile produce formatted man pages in %DJDIR%/share/man. This probably requires some intelligent detection of whether Groff is installed." - Eli Zaretskii
3"zoneinfo/src/makefile runs yearistype, a shell script as part of its thing, and thus requires Bash (and a few other utilities invoked by the script) to be installed. It would be nice to be able to build zoneinfo files without Bash and the additional programs, since the rest of the library build doesn't require any add-ons. The script is quite simple, so perhaps it's not too hard to eliminate the need for it." - Eli Zaretskii
3Smaller images
3Improve the locale tests.

It is possible to create a file using open as read-only, but then write to it using the returned file descriptor. _creatnew sets the file attributes correctly, but it always opens files for read-write, to work consistently across different DOS versions. Subsequent accesses to the file are restricted according to the file attributes. See the following messages: (1), (2), (3), (4), (5), (6), (7), (8), (9), (10), (11), (12), (13), (14).

One suggested solution is to use the fd_props mechanism to stop writes to files that have been opened with O_RDONLY (and similarly reads from files opened with O_WRONLY, I guess).

4strtold doesn't have any tests.

Issues not specific to DJGPP 2.04
3Some packages are lagging behind the latest releases, e.g.: the autotools, libtool. (In fact, there isn't an official release of libtool for DJGPP.)
3texi2ps does not support @multitable.
4Should we compress distributed binaries using UPX? The consensus seems to be yes. Later: It appears that binaries built with binutils 2.13 and then compressed cannot be uncompressed, which renders them useless for debugging purposes. So it seems UPX cannot be used for the moment.

Issues not specific to DJGPP:
3Document that DOS programs can get sound under Windows 2000 and XP using VDMSound.
4gdb and binutils do not support i786. There is an entry in the gdb bug database for this problem: gdb Problem Report 591. Later: This is priority 4, because the bug is not in DJGPP.

Uninvestigated Issues

Investigated Issues

These are issues that have been investigated, but no further action is planned.


Error 183 for creating directories if they already exist on Win 2000 (and XP?): /c if not exist glob\nul md glob

returns Extended Error 183 only if directory exists (seen in makefile for mak3791 build). Two bugs: it does not see nul in directories and the wrong error message is generated on creation. Using cmd.exe with same string does not generate an error. Both are reproducible without DJGPP. This is cosmetic Windows 2000 bug/issue - change the makefile or ignore?


The statfs function does not return the correct cluster size on large hard disks. This is because:

  1. DOS API supports 2GB hard drives only. There is no fix.
  2. The LFN (long filename) API under Windows XP does not support INT 21h function 7303h. (See Ralph Brown's Interrupt List.) There is no fix.

FreeDOS may support the LFN API some day. Then statfs may work correctly under FreeDOS, but not other versions of DOS.

Resolved Issues

1The delay function does not work correctly under Windows 2000 and XP. Later: A fix has been tested and committed.

open on symlinks does not honour O_CREAT|O_EXCL in the way required by POSIX:

"If O_EXCL and O_CREAT are set, and path names a symbolic link, open( ) shall fail and set errno to [EEXIST], regardless of the contents of the symbolic link."

A patch is available, but needs reviewing and maybe some more testing.

2Problems with file utilities when built with CVS LIBC cause rm.exe failures whichin turn cause GCC 3.2 build issues (not GCC related). A patch for fileutils 4.1 to address this issue is now available for testing: fil41-rm-djgpp-cvs-bugfix-20021014.diff. Later: A new release of the port is out - release 4 - which has this patch in. Andrew Cottrell has released updated binaries.

2gdb doesn't seem to work with DWARF-2 debugging information. DWARF-2 makes debugging C++ programs a lot easier. Later: gdb 5.2.1 understands DWARF-2; gcc 3.2.1 now defaults to producing DWARF-2 debug info.
2The default stack size, 512KB, is too small to bootstrap gcc 3.3. Should we increase it to 1MB? stubify needs to be rebuilt, to change the stack size it uses - perhaps it should have a command-line option or look at environment variable, to allow the stack size to be specified? C++ programs probably also require large stacks. Later: gcc 3.3 now bootstraps OK with a 512KB stack. stubify can now pass parameters to stubedit.
2stat does not generate the same inode number each time it is called for a directory on Windows 2000 (and XP?). This bug is exposed by GNU findutils. It is the second problem described in this message: (1). Later: This was misdiagnosed as a problem with stat. It's actually a duplicate of the problem with fstat not inventing the same inode for a file.

The port of Perl 5.6.1 has some problems:

  1. There are some problems with the handling of particular file descriptors: 3 & 4 which are stdprn and stdaux respectively. There are several messages on this issue: (1), (2), (3), (4), (5), (6), (7), (8). This is actually a problem with DJGPP's libc. A work-around has been implemented in the Perl port.

    Later: This problem has been fixed. The final patch was in this message: (1).

  2. The case of variable names in %ENV is handled inconsistently.

    Later: This problem has been fixed.

2The uclock function does not work under Windows 2000 and XP.
2The sources do not build with gcc 3.3, because of its more strict checking (e.g.: -Wstrict-alias). Later: A fix has been committed.
2rename doesn't detect when a directory is being moved into itself, if the directory was entered using a short filename. A fix has been committed.
2 or 3DJGPP's handling of /dev can cause problems. /dev is assumed to be a virtual directory. But if /dev really exists, then all the files in the root directory may appear under /dev too. This is because of the way DJGPP's _put_path function is implemented - this is widely used in DJGPP's C library. See the following thread from djgpp-workers: (1), (2), (3), (4). (2) and (3) explain the mechanics of the problem. Charles Sandmann reports: "I think a _chmod() in the right place might fix this." Later: A fix has been committed.
3df (from the port of GNU fileutils) may not report the disk size or free space correctly, even when there are no TSRs hooking INT 21h. (Please also see the investigated issue about statfs, which is another problem.) Later: A fix has been committed. It was a bug in *statvfs.
3Some DJGPP utilities do not have documentation: symify, go32-v2, stubify, stubedit, exe2coff, dxegen, edebug32 & fsdb. Later: Most of them do now.
4In include/libc/getdinfo.h there are defintions for the bitfield return by the _get_dev_info function, but some code does not use these defines. Instead the code in src/libc/dos/io/setmode.c and src/libc/posix/sys/stat/fstat.c masks the bits off with a hard-coded constant. Later: A fix has been committed.
4remove, select, llseek and fchown don't have any tests.


If you have any (constructive) comments, please e-mail me on