As you suggested, I ran an strace on strace dd if=/dev/zero
of=/dev/fd0. Here are its final lines:
write(2, "dd: ", 4dd: ) = 4
write(2, "/dev/fd0", 8/dev/fd0) = 8
write(2, ": No such file or directory", 27: No such file or directory) = 27
write(2, "\n", 1
) = 1
write(2, "2881+0 records in\n", 182881+0 records in
) = 18
write(2, "2880+0 records out\n", 192880+0 records out
) = 19
close(3) = 0
close(4) = 0
_exit(1) = ?
>
>Now, perror() will print out whatever error message that "errno" indicates, an
>d
>depending on what has been done earlier, errno might be ENOENT (ie "no such
>file or directory"). That's a reasonably normal error value for errno, because
>the library tends to try to open configuration files etc until it finds one, s
>o
>errno is often ENOENT as a result of an earlier library call that succeeded
>(but had to test a few places before doing so).
Earlyer on, we find:
stat("/usr/local/share/locale/C/libc.cat", 0xbffff25c) = -1 ENOENT (No such file or directory)
After creating a /usr/local/share/locale with zero permissions, the
message does indeed change:
> dd if=/dev/zero of=/dev/fd0
dd: /dev/fd0: Permission denied
2881+0 records in
2880+0 records out
Alain