Menu
Menu
DaniWeb
Log In
Sign Up
Read
Contribute
Meet
Search
Search
About 222 results for
execvp
- Page 1
execvp return help...
Programming
Software Development
19 Years Ago
by joshuatree
… command entry and the passing of this to
execvp
? The parent process currently `waits(stat_val)` for…failed"); exit(0); case 0: if(args != NULL){
execvp
(args[0],args); } exit(0); default: status = 0…child process using fork() (2) the child process invokes
execvp
() (3) if background == 1, the parent will …
execvp() and my program gets stuck, send() and it works.
Programming
Software Development
12 Years Ago
by Fredszky
…//Redericting information to socket dup2(s2, STDERR_FILENO);
execvp
(program, arg_list);abort (); // Executing the …//Redericting information to socket dup2(s2, STDERR_FILENO);
execvp
(program, arg_list);abort (); // Executing the…
Re: How can I tell if execvp failed?
Programming
Software Development
15 Years Ago
by VernonDozier
…, char*argv[]) { char* args[3] = {argv[1], argv[2], NULL};
execvp
(args[0], args); fprintf(stdout, "failed\n"); exit…"); } printf ("Program done"); return 0; } [/code] "
execvp
did not execute successfully" displays once, "Program done…
problem with execvp in C
Programming
Software Development
14 Years Ago
by letaki
… a project in C i'm trying to procces..
Execvp
is always returning -1.. and this warning "… passing argument 2 of ‘
execvp
’ from incompatible pointer type" .. here's the source … //sprintf(args[6],"%s",NULL); int X=
execvp
("compute",args); printf("X=%d",…
How can I tell if execvp failed?
Programming
Software Development
15 Years Ago
by VernonDozier
… == 0) { printf ("pid == 0\n");
execvp
(paramList[0], paramList); printf("Error :
execvp
did not execute successfully.\n"); } printf… uncomment line 3 and that changes it to make an
execvp
call to a non-existent program. I expected line 15…
Re: problem with execvp in C
Programming
Software Development
14 Years Ago
by gerard4143
Its a warning so it may work...Try casting the offending variable int X=
execvp
("compute",(char* const*)args);
Re: problem with execvp in C
Programming
Software Development
14 Years Ago
by nezachem
…[7]; real_args[0] = args[0]; real_args[1] = args[1]; // etc;
execvp
("compute", real_args);[/CODE]
General Question about execlp/execvp
Programming
Software Development
16 Years Ago
by wsn
Is the difference between the execlp
execvp
calls and execl execv, is that execlp
execvp
have the advantage of specifying a file name instead of a path name what makes these two functions better to use over execl and execv?
how can i treate with execvp?!!
Programming
Software Development
15 Years Ago
by forislam14
i have an assignment which let the user writes into the terminal -linux system- any command and i should take this command he wrote to execute it using fork and
execvp
() i already can fork a child .. but cant pass parameters to
execvp
cuz i can't understand what these parameters means :D Thank you;
Re: how can i treate with execvp?!!
Programming
Software Development
15 Years Ago
by Ancient Dragon
…/blcmdl3_execvp.htm"]Read this[/URL]. [quote] The execv and
execvp
functions provide an array of pointers to null-terminated strings…
Fork And ExecLP/ExecVP small problem - linux
Programming
Software Development
13 Years Ago
by Despairy
…[1])!=0)) perror("execlp error"); } [/CODE] {same with
execvp
} the problem is when the user entered "ls -l…
Re: How can I tell if execvp failed?
Programming
Software Development
15 Years Ago
by gerard4143
Here's what the manpages have to say... [QUOTE] RETURN VALUE If any of the exec() functions returns, an error will have occurred. The return value is -1, and errno will be set to indicate the error. [/QUOTE]
Re: How can I tell if execvp failed?
Programming
Software Development
15 Years Ago
by VernonDozier
[QUOTE=gerard4143;1175239]Here's what the manpages have to say...[/QUOTE] Right. If there was an error, it should have returned and thus line 15 should have been printed. But it wasn't printed.
Re: How can I tell if execvp failed?
Programming
Software Development
15 Years Ago
by jephthah
does it print "program done" and return 0?
Re: How can I tell if execvp failed?
Programming
Software Development
15 Years Ago
by gerard4143
[QUOTE=jephthah;1175329]does it print "program done" and return 0?[/QUOTE] Which one..The program forks
Re: How can I tell if execvp failed?
Programming
Software Development
15 Years Ago
by jephthah
point. so i mean, does it do it print that end message twice, from the parent and the child? or just once? (or none?) i don't have the answer, i'm just trying to narrow down possibilities.
Re: How can I tell if execvp failed?
Programming
Software Development
15 Years Ago
by gerard4143
I wrote this simple program to demonstrate how the exec family of functions behave: testp.c [CODE] #include <stdio.h> #include <stdlib.h> #include <unistd.h> int main(int argc, char**argv) { execlp(argv[1], argv[1], NULL); fprintf(stdout, "failed\n"); exit(EXIT_SUCCESS); } [/CODE] Usage: execute …
Re: How can I tell if execvp failed?
Programming
Software Development
15 Years Ago
by VernonDozier
Well, I can't recreate the earlier behavior and it works now, so I guess it's solved. Thanks guys!
Re: General Question about execlp/execvp
Programming
Software Development
16 Years Ago
by Ancient Dragon
>>what makes these two functions better to use over execl and execv? Nothing. It just depends on how you want to use them. As described [URL="http://linux.die.net/man/3/execlp"]here[/URL] execlp will search the PATH environment variable for the executable if [b]path[/b] parameter does not contain a slash.
Re: General Question about execlp/execvp
Programming
Software Development
16 Years Ago
by wsn
Thanks!
Re: What is execv equivalent api
Programming
Software Development
16 Years Ago
by John A
execvp
()
Help With Making A Shell
Programming
Software Development
15 Years Ago
by jeeter19
… and run the program at the given path using
execvp
, and must also parse the parameters. I must…problem lies in when I try to do the
execvp
() method, the program says that it was unable …//Execute the command with params:
execvp
(myCmd->name, myCmd->argv); perror("
execvp
failed to run"); exit(-1…
empty shell supporting a delete command
Programming
Software Development
15 Years Ago
by badboizEnt
…Child executes the code inside the if */ if (pid == 0) {
execvp
(*args, args); perror (*args); exit (1) /* NOTE. The execv…are unknown in advance: The arguments to execv() abd
execvp
() are the name of the file to be executed…must be followed by a 0 pointer. execlp() and
execvp
() are called with the same arguments as execl() and…
Multipme pipes in C
Programming
Software Development
13 Years Ago
by mullan123
… pipe"); } close(pipedes[1]); // this is now STDOUT_FILENO
execvp
(*command1, command1); } if ((pid2 = fork()) == -1) … } close(pipedes[0]); // this is now STDIN_FILENO
execvp
(*command2, command2); } close(pipedes[0]); close(pipedes[…
Re: Making a UNIX Shell, so inexperienced at it
Programming
Software Development
19 Years Ago
by kharri5
… the help btw. Good show! If
execvp
returns, you still have two processes running…you mean something like the following. Since
execvp
returns -1 when it fails, then …;< endl; exit(-1); case 0:
execvp
(cmd[0], cmd); if(
execvp
(cmd[0], cmd) == -1) { …
shell programming using C
Programming
Software Development
16 Years Ago
by sting_010
… whitespace or a tab or ...). Executing Commands Look into fork(),
execvp
(), and wait/waitpid(). The fork() system call creates a new… the exec family; for this project, you must use
execvp
(). Remember that if
execvp
() is successful, it will not return; if it…
Figuring out redirection of a child process to a file
Programming
Software Development
15 Years Ago
by opt!kal
…], STDIN_FILENO); dup2(fd[k][1], STDOUT_FILENO); argue = getargs(sepCmd[k]);
execvp
(argue[0], argue); perror(argue[0]); exit(0); } } /*Block …sepCmd[k]); if (srch) dup2(open(srch, O_RDWR|O_CREAT), STDOUT_FILENO);
execvp
(argue[0], argue); perror(argue[0]); exit(0); } while(…
Re: Multiple Threads in Opening Multiple Web Sites?
Programming
Software Development
14 Years Ago
by shinsengumi
…: [CODE] pid_t pid = fork(); if (pid == 0) {
execvp
(...); goes to another website } else {
execvp
(..); goes to 1 website } /*anything below this is… reason*/ pid_t pid2 = fork(); if (pid2 == 0) {
execvp
(...); goes to another website } else {
execvp
(..); goes to 1 website } [/CODE] Like my problem…
Re: Making a UNIX Shell, so inexperienced at it
Programming
Software Development
19 Years Ago
by kharri5
… simply include something to handle it after your
execvp
call. If the call fails, you can … << endl; exit(-1); case 0:
execvp
(cmd[0], cmd); default: wait(NULL); times(&…you mean by putting a line after the
execvp
line. What would the line contain? An…
Re: Create UNIX Shell Pipes handler
Programming
Software Development
15 Years Ago
by boblied
… (a Unix requirement, not a C++ one) -- otherwise how does
execvp
() know where the arguments end?. In the child's…
execvp
(), args1 isn't terminated with a 0; and in the …parent's
execvp
(), the second argument should be [inlinecode]args+pipeno1+1[/inlinecode…
1
2
3
4
Next
Last
Search
Search
Forums
Forum Index
Hardware/Software
Recommended Topics
Programming
Recommended Topics
Digital Media
Recommended Topics
Community Center
Recommended Topics
Latest Content
Newest Topics
Latest Topics
Latest Posts
Latest Comments
Top Tags
Topics Feed
Social
Top Members
Meet People
Community Functions
DaniWeb Premium
Newsletter Archive
Markdown Syntax
Community Rules
Developer APIs
Connect API
Forum API Docs
Tools
SEO Backlink Checker
Legal
Terms of Service
Privacy Policy
FAQ
About Us
Advertise
Contact Us
© 2025 DaniWeb® LLC