Sponsored Content
Full Discussion: FIFO write and read
Top Forums Programming FIFO write and read Post 302815613 by ebasse2 on Saturday 1st of June 2013 12:39:22 PM
Old 06-01-2013
FIFO write and read

Can someone help me to write this program in C in QNX?

Using the FIFO queues write a simple communication system consisting of programs write and read. The program write the parameters given strings enclosed in single quotes. These strings are written to the FIFO file. Reads the program read them from there. Programs should behave as in the following example.

$write ‘write1'
$read
read 1
$

I dont know how to do it, but need this program to pass an exam ;(
 

10 More Discussions You Might Find Interesting

1. Programming

popening for read and write

How can 'popen()' be used for reading and writing to opening pipe? If i try 'popen("prog", "rw")' and then put and get chars - it does not work. What is wrong? (1 Reply)
Discussion started by: szzz
1 Replies

2. Shell Programming and Scripting

read and write from a file

I have tried to show the file name whose size is greater than 200 byte in current directory. Please help me. ls -l | tr -s " " " " | cut -f 5,9 -d " " >out.txt #set -a x `cat out.txt` i=0 `cat out.txt` | while do read x echo $x #re=200 j=0 if }" < "200" ] then echo $j j=`expr $j... (2 Replies)
Discussion started by: rinku
2 Replies

3. Shell Programming and Scripting

Find all files with group read OR group write OR user write permission

I need to find all the files that have group Read or Write permission or files that have user write permission. This is what I have so far: find . -exec ls -l {} \; | awk '/-...rw..w./ {print $1 " " $3 " " $4 " " $9}' It shows me all files where group read = true, group write = true... (5 Replies)
Discussion started by: shunter63
5 Replies

4. Programming

read/write files

Hi all, I have a problem with some read/write functions. I have a .bin file which contains a lot of structures as follows: struct alumno { char id; char apellido1; char apellido2; char nombre; float nota1p; float nota2p; float notamedia; char photofilename; }; What I have... (3 Replies)
Discussion started by: Attenea
3 Replies

5. IP Networking

read/write,write/write lock with smbclient fails

Hi, We have smb client running on two of the linux boxes and smb server on another linux system. During a backup operation which uses smb, read of a file was allowed while write to the same file was going on.Also simultaneous writes to the same file were allowed.Following are the settings in the... (1 Reply)
Discussion started by: swatidas11
1 Replies

6. IP Networking

write() / read() syntax

hi am newbie to unix and socket programing I am trying to figuring out syntax for read and write to send data from server to client and client can read it I have to send two integers write(newsockfd,buffer,"%d %d",x,y,0) writing from client where x and y are two integers.. ... (7 Replies)
Discussion started by: karthik1238
7 Replies

7. Programming

Need help about read() and write() on TCP/IP

HI I need to implement a client/server TCP application. the customer is the client and the bartender is the server. When the customer enter the Bar, client connects to the server Server should reply the client immediately. Other wise if the server is busy, it should send an update message... (10 Replies)
Discussion started by: lixiao1212
10 Replies

8. Shell Programming and Scripting

File Read and Write

I have got a file in following format: AAAAAAA BBBBBBBB CCCCCCC DDDDDDD I am trying to read this file and out put it in following format: AAAAAAA,BBBBBBB,CCCCCCC,DDDDDD Preferred method is shell or Perl. Any help appreciated. (11 Replies)
Discussion started by: Araoki
11 Replies

9. Shell Programming and Scripting

Read and write in the file

Hello Guys, How all are doing? I have an issue in Unix and want help from all of you I have a file in UNIX which it read by line by line , If at the end of line '0' is written the it should fetch that line into another file and change '0' to '1' and If at the end of line '1' is written then it... (10 Replies)
Discussion started by: adisky123
10 Replies

10. Shell Programming and Scripting

UNIX fifo concurrent read from a named pipe

I have created a fifo named pipe in solaris, which writes the content of a file, line by line, into pipe as below: $ mkfifo namepipe $ cat books.txt "how to write unix code" "how to write oracle code" $ cat books.txt >> namepipe & I have a readpipe.sh script which reads the named... (2 Replies)
Discussion started by: naveen mani
2 Replies
pthread_rwlock_destroy(3)				     Library Functions Manual					 pthread_rwlock_destroy(3)

NAME
pthread_rwlock_destroy - Destroys a read-write lock object. LIBRARY
DECthreads POSIX 1003.1c Library (libpthread.so) SYNOPSIS
#include <pthread.h> int pthread_rwlock_destroy( pthread_rwlock_t *rwlock); PARAMETERS
Address of the read-write lock object to be destroyed. DESCRIPTION
This routine destroys the specified read-write lock object by uninitializing it, and should be called when the object is no longer refer- enced in your program. After this routine is called, DECthreads may reclaim internal storage used by the specified read-write lock object. The effect of subsequent use of the lock is undefined until the lock is reinitialized by another call to pthread_rwlock_init. It is illegal to destroy a locked read-write lock. The results of this routine are unpredictable if the specified read-write lock object does not currently exist or is not initialized. This routine destroys the read-write lock object specified by the rwlock argument and releases any resources that the object used. A destroyed read-write lock object can be reinitialized using the pthread_rwlock_init(3) routine. The results of otherwise referencing a destroyed read-write lock object are undefined. RETURN VALUES
If an error condition occurs, this routine returns an integer value indicating the type of error. Possible return values are as follows: Successful completion. An attempt was made to destroy the object referenced by rwlock while it is locked or referenced. ERRORS
None RELATED INFORMATION
Functions: pthread_rwlock_init(3) Manuals: Guide to DECthreads and Programmer's Guide delim off pthread_rwlock_destroy(3)
All times are GMT -4. The time now is 10:03 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy