LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 12-14-2023, 06:58 AM   #1
jsyjr
LQ Newbie
 
Registered: Dec 2023
Posts: 2

Rep: Reputation: 0
Question Query whether a pipe is empty AND has a reader waiting?


I have long dreamed of recreating, within Emacs, the input and transcript functionality of the Apollo DM (Display Manager):


The distinguishing characteristic of a DM transcript was that, even in the presence of typeahead, it recorded faithfully and immutably, from the child process's perspective, the interleaving of input consumed from stdin with output written to stdout. (Of course, in the absence of typeahead, creating such a transcript is trivial.)

The essential implementation hurdle then is handling typeahead. And that comes down to being able to ask whether the pipe supplying stdin is both (1) empty and (2) has a read waiting.

So my question is, can one do that from userspace on a contemporary Linux kernel?
 
Old 12-15-2023, 01:32 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,863

Rep: Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311
You need to give us some additional details, like what do you want to achieve, which language is it? Do you have some code to show us? Where did you stuck?
http://www.catb.org/~esr/faqs/smart-...html#beprecise
 
Old 12-16-2023, 04:27 AM   #3
zeebra
Senior Member
 
Registered: Dec 2011
Distribution: Slackware
Posts: 1,830
Blog Entries: 17

Rep: Reputation: 638Reputation: 638Reputation: 638Reputation: 638Reputation: 638Reputation: 638
Perhaps strace and ss could be of some help.. But I agree with pan64.
 
Old 12-24-2023, 05:30 AM   #4
jsyjr
LQ Newbie
 
Registered: Dec 2023
Posts: 2

Original Poster
Rep: Reputation: 0
I have received an automated email prompting me to do something with this thread. I will mark the thread as solved, not because I received any reply more useful than what I had already found searching the web, but merely to follow protocol.

I will continue my search for a forum or community more interesting in discussing potential kernel enhancement(s).
 
Old 01-04-2024, 07:29 AM   #5
zeebra
Senior Member
 
Registered: Dec 2011
Distribution: Slackware
Posts: 1,830
Blog Entries: 17

Rep: Reputation: 638Reputation: 638Reputation: 638Reputation: 638Reputation: 638Reputation: 638
That's good and fine, but it doesn't really seem related to the Kernel at all. You'd probably have more luck with the LISP community, or more specifically ELISP, or perhaps even GUILE.
 
Old 01-04-2024, 09:41 AM   #6
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,863

Rep: Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311
I still don't understand what is it all about. Probably it is related: https://unix.stackexchange.com/quest...ata-if-it-isnt
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Selenium: Check whether button exist or not and if exist whether the the text is in it is desired one or not daichiash General 0 07-03-2020 10:17 AM
Hard Drive Problems: timeout waiting for DMA; error waiting for DMA mintee Linux - Hardware 10 09-21-2007 05:06 AM
My browser, all day today: 'waiting for linuxquestions.org...' ..waiting.. waiting .. GrapefruiTgirl LQ Suggestions & Feedback 18 05-25-2007 05:35 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 02:03 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration