186 questions
0 votes
1 answer
79 views
GCOV coverage does not work when process is created using fork and execv?
I have a large application which forks and execv another binary. I have compiled both parent application and forked child application using --coverage flags. Noticed that .gcno files are created for ...
0 votes
2 answers
154 views
When are smart pointers' memory cleared on calling execv() in a program?
I was trying to understand when the memory owned by shared (smart) pointers are cleared on calling execv() from the code. Assume the following code: #include <memory> class Test { public: ~...
1 vote
1 answer
60 views
How to have a script open another script in a way that interacts well with other features of a JetBrains-IDE?
I have a script that is basically just a small GUI to create a config-file for a long-running-program without any graphics. I have and control the source-code for both of these. The usual workflow of ...
0 votes
1 answer
71 views
How to stop writing to a file execv
I am trying to write only to a file when a user specifies which file to write in with ">". The first iteration works fine, but when a user types any command after the one where they ...
2 votes
1 answer
113 views
Userfaultfd fails register with ENOMEM after execv
I have a program (parent.rs) that will: Fork Create a userfaultfd on the child, then transfer it to the parent (with pidfd_getfd). Execs the child (child.rs) Child allocates memory with mmap and &...
1 vote
0 answers
58 views
Getting result of exec*() from child process without waiting in any case (not using pipes and vfork())
I am working on custom wrappers for Unix-specific system calls now. And the last problem I met is about how to create a complete function for creating new processes with another image. And I want this ...
1 vote
1 answer
173 views
C++ fork and threads, mysql and execv
I'm afraid I have to take out a bit of length so that my question can be understood exactly. I know that forking can cause some problems, especially if you mix it with threads. One nasty problem I ...
-1 votes
2 answers
110 views
Two parallel program execv with fork with returning to code
I'm writing pseudo-shell and now write parallel-command functionality. In this question ( Differences between fork and exec ) I'm found how I can call execv with returning to my code execution. But I ...
0 votes
0 answers
206 views
Passing arguments to execv() system call
I'm trying to build a version of a linux shell wherein, I take in the commands from the user and execute the commands using execv() system call. I'm using strtok_r to tokenize the commands and pass ...
0 votes
2 answers
117 views
Execv with argument array
I have a simple C program that creates an array of arguments as required by the second argument of execv() that executes a program that computes and outputs the Caeser Cipher decoding of the argument. ...
0 votes
1 answer
3k views
Standard functions in C99 being called "Implicit declarations"
I have a C program that I am running on my MacOS terminal. All command line tools and GCC compiler have been installed. However for using functions like getpid() or execv() it gives the following ...
2 votes
1 answer
263 views
Execv with arguments starting from second element
I am making a program that can take another program as an argument and run it. I am using execv() to run the second program, but how can I use argv[] (that comes from the main program, is a char*) as ...
0 votes
1 answer
136 views
c pipe ls returned strings to parent
I'm currently trying to run an ls command in my C code and then pipe the outputted strings to the parent process via a fd. The problem I'm currently facing is, that I execv the ls command but I don't ...
0 votes
1 answer
451 views
Fork() and execv() not running in parallel, why?
I'm trying to run a series of commands through execv() and forking a new process in C to run each one, and yet for some reason they aren't running in parallel. The following code is run for each ...
0 votes
0 answers
40 views
How can I use few commands in execv() [duplicate]
I'm writing a code in C and I'm trying to use 3 commands (echo, grep and wc) with excev() but its not working. It is possible to do it and if not any other solution or I will need to use fscanf(). How ...