Barrelfish
Functions | Variables
spawn_client.c File Reference

Client for interacting with the spawn daemon on each core. More...

Functions

errval_t spawn_program_with_caps (coreid_t coreid, const char *path, char *const argv[], char *const envp[], struct capref inheritcn_cap, struct capref argcn_cap, spawn_flags_t flags, domainid_t *ret_domainid)
 Request the spawn daemon on a specific core to spawn a program. More...
 
errval_t spawn_program (coreid_t coreid, const char *path, char *const argv[], char *const envp[], spawn_flags_t flags, domainid_t *ret_domainid)
 Request the spawn daemon on a specific core to spawn a program. More...
 
errval_t spawn_program_on_all_cores (bool same_core, const char *path, char *const argv[], char *const envp[], spawn_flags_t flags, domainid_t *ret_domainid, coreid_t *spawn_count)
 Request a program be spawned on all cores in the system. More...
 
errval_t spawn_kill (domainid_t domainid)
 Kill a domain.
 
errval_t spawn_exit (uint8_t exitcode)
 Exit this domain.
 
errval_t spawn_wait_coreid (coreid_t coreid, domainid_t domainid, uint8_t *exitcode, bool nohang)
 Wait for spawned proccess to exit on core.
 
errval_t spawn_wait_core (coreid_t coreid, domainid_t domainid, uint8_t *exitcode, bool nohang)
 Wait for the termination of a domain on a remote core.
 
errval_t spawn_wait (domainid_t domainid, uint8_t *exitcode, bool nohang)
 Wait for spawned proccess to exit on current core.
 
errval_t spawn_get_domain_list (uint8_t **domains, size_t *len)
 Get the list of domains for ps like implementation.
 
errval_t spawn_get_status (uint8_t domain, struct spawn_ps_entry *pse, char **argbuf, size_t *arglen, errval_t *reterr)
 Get the status of a domain for ps like implementation.
 
errval_t spawn_dump_capabilities (domainid_t domainid)
 Dump capabilities for a given domain.
 
errval_t alloc_inheritcn_with_caps (struct capref *inheritcn_capp, struct capref fdcap, struct capref sidcap, struct capref kernelcap)
 Utility function to create an inherit cnode and copy caps into it. More...
 

Variables

char ** environ
 

Detailed Description

Client for interacting with the spawn daemon on each core.

Function Documentation

errval_t alloc_inheritcn_with_caps ( struct capref inheritcn_capp,
struct capref  fdcap,
struct capref  sidcap,
struct capref  kernelcap 
)

Utility function to create an inherit cnode and copy caps into it.

Parameters
inheritcn_cappPointer to capref, filled-in with location of inheritcn capability.
fdcapfdcap to copy into inherit cnode.
sidcapsidcap to copy into inherit cnode.
kernelcapkernelcap to copy into inherit cnode.
Return values
SYS_ERR_OKinherticn_capp is allocated and contains copies of the provided caps.
errval_t spawn_program ( coreid_t  coreid,
const char *  path,
char *const  argv[],
char *const  envp[],
spawn_flags_t  flags,
domainid_t *  ret_domainid 
)

Request the spawn daemon on a specific core to spawn a program.

Parameters
coreidCore ID on which to spawn the program
pathAbsolute path in the file system to an executable image suitable for the given core
argvCommand-line arguments, NULL-terminated
envpOptional environment, NULL-terminated (pass NULL to inherit)
flagsFlags to spawn
ret_domainidIf non-NULL, filled in with domain ID of program
errval_t spawn_program_on_all_cores ( bool  same_core,
const char *  path,
char *const  argv[],
char *const  envp[],
spawn_flags_t  flags,
domainid_t *  ret_domainid,
coreid_t *  spawn_count 
)

Request a program be spawned on all cores in the system.

Parameters
same_coreIff false, don't spawn on the same core as the caller
pathAbsolute path in the file system to an executable image suitable for the given core
argvCommand-line arguments, NULL-terminated
envpOptional environment, NULL-terminated (pass NULL to inherit)
flagsFlags to spawn
ret_domainidIf non-NULL, filled in with domain ID of program
countHow much programs it spawned
Note
This function is for legacy compatibility with existing benchmark/test code, and SHOULD NOT BE USED IN NEW CODE UNLESS YOU HAVE A GOOD REASON! It doesn't make much sense from a scalability perspective, and is probably useless on a heterogeneous system.
errval_t spawn_program_with_caps ( coreid_t  coreid,
const char *  path,
char *const  argv[],
char *const  envp[],
struct capref  inheritcn_cap,
struct capref  argcn_cap,
spawn_flags_t  flags,
domainid_t *  ret_domainid 
)

Request the spawn daemon on a specific core to spawn a program.

Parameters
coreidCore ID on which to spawn the program
pathAbsolute path in the file system to an executable image suitable for the given core
argvCommand-line arguments, NULL-terminated
envpOptional environment, NULL-terminated (pass NULL to inherit)
inheritcn_capCap to a CNode containing capabilities to be inherited
argcn_capCap to a CNode containing capabilities passed as arguments
flagsFlags to spawn
ret_domainidIf non-NULL, filled in with domain ID of program

Variable Documentation

char** environ

Environment as a pointer to a pointer rather than a pointer to an array.