MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / cbm_subprocess_run

Function cbm_subprocess_run

src/foundation/subprocess.c:2003–2026  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2001}
2002
2003int cbm_subprocess_run(const cbm_proc_opts_t *opts, cbm_proc_result_t *out) {
2004 cbm_proc_result_t local;
2005 if (!out) {
2006 out = &local;
2007 }
2008 cbm_subprocess_result_init(out);
2009
2010 cbm_subprocess_t *process = NULL;
2011 if (cbm_subprocess_spawn(opts, &process) != 0) {
2012 return -1;
2013 }
2014 for (;;) {
2015 cbm_proc_poll_t state = cbm_subprocess_poll(process, out);
2016 if (state == CBM_PROC_POLL_TERMINAL) {
2017 bool supervised = out->tree_quiesced && !out->supervision_failed;
2018 cbm_subprocess_destroy(process);
2019 return supervised ? 0 : -1;
2020 }
2021 /* A valid owned handle has no ERROR state; invalid-argument errors are
2022 * rejected before this compatibility loop is entered. */
2023 const struct timespec delay = {0, 10000000L}; /* 10 ms */
2024 (void)cbm_nanosleep(&delay, NULL);
2025 }
2026}

Callers 15

tracked_readFunction · 0.85
gf_probe_no_lazy_fetchFunction · 0.85
mcp_test_gitFunction · 0.85
pt_gitFunction · 0.85
gf_git_exitFunction · 0.85
impact_test_gitFunction · 0.85
tie_gitFunction · 0.85
test_subprocess.cFile · 0.85
run_shFunction · 0.85
gitenv_spawn_probeFunction · 0.85
sp_stdout_runFunction · 0.85

Calls 5

cbm_subprocess_spawnFunction · 0.85
cbm_subprocess_pollFunction · 0.85
cbm_subprocess_destroyFunction · 0.85
cbm_nanosleepFunction · 0.85

Tested by 15

gf_probe_no_lazy_fetchFunction · 0.68
mcp_test_gitFunction · 0.68
pt_gitFunction · 0.68
gf_git_exitFunction · 0.68
impact_test_gitFunction · 0.68
tie_gitFunction · 0.68
run_shFunction · 0.68
gitenv_spawn_probeFunction · 0.68
sp_stdout_runFunction · 0.68
sp_stdin_runFunction · 0.68
sp_stdin_check_rejectionFunction · 0.68
sp_stdin_probeFunction · 0.68