void accept_loop(fd) { int pid; int status; while (1) { sin_size = sizeof(struct sockaddr_in); if ((cli_fd = accept(fd, (struct sockaddr *)&their_addr, &sin_size)) == -1) { perror("accept"); continue; } printf("Verbose: connected from %s\n", inet_ntoa(their_addr.sin_addr)); pid = fork(); if (!pid) { close(svr_fd); //drop_priv(); status = vfunc(cli_fd); exit(status); } else{ close(cli_fd); while(waitpid(-1,NULL,WNOHANG) > 0); } } }
void foo (void) { result = a + b + c + d + e + f; vfunc ("text", a, b, c, d, e, f, result); }
int main() { Object o; vfunc((VoidObjMemberFunc)&Clipper::Feedback, &o, 0); return 0; }
void baz() { int x; vfunc(); }
double ASTNodeFunc::eval() { return vfunc(right->eval()); }
int main(int argc, char **argv) { LsiConfig config = { 0 }; bool is_x86_64; const char *n_argv[argc + 2]; const char *exec_command = NULL; int i = 1; int8_t off = 0; int (*vfunc)(const char *, char *const argv[]) = NULL; /* Initialise config */ if (!lsi_config_load(&config)) { lsi_config_load_defaults(&config); } is_x86_64 = lsi_system_is_64bit(); if (!lsi_file_exists(STEAM_BINARY)) { lsi_report_failure("Steam isn't currently installed at %s", STEAM_BINARY); return EXIT_FAILURE; } /* Force STEAM_RUNTIME into the environment */ if (config.use_native_runtime) { /* Explicitly disable the runtime */ setenv("STEAM_RUNTIME", "0", 1); } else { /* Only preload when needed. */ if (lsi_system_requires_preload()) { setenv("LD_PRELOAD", lsi_preload_list(), 1); } setenv("STEAM_RUNTIME", "1", 1); } /* Vanilla dbus users suffer a segfault on Steam exit, due to incorrect * usage of dbus by Steam. Help them out */ setenv("DBUS_FATAL_WARNINGS", "0", 1); memset(&n_argv, 0, sizeof(char *) * (argc + 2)); /* If we're 64-bit and 32-bit is forced, proxy via linux32 */ if (config.force_32 && is_x86_64) { exec_command = EMUL32BIN; n_argv[0] = EMUL32BIN; n_argv[1] = STEAM_BINARY; off = 1; /* Use linux32 in the path */ vfunc = execvp; } else { /* Directly call STEAM_BINARY */ exec_command = STEAM_BINARY; n_argv[0] = STEAM_BINARY; /* Full path here due to shadow nature */ vfunc = execv; } /* Point arguments to arguments passed to us */ for (i = 1; i < argc; i++) { n_argv[i + off] = argv[i]; } n_argv[i + 1 + off] = NULL; /* Go execute steam. */ if (vfunc(exec_command, (char **)n_argv) < 0) { lsi_report_failure("Failed to launch Steam: %s [%s]", strerror(errno), STEAM_BINARY); return EXIT_FAILURE; } }