int createProcess()
{
int retCode = ACE::daemonize();
std::cout << "retCode = " << retCode << ", lasterror = " << ACE_OS::last_error() << std::endl;
std::string command = "ping -t 10.71.211.153";
ACE_Process_Options startOption;
ACE_Process startProcess;
startOption.command_line("%s", command.c_str());
startOption.handle_inheritence(FALSE);
// 设置一下libpath
/*
const int ENVNUM = 1; //需要设置的环境变量数为2
ACE_TCHAR *pEnvString[ENVNUM+1] = {0}; //最后一个指向0
std::string libPath = "";
#ifdef WIN32
libPath = ::getenv("PATH");
#else
libPath = ACE_OS::getenv("LD_LIBRARY_PATH");
#endif
procOption.setenv();
*/
#ifdef WIN32
ACE_HANDLE fd = ACE_OS::open("nul", O_RDWR);
#else
int fd = ACE_OS::open("/dev/null", O_RDWR);
#endif
//startOption.set_handles(fd, fd, fd);
pid_t pid = startProcess.spawn(startOption);
ACE_OS::close(fd);
startProcess.wait();
return 0;
}
分享到:
相关推荐
创建一个新的ACE_Process_Options对象,为新的子进程指定合乎你需要的属性;2)用ACE_Process::spawn()方法派生新进程。 #include <ace/OS.h>#include <ace/Log_Msg.h>#include <ace/Process.h>
ACE_Thread.txt ACE_Thread.txt ACE_Thread.txt ACE_Thread.txt ACE_Thread.txt ACE_Thread.txtACE_Thread.txt ACE_Thread.txt ACE_Thread.txt ACE_Thread.txt
HI0022E_amba_axi_and_ace_protocol_spec.pdfHI0022E_amba_axi_and_ace_protocol_spec.pdf
static __time64_t __cdecl _make__time64_t ( struct tm *tb, int ultflag ) { __time64_t tmptm1, tmptm2, tmptm3; struct tm tbtemp; long dstbias = 0;... long timezone = 0;...= NULL ), EINVAL, ( ( __time64...
ACE_wrappers22222222
ACE_wrappers11111111
ACE_wrappers 5.7类库 使用CodeBlocks 8.02 gcc 3.4.5编译的Release版本 文件列表 libACE.dll.a,libACE.dll,libACE_ETCL.dll,libACE_ETCL_Parser.dll,libACE_Monitor_Control.dll
使用ACE_Proactor进行TCP通信的示例代码。
ACE_OS命名空间函数参考文档 用ACE跨平台最常用的系统函数
ACE_Proactor TCP协议通信示例代码
使用ACE 搭建的TCP服务器和客户端框架。简洁明了,可以扩充。
一个ACE写的服务器端,可以连接多个用户,并处理其请求
ACE测试程序,使用ACE_Time_Value和ACE_Get_Opt进行ACE环境搭建和测试
ACE JS lite framework | 轻量级JS核心开发框架
ACE数据的传输,使用ACE代码编写,实现数据的传输
ACE默认生成的库是标准库版,现在有生成好了的ACE的MFC版本,实用于VC++2005
axi协议官方版,适合学习axi4,axi3 axilite axistream的学生和工程师研究学习
2016 最近版本的ace-admin 1.3.4 亲测通过,给个好评
ACE网络层 单独拿出来用 有需要的可以试试看