This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug stdio/17830] dprintf fails when file descriptor is connected to /dev/kmsg


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]