From: Andries.Brouwer@cwi.nl
To: mchouque@e-steel.com, viro@math.psu.edu
Cc: linux-kernel@vger.kernel.org
Subject: Re: Floppy disk strange behavior
Date: Wed, 10 Jan 2001 00:03:13 +0100 (MET) [thread overview]
Message-ID: <UTC200101092303.AAA149310.aeb@texel.cwi.nl> (raw)
>> dd: advancing past 1 blocks in output file `/dev/fd0': Permission denied
> dd bug. It tries to ftruncate() the output file and gets all upset when
> kernel refuses to truncate a block device (surprise, surprise).
Yes. But EPERM means that something is wrong with privileges.
One would expect EINVAL or so when something is wrong with the
way the routine was called.
Let me find my docs :-)
===== austin - d5 ============================================
...
If fildes refers to a regular file, the ftruncate( ) function shall cause
the size of the file to be truncated to length. If the size of the file
previously exceeded length, the extra data shall no longer be available
to reads on the file. If the file previously was smaller than this size,
ftruncate( ) shall either increase the size of the file or fail.
XSI-conformant systems shall increase the size of the file.
If the file size is increased, the extended area shall appear as if it
were zero-filled. The value of the seek pointer shall not be modified
by a call to ftruncate( ).
...
If fildes refers to a directory, ftruncate( ) shall fail.
...
If fildes refers to any other file type, except a shared memory object,
the result is unspecified.
=============================================================
No info on errors here.
===== Digital Unix man ======================================
...
The path parameter must point to a pathname which names
a regular file for which the calling process has write permission.
...
[EINVAL] The file is not a regular file
=============================================================
So, as was to be expected, other systems use EINVAL in this
situation, and so should we.
Andries
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/
next reply other threads:[~2001-01-09 23:04 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-01-09 23:03 Andries.Brouwer [this message]
2001-01-09 23:36 ` truncate() error values (was Re: Floppy disk strange behavior) Alexander Viro
-- strict thread matches above, loose matches on Subject: below --
2001-01-09 20:33 Floppy disk strange behavior Mathieu Chouquet-Stringer
2001-01-09 21:22 ` Alexander Viro
2001-01-09 21:37 ` Alan Cox
2001-01-09 21:57 ` Alexander Viro
2001-01-09 22:44 ` Mathieu Chouquet-Stringer
2001-01-09 23:20 ` Alan Cox
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=UTC200101092303.AAA149310.aeb@texel.cwi.nl \
--to=andries.brouwer@cwi.nl \
--cc=linux-kernel@vger.kernel.org \
--cc=mchouque@e-steel.com \
--cc=viro@math.psu.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.