lkml.org 
[lkml]   [2009]   [May]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: serial device and fsync
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.


\
 
 \ /
  Last update: 2009-05-25 15:37    [W:0.110 / U:0.084 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site