------- Additional Comments From fxcoudert at gcc dot gnu dot org  2005-06-18 
08:44 -------
The problem is in the different behavior of ftruncate on /dev/null:

$ cat a.c 
#include <unistd.h>
#include <errno.h>
#include <fcntl.h>
#include <stdio.h>

int main (void)
{
  int fd = open ("/dev/null", O_RDWR);
  ftruncate (fd, 0);
  printf ("%d\n", errno);
  close (fd);
  return 0;
}

On linux, this code outputs 22 (EINVAL), while on freebsd it outputs 0. I
suppose the reason of the failure is similar for other platforms.

I'm sure what to do, but I don't think I'll take too much time thinking about
it, since this a low-priority bug really.

While we wait for this to be solved, I think we should make sure the testcase
only runs on linux and solaris (for which this is known to work).

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |minor
   Last reconfirmed|2005-05-17 08:04:28         |2005-06-18 08:44:51
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21593

Reply via email to