http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30162
--- Comment #23 from Janne Blomqvist <jb at gcc dot gnu.org> 2012-08-03 19:45:10 UTC --- (In reply to comment #22) > Revision 180701 removed all checks for special files in > unit.c:unit_truncate(). Yes. As the email message introducing the patch explained, special files are special in many ways, and trying to impose some kind of uniform behavior on them is bound to fail in more or less surprising and inconvenient ways. For the same reason, the code for handling special files were removed from the buffered IO functions, and all non-regular files now just use the raw IO functions instead. The only sane way is to seek/truncate only when the user code requires such a behavior, and if that then fails, return an error and let the user handle it. The real bug is thus that we shouldn't try to seek or truncate the fd at all, as it's not necessary in this case. I recall that I tried some simple programs with named pipes when I implemented the patch, but maybe some subsequent patch then broke it again.