execlp/execvp needs case-correct PATH

Thomas Wolff towo@towo.net
Mon Feb 9 01:29:00 GMT 2015


Am 09.02.2015 um 00:04 schrieb Thomas Wolff:
> ... as demonstrated by the attached test program.

-------------- next part --------------
#include <unistd.h>
#include <string.h>
#include <errno.h>

#include <stdio.h>

int
main (int argc, char * * argv)
{
	char * prog = argc > 1 ? argv [1] : "notepad";
	int res;

	printf ("Calling exec %s\n", prog);

/*	res = execlp (prog, "-", 0);	*/
	res = execvp (prog, & argv [1]);
	if (res < 0) {
		fprintf (stderr, "errno %d - ", errno);
		perror ("exec");
	}
}
-------------- next part --------------
--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


More information about the Cygwin mailing list