public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "mac at mcrowe dot com" <sourceware-bugzilla@sourceware.org>
To: glibc-bugs@sourceware.org
Subject: [Bug stdio/17830] dprintf fails when file descriptor is connected to /dev/kmsg
Date: Thu, 15 Jan 2015 15:42:00 -0000	[thread overview]
Message-ID: <bug-17830-131-A1sl7dxY4Q@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-17830-131@http.sourceware.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.


  parent reply	other threads:[~2015-01-15 15:42 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-12 12:33 [Bug stdio/17830] New: " mac at mcrowe dot com
2015-01-12 12:34 ` [Bug stdio/17830] " mac at mcrowe dot com
2015-01-15 11:13 ` schwab@linux-m68k.org
2015-01-15 11:22 ` schwab@linux-m68k.org
2015-01-15 15:42 ` mac at mcrowe dot com [this message]
2015-01-15 15:57 ` mac at mcrowe dot com
2015-01-15 17:46 ` mac at mcrowe dot com
2015-01-30  4:58 ` bugdal at aerifal dot cx
2015-01-30 10:38 ` schwab@linux-m68k.org
2015-01-30 15:19 ` bugdal at aerifal dot cx

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=bug-17830-131-A1sl7dxY4Q@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=glibc-bugs@sourceware.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).