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

Function exec_args_add_str

freebsd/kern/kern_exec.c:1469–1489  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1467}
1468
1469static int
1470exec_args_add_str(struct image_args *args, const char *str,
1471 enum uio_seg segflg, int *countp)
1472{
1473 int error;
1474 size_t length;
1475
1476 KASSERT(args->endp != NULL, ("endp not initialized"));
1477 KASSERT(args->begin_argv != NULL, ("begin_argp not initialized"));
1478
1479 error = (segflg == UIO_SYSSPACE) ?
1480 copystr(str, args->endp, args->stringspace, &length) :
1481 copyinstr(str, args->endp, args->stringspace, &length);
1482 if (error != 0)
1483 return (error == ENAMETOOLONG ? E2BIG : error);
1484 args->stringspace -= length;
1485 args->endp += length;
1486 (*countp)++;
1487
1488 return (0);
1489}
1490
1491int
1492exec_args_add_arg(struct image_args *args, const char *argp,

Callers 2

exec_args_add_argFunction · 0.85
exec_args_add_envFunction · 0.85

Calls 2

copystrFunction · 0.85
copyinstrFunction · 0.50

Tested by

no test coverage detected