Bug 000311

When Created: 01/01/2000 18:00:20
Against DJGPP version: 2.02
By whom:
Abstract: system() hangs or returns incorrect value when child process killed
If the child process is killed using ^C or ^-Break, system() should return a
value with SIGINT in bits 8-17.

I get varying results depending on the child process:

1. If the child process is a .COM file (such as CHOICE.COM), the return value
   is zero.

2. More importantly, if it is a DJGPP-compiled program, the return value is
   255 (as if the process had terminated by calling exit(255)).

3. If the command line is "DELTREE \SOMEDIR", killing the child process with
   ^C hangs the DOS session (this works okay if entered from the shell).

errno is not set in any of these cases (well, it may be set in the last case,
but it's very hard to tell).

Note added: 01/01/2000 18:00:35
By whom:
The problem appears to be originating in the spawn() family of functions
(they report the same return values).

Note added: 01/07/2000 06:00:16
By whom:
These all aren't bugs, but expected behavior, due to the exit codes returned
by child programs when they are aborted/killed.  Some of these effects are
documented in the library docs; I added a few caveats to the docs of `system'
so that people won't rely on signal number being present in the upper bits of
the exit status.

As for the case of DELTREE, my testing suggests that it doesn't hang, it just
waits for input.  If I press n and [Enter], it is safely aborted.

Closed on 01/14/2000 10:00:54: This is expected behavior, not a bug.
By whom:

Note added: 11/14/2003 06:57:00
By whom:
I had this problem when i used the command system(s) with and there were many files opened whith the function open()

Isn't it bug, either?

Note added: 11/14/2003 07:01:25
By whom:
Message Error: ERROR 255: Unable to load string resources!

This error ocurred in WINDOWS XP and 2000.

  webmaster     delorie software   privacy  
  Copyright 2010   by DJ Delorie     Updated Jul 2010