delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2004/01/24/19:11:33

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
To: cygwin AT cygwin DOT com
From: Rolf Campbell <Endlisnis AT mailc DOT net>
Subject: Re: strange thing for execlp() function
Date: Sat, 24 Jan 2004 19:11:13 -0500
Lines: 29
Message-ID: <buv1j2$4pp$1@sea.gmane.org>
References: <20040124212204 DOT 2386 DOT qmail AT web41412 DOT mail DOT yahoo DOT com>
Mime-Version: 1.0
X-Complaints-To: usenet AT sea DOT gmane DOT org
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.6b) Gecko/20031205 Thunderbird/0.4
In-Reply-To: <20040124212204.2386.qmail@web41412.mail.yahoo.com>

kaiduan xie wrote:
> Hi,all,
> 
> I just want to use execlp to invoke another program
> from a program. It works on Linux, but it stucks on
> Cygwin. Acutally, this is a very very very simple
> program:
> 
> #include <stdio.h>
> #include <sys/types.h>
> #include <unistd.h>
> #include <errno.h>
> #include <string.h>
> 
> int main()
> {
> 	pid_t pid;
> 	
> 	printf("Hello, cygwin!\n");
> 	if (execlp("/home/kaiduan/test2.exe",
> "test2.exe",(char *)0) < 0)
> 		printf("Error is %s\n", strerror(errno));
> }
> 
> I also added current directy to PATH, but it still
> sucks. Anything wrong?
Yes, there is something wrong.  You haven't said what the problem is 
(other than it sucking).  This program works fine for me if i change the 
line to "/bin/ls.exe".


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019