explain_execvp_or_die(3) Library Functions Manual explain_execvp_or_die(3)NAME
explain_execvp_or_die - execute a file and report errors
SYNOPSIS
#include <libexplain/execvp.h>
void explain_execvp_or_die(const char *pathname, char *const *argv);
DESCRIPTION
The explain_execvp_or_die function is used to call the execvp(3) system call. On failure an explanation will be printed to stderr,
obtained from explain_execvp(3), and then the process terminates by calling exit(EXIT_FAILURE).
This function is intended to be used in a fashion similar to the following example:
explain_execvp_or_die(pathname, argv);
pathname
The pathname, exactly as to be passed to the execvp(3) system call.
argv The argv, exactly as to be passed to the execvp(3) system call.
Returns:
This function only returns on success. On failure, prints an explanation and exits.
SEE ALSO execvp(3)
execute a file
explain_execvp(3)
explain execvp(3) errors
exit(2) terminate the calling process
COPYRIGHT
libexplain version 0.52
Copyright (C) 2009 Peter Miller
explain_execvp_or_die(3)
Check Out this Related Man Page
explain_execve_or_die(3) Library Functions Manual explain_execve_or_die(3)NAME
explain_execve_or_die - execute program and report errors
SYNOPSIS
#include <libexplain/execve.h>
void explain_execve_or_die(const char *pathname, const char *const *argv, const char *const *envp);
DESCRIPTION
The explain_execve_or_die function is used to call the execve(2) system call. On failure an explanation will be printed to stderr,
obtained from explain_execve(3), and then the process terminates by calling exit(EXIT_FAILURE).
This function is intended to be used in a fashion similar to the following example:
explain_execve_or_die(pathname, argv, envp);
pathname
The pathname, exactly as to be passed to the execve(2) system call.
argv The argv, exactly as to be passed to the execve(2) system call.
envp The envp, exactly as to be passed to the execve(2) system call.
Returns:
This function only returns on success. On failure, prints an explanation and exits.
SEE ALSO execve(2)
execute program
explain_execve(3)
explain execve(2) errors
exit(2) terminate the calling process
COPYRIGHT
libexplain version 0.52
Copyright (C) 2008 Peter Miller
explain_execve_or_die(3)
Hi mates,
i am trying to use the C execvp command to run a shell program like this:
.....
char input ;
printf("enter your command");
scanf("%ds",input)
execvp input
....
Compilation is ok but when i run it raise the error :
Segmentation Error ...
your help will be appreciated.
... (1 Reply)
I get this error :
execvp:ar:Arg list too long
when i am trying to link the .obj files created on unix box.
Any resolution to this?
Thanks
Mohit (1 Reply)
Can I do it like this?
if (strcmp(argv, "history")==0)
{
argv = "10";
execvp(argc,argv);
}
actually, it doesn't work,
How can I modify it?
Thanks (17 Replies)
Hi ,
I m actually trying to implement pipes program,but after executing the execvp(),my program is getting hanged up :mad:
Actaully i m getting the desired output expected from execvp()...but once results are displayed on the output screen ,program is getting hanged up
values of... (3 Replies)
this is in one of my scripts...
if ($#argv == 0) then
echo 'blah bla'
exit 0
endif
I want it to be something like this...
if ($#argv == 0 OR $argv >=3)
echo 'blah bla'
exit 0
endif
so when the arguments are none, or greater than three I want this "if then" to take over. how? I... (5 Replies)
hey all, I have question when am writing simple shell...
in the child am calling execvp, i want the parent to know when execvp returns - 1. how can i let the parent know the result of execvp
thanks in advance (9 Replies)
Mi idea es crear un pequeña shell...lo que pasa es que cuando ejecuto el siguiente programa va todo bien hasta que me salta el error
perror("Error al ejecutar la función execvp\n");
Entonces la aplicación me entra en un bucle(repitiendo todo el rato el error anterio), como puedo hacer para que eso no... (1 Reply)
Hello!
I am learning how to use the function execvp. I have read through the UNIX manual.
I have a process. I run execvp and I command it to do “printenv”. It works fine.
Before I do the execvp-call I pipe STDOUT to go to a specific pipe. After that I restore STDOUT. I read that pipe in another... (2 Replies)
Hi, I do the following:
i) malloc some parameter structures
ii) fork
iii) in the child, I call execvp using these parameters
obviously, here I can never free() the structures as execvp should not return
iiii) I am currently doing waitpid in parent then freeing, but this does not seem to work... (1 Reply)
All of my machines (various open source derivatives on x86 and amd64) store argv above the stack (at a higher memory address). I am curious to learn if any systems store argv below the stack (at a lower memory address).
I am particularly interested in proprietary Unices, such as Solaris, HP-UX,... (9 Replies)