Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8626527
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T08:03:04+00:00 2026-06-12T08:03:04+00:00

I am writing a C program in linux. I have created a process and

  • 0

I am writing a C program in linux.

I have created a process and forking it to create a child. I want to run another program in this child so I am using execlp. But, this program must run in an independent window.

if ( (execlp("xterm","xterm","-e","./Child1", "127.0.0.1", (char *) 0)) < 0)  {
  printf("Failed to Start the Echo Client. Exiting application.");
  return 1;
}

Child1.c is a simple program which is in the same directory as my current file.

On execution the code runs fine with the xterm window coming up but I get an error "xterm: Can't execvp: No file or directory"

Can you please suggest me a resolution?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T08:03:05+00:00Added an answer on June 12, 2026 at 8:03 am

    Your system might not have an xterm installed (or the user has a wrong PATH). You could test the existence of /usr/bin/xterm (with e.g. the access syscall), or use something else. For example, many Debian or Ubuntu distributions have a x-terminal-emulator (which is usually a symlink to some precise program) which you could use instead of xterm.

    If xterm fires up, then your program ./Child1 does not exist, you should test its existence (with access) before. If you only have a source code ./Child1.c you should have compiled it before (perhaps by running a system("gcc -Wall Child1.c -o Child1") before and testing that it has compiled successfully, i.e. test that system returns 0 and that the Child1 file exists and is executable).

    You should take time to read the xterm(1) man page.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm writing an python program (gui in gtk) (linux btw.) I want to have
I'm writing a program to be run from the Linux user space which spawns
Newbie to C. I'm writing an ANSI C program (on Linux using gcc 4.4.6)
I'm writing a C program for OS X and Linux, and I want to
I am writing a Java program on Suse Linux 11 using JavaSE-1.6 and I
I am writing a program using threads in c++ in linux. Currently, I am
I have a server program that I am writing. In this program, I log
I'm writing a program using epoll_wait to wait for file descriptors on 64-bit Linux,
I'm writing a C/C++ program that I'd like to have run when a user
Working in Linux and using C++. I have a program which initiates a thread.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.