From: Frederik Eaton <frederik@a5.repetae.net>
To: Bryan Henderson <hbryan@us.ibm.com>
Cc: fsdevel <linux-fsdevel@vger.kernel.org>,
Linux-userfs <linux-userfs@vger.kernel.org>, x <vectro@yahoo.com>
Subject: Re: seekable pipes
Date: Mon, 20 Jun 2005 22:02:52 -0700 [thread overview]
Message-ID: <20050621050252.GC7874@a5.repetae.net> (raw)
In-Reply-To: <OF5AE19FD2.3A3EA8FE-ON88257026.007799E4-88257026.007B21A4@us.ibm.com>
> >The stat type for <() files is "character special"
>
> When I do it, it's "FIFO" (st_mode contains S_IFIFO).
>
> >such files are usually seekable.
>
> Really? Character device special files are usually not in my experience:
> terminals, tapes, serial ports.
>
> >In any case, emacs and vim are cool.
>
> You can edit a device special file? Emacs gives me "file cannot be read"
> on various pipe and character device special files I tried. strace shows
> that it does an lstat(), then gives up.
I stand corrected. Sorry. Thanks for verifying. I was testing on
/proc/self/fd/XX after opening it with 'exec', obviously not the same.
So this is a real problem then.
I guess the issue is that the shell has to insert a fifo at the end of
the pipeline in a <() construct in order to get something that can be
read from when written to?
Maybe the solution would be to introduce a <>() construct which uses a
seekable pipe instead of a fifo at the end? And that would suggest a
new version of "|" as well.
Or your suggestion of using an ioctl to change the file type... If a
seekable pipe were created by "upgrading" a regular one then perhaps
this could automatically change the file type at the slave to "regular
file" (from "fifo"). This way the shell wouldn't have to know about
seekable pipes, which would be good. But I can't see how to get around
the race condition where the slave side of the pipe might do a 'stat'
call before the master side has had a chance to change the file type.
It could be possible to have 'stat' block until the master has written
something, but that might introduce deadlocks in existing programs.
Frederik
--
http://ofb.net/~frederik/
next prev parent reply other threads:[~2005-06-21 5:03 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-06-07 10:23 seekable pipes Frederik Eaton
2005-06-07 20:31 ` Bryan Henderson
2005-06-07 21:56 ` x
2005-06-16 4:37 ` Frederik Eaton
2005-06-20 22:24 ` Bryan Henderson
2005-06-21 5:02 ` Frederik Eaton [this message]
2005-06-21 17:47 ` Bryan Henderson
2005-06-21 22:41 ` x
2005-06-22 0:53 ` Bryan Henderson
2005-06-23 15:05 ` x
2005-06-23 15:58 ` Jeff Anderson-Lee
2005-06-23 17:03 ` Bryan Henderson
2005-06-24 5:43 ` Frederik Eaton
[not found] <20041128120006.312.69326.Mailman@lists.us.dell.com>
2004-11-29 5:02 ` Seekable pipes Richard Patterson
-- strict thread matches above, loose matches on Subject: below --
2004-11-27 5:48 Richard Patterson
2004-11-27 19:45 ` Jan Engelhardt
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=20050621050252.GC7874@a5.repetae.net \
--to=frederik@a5.repetae.net \
--cc=frederik@ofb.net \
--cc=hbryan@us.ibm.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-userfs@vger.kernel.org \
--cc=vectro@yahoo.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.