(C) 1998 AROS - The Amiga Research OS
This function may fail (obviously) on certain devices such as pipes or console handlers.
Small changes and bugfixes
Moved #include's into first column