Skip to main content

All Questions

Tagged with
1 vote
0 answers
49 views

execve system call returning an unexpected output

So I've been working on a mini project in C about piping and processes in Linux. A program is executed like this: ./a.out "file1" "cmd1" "cmd2" "file2" It ...
Igor Mićović's user avatar
1 vote
0 answers
62 views

Handling Large Text Files with Pipes in C: Minimizing and Debugging a Word Frequency Counter

This program is a minimized version of a larger project that processes text files to generate CSV output with word frequencies. The full version works well for small to medium-sized files but ...
iPc's user avatar
  • 53
1 vote
1 answer
67 views

How to get available data in a pipe in linux

In Linux, after writing some data in a pipe (yet not read), when using fstat on read/write side of a pipe, the st_size field is zero. Is it possible to get the size of data available in a pipe? Sample ...
tahzibi.jafar's user avatar
3 votes
1 answer
140 views

Why is a FIFO pipe on macOS ~8x slower than an anonymous pipe?

On an M1 Max, I have created a FIFO named pipe with mkfifo and am testing write/read performance with a simple C program and pv. The program writes 65536 bytes at a time to stdout. When doing ./writer ...
edaniels's user avatar
  • 778
0 votes
1 answer
60 views

Any suggestions on how to avoid getting the bad file descriptor error on write()?

I've been at this for a while and I'm not sure why I keep getting the bad file descriptor error, I imagine it's maybe related to the clone() function, and how I'm trying to pass the pipe as an ...
Guilherme Garcia Lima's user avatar
3 votes
0 answers
72 views

Shared memory for Inter-process communication performs worse than pipes and system v queue throughput-wise

I am developing an application on an ARM64 platform and benchmarking inter-process communication methods. My tests compare the performance of shared memory, pipes, and System V message queues. ...
Jeppe Lindhard's user avatar
0 votes
0 answers
22 views

The non blocking read pipe end still show pipe is full even when i send a message

What i want to do with the program is to create 3 child processes from one parent . Each child will have 2 pipes connecting to the parent so it can write to the parent and read from it. With this i ...
Niko's user avatar
  • 1
0 votes
1 answer
52 views

I have some problems with non blocking pipes in my c program

I an trying to create a program in c that has one parent process and three child ones. The aim is that the parent will be connected with each child with two pipes so when the children choose to send a ...
Niko's user avatar
  • 1
0 votes
1 answer
56 views

Linux got stuck using pipe() and dup2()

I am simulating the linux shell pipe operator, and I got stuck. The below is the minimal reproducable example of what I tried. #include <stdio.h> #include <stdlib.h> #include <unistd.h&...
MyBug18's user avatar
  • 2,200
1 vote
1 answer
38 views

How can I make one process handle the queue operations and other one execute the query's in the queue

In this code below (server), I need to be able to receive the client's query's, insert them in the FCFS queue and, at the same time, I need those query's to be executed by the server. I know the code ...
Leonardo Alves's user avatar
0 votes
0 answers
53 views

Redirect from pipe back to console on windows with C program

I'm trying to create communication between a parent process and a child process I'm using Windows and the C programming language. The Parent Code: #define _CRT_SECURE_NO_WARNINGS #include <stdio.h&...
Joe's user avatar
  • 171
1 vote
1 answer
84 views

Why is the second or looped select() blocking?

I'm getting blocked at a select() while working with a pipe. The first select() will unblock when we get data on stdin (I just type one letter and press Enter). Then I write data to the write-end of ...
Stewart's user avatar
  • 4,738
0 votes
0 answers
39 views

How to simultaneously send multiple video files (at least 2) using multithreading i.e., pthread library

I have two files one is sender.c and the other is receiver.c file.I am trying to send three video files through pipe. Here is sender.c file requirement: The following are the sender’s requirements: ...
Rabbiya Riaz's user avatar
0 votes
1 answer
49 views

Redirecting stdout with execvp

This code basically a small part of the binary tree with nodes being processes, and it should traverse the tree inorder way passing num1 to left subtree etc. This one just creates a left child and ...
Özgür Çavuşoğlu's user avatar
1 vote
1 answer
33 views

Sending standard output of one child to the standard output of another via a pipe

I am working through the homework in OSTEP, and am doing the following exercise: Write a program that creates two children, and connects the standard output of one to the standard input of the other, ...
Conan G.'s user avatar
  • 153

15 30 50 per page
1
2 3 4 5
178