Changeset View
Changeset View
Standalone View
Standalone View
head/sys/sys/imgact.h
Show All 40 Lines | |||||
#define MAXSHELLCMDLEN PAGE_SIZE | #define MAXSHELLCMDLEN PAGE_SIZE | ||||
struct ucred; | struct ucred; | ||||
struct image_args { | struct image_args { | ||||
char *buf; /* pointer to string buffer */ | char *buf; /* pointer to string buffer */ | ||||
void *bufkva; /* cookie for string buffer KVA */ | void *bufkva; /* cookie for string buffer KVA */ | ||||
char *begin_argv; /* beginning of argv in buf */ | char *begin_argv; /* beginning of argv in buf */ | ||||
char *begin_envv; /* beginning of envv in buf */ | char *begin_envv; /* (interal use only) beginning of envv in buf, | ||||
* access with exec_args_get_begin_envv(). */ | |||||
char *endp; /* current `end' pointer of arg & env strings */ | char *endp; /* current `end' pointer of arg & env strings */ | ||||
char *fname; /* pointer to filename of executable (system space) */ | char *fname; /* pointer to filename of executable (system space) */ | ||||
char *fname_buf; /* pointer to optional malloc(M_TEMP) buffer */ | char *fname_buf; /* pointer to optional malloc(M_TEMP) buffer */ | ||||
int stringspace; /* space left in arg & env buffer */ | int stringspace; /* space left in arg & env buffer */ | ||||
int argc; /* count of argument strings */ | int argc; /* count of argument strings */ | ||||
int envc; /* count of environment strings */ | int envc; /* count of environment strings */ | ||||
int fd; /* file descriptor of the executable */ | int fd; /* file descriptor of the executable */ | ||||
struct filedesc *fdp; /* new file descriptor table */ | struct filedesc *fdp; /* new file descriptor table */ | ||||
Show All 33 Lines | |||||
}; | }; | ||||
#ifdef _KERNEL | #ifdef _KERNEL | ||||
struct sysentvec; | struct sysentvec; | ||||
struct thread; | struct thread; | ||||
struct vmspace; | struct vmspace; | ||||
int exec_alloc_args(struct image_args *); | int exec_alloc_args(struct image_args *); | ||||
int exec_args_add_arg(struct image_args *args, const char *argp, | |||||
enum uio_seg segflg); | |||||
int exec_args_add_env(struct image_args *args, const char *envp, | |||||
enum uio_seg segflg); | |||||
int exec_args_add_fname(struct image_args *args, const char *fname, | |||||
enum uio_seg segflg); | |||||
int exec_args_adjust_args(struct image_args *args, size_t consume, | |||||
ssize_t extend); | |||||
char *exec_args_get_begin_envv(struct image_args *args); | |||||
int exec_check_permissions(struct image_params *); | int exec_check_permissions(struct image_params *); | ||||
register_t *exec_copyout_strings(struct image_params *); | register_t *exec_copyout_strings(struct image_params *); | ||||
void exec_free_args(struct image_args *); | void exec_free_args(struct image_args *); | ||||
int exec_new_vmspace(struct image_params *, struct sysentvec *); | int exec_new_vmspace(struct image_params *, struct sysentvec *); | ||||
void exec_setregs(struct thread *, struct image_params *, u_long); | void exec_setregs(struct thread *, struct image_params *, u_long); | ||||
int exec_shell_imgact(struct image_params *); | int exec_shell_imgact(struct image_params *); | ||||
int exec_copyin_args(struct image_args *, const char *, enum uio_seg, | int exec_copyin_args(struct image_args *, const char *, enum uio_seg, | ||||
char **, char **); | char **, char **); | ||||
int exec_copyin_data_fds(struct thread *, struct image_args *, const void *, | int exec_copyin_data_fds(struct thread *, struct image_args *, const void *, | ||||
size_t, const int *, size_t); | size_t, const int *, size_t); | ||||
int pre_execve(struct thread *td, struct vmspace **oldvmspace); | int pre_execve(struct thread *td, struct vmspace **oldvmspace); | ||||
void post_execve(struct thread *td, int error, struct vmspace *oldvmspace); | void post_execve(struct thread *td, int error, struct vmspace *oldvmspace); | ||||
#endif | #endif | ||||
#endif /* !_SYS_IMGACT_H_ */ | #endif /* !_SYS_IMGACT_H_ */ |