"Scott Marlowe" <scott.marlowe@gmail.com> writes:
> I wonder what it's meaning by invalid arg?
On my Fedora machine, "man write" explains EINVAL thusly:
EINVAL fd is attached to an object which is unsuitable for writing; or
the file was opened with the O_DIRECT flag, and either the
address specified in buf, the value specified in count, or the
current file offset is not suitably aligned.
I'm not sure that writing to a tape is quite like O_DIRECT, but the
mention of an un-aligned count seems pretty relevant. If you grant
the assumption that the underlying problem is that the tape drive
has to be written to in multiples of its blocksize, then this supports
the idea that a violation of that rule would be reported as EINVAL.
regards, tom lane