execvp Questions

6

I am using ubuntu 12.04. I'm trying to "make" a project. I get this error: g++: error trying to exec 'cc1plus': execvp: No such file or directory I have g++ installed.
Earlineearls asked 14/3, 2014 at 19:30

5

Solved

Is there a way to start a child process without fork(), using execvp() exclusively?
Ferreira asked 11/1, 2019 at 19:8

2

Solved

Whenever I try to compile c/cpp files it gives this error: gcc: fatal error: cannot execute ‘as’: execvp: No such file or directory compilation terminated. I have also tried to include full path o...
Befool asked 28/6, 2019 at 5:6

3

I'm presently executing the following Linux command in one of my c programs to display processes that are running. Is there anyway I can modify it to show stopped processes and running ones? char ...
Lw asked 30/9, 2015 at 6:43

2

Solved

I have to develop a simple shell in C using system calls fork()/execvp(). So far my code takes in a command, splits it up using strtok into an array argv and then I call fork to create a child and ...
Thither asked 13/2, 2015 at 14:56

2

I am dealing with a Python script which does, after some preparation work, launch ssh. My script is actually a small CLI tool. On Unix-like systems, at the end of its life, the Python script replac...
Toughen asked 3/5, 2021 at 15:27

2

Solved

The user will read a line and i will retain the first word as a command for execvp. Lets say he will type "cat file.txt" ... command will be cat . But i am not sure how to use this execvp(), i re...
Pneumograph asked 18/12, 2014 at 8:15

3

Solved

I am writing a code that represent a new shell to Linux. One of the commands I want to support is running a process for example if I get the following line command [arguments] Then I want to ...
Jonette asked 18/4, 2019 at 9:52

3

Solved

I want to pass a vector in as the second argument to execvp. Is it possible?
Kainite asked 1/5, 2011 at 6:41

3

Solved

At the beginning, I wrote something like this char* argv[] = { "ls", "-al", ..., (char*)NULL }; execvp("ls", argv); However, GCC popped up this warning, "C++ forbids converting a string constant...
Kazan asked 2/11, 2017 at 6:28

5

Solved

Does anyone know how to catch the output (I think its stdout) from execvp instead of the system printing it (in c on linux) in the terminal?
Raillery asked 8/12, 2011 at 2:29

2

Solved

I've been trying to write a shell in Rust that links directly to the libc library. I've used a Vec<String> to hold the arguments to be passed to execvp(), but it seems that my conversion to c...
V2 asked 10/3, 2017 at 11:37

2

Solved

execvp is defined thus: int execvp(const char *file, char *const argv[]); Which precludes code such as this from being used: const char* argv[] = {"/bin/my", "command", "here", NULL}; execvp(ar...
Jaclin asked 4/5, 2012 at 20:57

0

I created a pThread with a specific session number. If the pThread is spawned I try to get another process running the pseudo terminal launched using openpty. Here is some part of the code: if (o...
Multitudinous asked 10/6, 2014 at 13:53

3

Answers to questions in your head: Yes, this is for school. No, I can't use threads for this. And yes, I looked for an answer and some people said "yes" and others said "no." I'm also fact-checking...
Metamer asked 3/5, 2014 at 4:8

3

Solved

I'm trying to pass arguments entered by the user to execvp(). So far I've split up the string. If the user types ls -a, temp is saved as "ls" and "-a" followed by a NULL character. I'm not quite s...
Starshaped asked 21/3, 2013 at 4:47

3

Solved

I want to write a program Shellcode.c that accepts in input a text file, which contains bash commands separeted by newline, and executes every commands in the text file: for example, the text file ...
Consolidation asked 3/1, 2013 at 14:39

2

Solved

I want to simulate bash in my Linux C program using pipes and execvp function. e.g ls -l | wc -l There is my program: if(pipe(des_p) == -1) {perror("Failed to create pipe");} if(fork() == 0) ...
Trypanosome asked 10/12, 2012 at 12:42

3

Solved

Right now I'm writing a C program that must execute a child process. I'm not doing multiple child processes simultaneously or anything, so this is fairly straightforward. I am definitely executing ...
Crab asked 4/12, 2012 at 18:58

1

Solved

I have the following code. My question is in the code int main() { .... if ((uproc.pid = fork()) == -1) { return -1; } if (uproc.pid == 0) { /* child */ const char *argv[3]; int i = ...
Hardened asked 23/11, 2012 at 16:0

2

Solved

I am having trouble with using execvp(). execvp() expects type char * const* as second parameter. I want to parse arguments passed to application (in argv) and make an array of that type. For examp...
Otherdirected asked 18/10, 2012 at 18:13

2

Solved

I am building a shell and am having some trouble with the system call 'execvp'. I saw some other questions on this topic but they were vague, and did not appear to be completely addressed (whoever ...
Disenfranchise asked 22/5, 2012 at 0:14

2

Solved

When I call execvp, for example execvp(echo, b) where b is an array of arguments for the command a, will changing this array later affect the execvp call made previously? When I try calling execp(e...
Jeroboam asked 11/1, 2012 at 22:54

1

Solved

I have a server process that forks many child processes. The server process has affinity to a CPU core, but I don't want that affinity to be inherited by child process (rather OS should handle wher...
Dric asked 1/12, 2011 at 3:27

5

Solved

Say in C, I want to call execvp() on any string command. Command can just be: char command[] = "ls -l"; char command[] = "rm *.txt"; char command[] = "cat makefile"; I want to put this command v...
Larentia asked 11/11, 2011 at 3:32

© 2022 - 2025 — McMap. All rights reserved.