[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Pwaitpid bug?



Hi!

There are two (not really) bugs in the code for Pwaitpid:

- If WNOHANG was specified with the options argument the standard
  and no children were found the standard behavior for the wait*
  family of functiosn would be to return immediately with no error.
  The Pwaitpid of MiNT returns -33 (file not found) instead.
  I haven't changed that in the kernel since there may be programs
  that rely on that behavior [while (Pwaitpid (...) >= 0) { ... }].
  
  Libraries that implement wait* should be changed:
  
  	long retval = Pwaitpid (...);
  	if (retval == -33 && (options & WNOHANG))
  	  return 0;  /* Ignore bogus error.  */
  	else if (retval < 0) {
  	  errno = -retval;
  	  return -1;
  	} else {
  	...
  
- The MiNTLib (and actually almost every libc for every platform)
  expects to find the signal number that caused a child process to
  terminate in the lowest seven bits of the return value from
  Pwaitpid (have a look at the macros WIFSIGNALED and WTERMSIG
  in sys/wait.h).  MiNT currently disappoints these expectations.
  I've changed this now.  The MiNTLib doesn't have to modified
  for that. Any other programs that would get into problems?

Ciao

Guido
-- 
http://stud.uni-sb.de/~gufl0000
mailto:gufl0000@stud.uni-sb.de