int32_t main(int32_t argc, int8_t *argv[]) { int32_t iReturn; if(0 != read_cpu_ID()){ return 1; } /*创建守护进程*/ pid_t fpid; //fpid表示fork函数返回的值 fpid=fork(); if (fpid < 0) printf("error in fork!"); else if(fpid == 0) { daemon_process(); } else { SoftwareVersion();//打印软件版本(编译时间) log_init(); device_init(); timer_thread_inti(); read_file_info(); manage_init(); mac_learn_init(); state_detect_init(); open_fpga(); usn_manage_init(); while(1){ heartbeat_transmit(); } } return 0; }