This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug stdio/17830] dprintf fails when file descriptor is connected to /dev/kmsg
- From: "mac at mcrowe dot com" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sourceware dot org
- Date: Thu, 15 Jan 2015 15:42:36 +0000
- Subject: [Bug stdio/17830] dprintf fails when file descriptor is connected to /dev/kmsg
- Auto-submitted: auto-generated
- References: <bug-17830-131 at http dot sourceware dot org/bugzilla/>
https://sourceware.org/bugzilla/show_bug.cgi?id=17830
--- Comment #3 from Mike Crowe <mac at mcrowe dot com> ---
(In reply to Andreas Schwab from comment #2)
> The problem appears to be that devkmsg_open returns without allocating a
> devkmsg_user struct if opened with O_WRONLY, which causes devkmsg_llseek to
> return EBADF, even though the file is properly opened. Please report that
> to the kernel devs.
I think that's intentional. A write-only /dev/kmsg is intended to be
lighter-weight than a readable one.
What seems to be wrong is unconditionally returning EBADF in that situation.
ESPIPE would presumably be better.
Even if the device were opened for reading too and we got past that point I
think dprintf would still get upset since SEEK_CUR isn't handled so
devkmsg_llseek would yield EINVAL.
I think both cases need fixing. I'll try posting a kernel patch.
Thanks for your help.
--
You are receiving this mail because:
You are on the CC list for the bug.