LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 12-08-2015, 11:19 AM   #1
blastfox
LQ Newbie
 
Registered: Oct 2015
Posts: 12

Rep: Reputation: Disabled
Question Read and write in fifo


Some weeks ago I asked about read and write in fifo. But I didn't formulate my question clearly. I also asked my teacher, but he couldn't answer. Question: when we open fifo for write with NON_BLOCK flag(fifo hasn't read fd) system returns error, but when we open it only for read returns OK. Why does function open with NON_BLOCK implement such way? Why it isn't implemented in a different way: (write and read) return error or return OK?
UPD: in C, use mkfifo

Last edited by blastfox; 12-08-2015 at 12:45 PM.
 
Old 12-08-2015, 12:01 PM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,689

Rep: Reputation: 7274Reputation: 7274Reputation: 7274Reputation: 7274Reputation: 7274Reputation: 7274Reputation: 7274Reputation: 7274Reputation: 7274Reputation: 7274Reputation: 7274
I think it is in C, but probably not. Can you please post a sample code to show exactly what do you mean?
 
Old 12-08-2015, 12:09 PM   #3
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,142

Rep: Reputation: 2308Reputation: 2308Reputation: 2308Reputation: 2308Reputation: 2308Reputation: 2308Reputation: 2308Reputation: 2308Reputation: 2308Reputation: 2308Reputation: 2308
Never done it in C, but on CLI. Did you use mkfifo (or the equivalent?)
There are some info pages on C programming, which some distro packages redistribute. You can run info printf for instance. you're told what header to include, etc.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Read Write access to a iso9660 filesystem..mount a .iso image as read write ceazar123 Linux - Newbie 16 09-01-2010 09:07 AM
Read Write access to a iso9660 filesystem..mount a .iso image as read write ceazar123 Linux - General 2 08-26-2010 03:32 PM
Reiserfs vs JFS base on Read, Re-read, Write, Re-write Hesi Linux - Desktop 1 03-19-2010 09:45 PM
Non-blocking write to a fifo droussel Programming 0 05-22-2003 01:12 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 11:58 AM.

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