MCPcopy Create free account
hub / github.com/F-Stack/f-stack / get_current_prefix

Function get_current_prefix

dpdk/app/test/process.h:206–223  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

204 */
205#ifdef RTE_EXEC_ENV_LINUX
206static char *
207get_current_prefix(char *prefix, int size)
208{
209 char path[PATH_MAX] = {0};
210 char buf[PATH_MAX] = {0};
211
212 /* get file for config (fd is always 3) */
213 snprintf(path, sizeof(path), "/proc/self/fd/%d", 3);
214
215 /* return NULL on error */
216 if (readlink(path, buf, sizeof(buf)) == -1)
217 return NULL;
218
219 /* get the prefix */
220 snprintf(prefix, size, "%s", basename(dirname(buf)));
221
222 return prefix;
223}
224#endif
225
226#endif /* _PROCESS_H_ */

Callers 13

run_pdump_server_testsFunction · 0.85
test_allow_flagFunction · 0.85
test_invalid_b_flagFunction · 0.85
test_invalid_r_flagFunction · 0.85
test_missing_c_flagFunction · 0.85
test_main_lcore_flagFunction · 0.85
test_invalid_n_flagFunction · 0.85
test_no_hpet_flagFunction · 0.85
test_misc_flagsFunction · 0.85
test_file_prefixFunction · 0.85
test_memory_flagsFunction · 0.85

Calls 1

snprintfFunction · 0.85

Tested by

no test coverage detected