English 中文(简体)
排在外衣后的方案停止(指挥,指挥,指挥)
原标题:program stops after execvp( command.argv[0], command.argv)

我正在起草一个小壳方案,负责指挥和执行。 如果用户进入不有效的指挥系统,如果报表回复到1。 如果指挥正确,则执行指挥,但一旦指挥方案结束。 我做了什么错误,在之后不执行法典的界线? 我已用步枪和散射机对前哨(指挥、指挥、指挥)进行了测试,因此我很相信它会奏效。 这里是我的法典。

  int shell(char *cmd_str ){
  int commandLength=0;
  cmd_t command;
  commandLength=make_cmd(cmd_str,  command);
  cout<< commandLength<<endl;
  cout << command.argv[0]<< endl;
  if( execvp( command.argv[0], command.argv)==-1)
//if the command it executed nothing runs after this line
  {
    commandLength=-1;

}else
{
  cout<<"work"<<endl;
}

  cout<< commandLength<<endl;
   return commandLength;


}
最佳回答
问题回答

http://linux.die.net/man/3/execvp“rel=“nofollow”>exec

职能家庭用新的过程形象取代目前的过程形象。 该手册中描述的职能是前线(2)。 (关于更换当前过程形象的进一步详情,见手册网页“和”;外部文件(2)。)

如果你想要继续这一进程,这不是你想要利用的职能。

@Pavan - 就象我这样的特尼-皮尔斯而言,从技术上讲,“当前进程”的说法是不真实的。 它仍然采用同样的手法,只是用不同的形象(编码、数据等)来表述。





相关问题
Undefined reference

I m getting this linker error. I know a way around it, but it s bugging me because another part of the project s linking fine and it s designed almost identically. First, I have namespace LCD. Then I ...

C++ Equivalent of Tidy

Is there an equivalent to tidy for HTML code for C++? I have searched on the internet, but I find nothing but C++ wrappers for tidy, etc... I think the keyword tidy is what has me hung up. I am ...

Template Classes in C++ ... a required skill set?

I m new to C++ and am wondering how much time I should invest in learning how to implement template classes. Are they widely used in industry, or is this something I should move through quickly?

Print possible strings created from a Number

Given a 10 digit Telephone Number, we have to print all possible strings created from that. The mapping of the numbers is the one as exactly on a phone s keypad. i.e. for 1,0-> No Letter for 2->...

typedef ing STL wstring

Why is it when i do the following i get errors when relating to with wchar_t? namespace Foo { typedef std::wstring String; } Now i declare all my strings as Foo::String through out the program, ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

Window iconification status via Xlib

Is it possible to check with the means of pure X11/Xlib only whether the given window is iconified/minimized, and, if it is, how?

热门标签