mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Alan Cox <alan@lxorguk.ukuu.org.uk>
To: Ramagudi Naziir <naziirr@gmail.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: serial device and fsync
Date: Mon, 25 May 2009 14:36:03 +0100	[thread overview]
Message-ID: <20090525143603.3a741658@lxorguk.ukuu.org.uk> (raw)
In-Reply-To: <dfb262380905250250w2d689b28i25edc3d492b09676@mail.gmail.com>

On Mon, 25 May 2009 12:50:22 +0300
Ramagudi Naziir <naziirr@gmail.com> wrote:

> Hi all,
> 
> I need to write(2) a certain character to a serial device (using the
> standard /dev/ttySx), and make sure it was transferred to the device
> before I continue. I tried fsync(2), but that failed (does fsync even
> apply to character devices or only block devices ?).

Block devices
> 
> Any idea ?

Most hardware UARTs actually can't do this but the kernel will do its
best. The POSIX interface you want is tcdrain(fd). Quite why POSIX didn't
use fsync is a very good question.

  reply	other threads:[~2009-05-25 13:35 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-25  9:50 Ramagudi Naziir
2009-05-25 13:36 ` Alan Cox [this message]
2009-05-25 13:50   ` Ramagudi Naziir

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=20090525143603.3a741658@lxorguk.ukuu.org.uk \
    --to=alan@lxorguk.ukuu.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=naziirr@gmail.com \
    /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

all inboxes | Powered by JetHome®