1433d6423SLionel Sambuc /* The <lib.h> header is the master header used by the library. 2433d6423SLionel Sambuc * All the C files in the lib subdirectories include it. 3433d6423SLionel Sambuc */ 4433d6423SLionel Sambuc 5433d6423SLionel Sambuc #ifndef _LIB_H 6433d6423SLionel Sambuc #define _LIB_H 7433d6423SLionel Sambuc 8433d6423SLionel Sambuc /* First come the defines. */ 9433d6423SLionel Sambuc #include <sys/featuretest.h> /* tell headers to include NetBSD stuff. */ 10433d6423SLionel Sambuc 11433d6423SLionel Sambuc /* The following are so basic, all the lib files get them automatically. */ 12433d6423SLionel Sambuc #include <minix/config.h> /* must be first */ 13433d6423SLionel Sambuc #include <sys/types.h> 14*0df28c9fSDavid van Moolenbroek #include <sys/uio.h> 15433d6423SLionel Sambuc #include <limits.h> 16433d6423SLionel Sambuc #include <errno.h> 17433d6423SLionel Sambuc 18433d6423SLionel Sambuc #include <minix/const.h> 19433d6423SLionel Sambuc #include <minix/com.h> 20433d6423SLionel Sambuc #include <minix/type.h> 21433d6423SLionel Sambuc #include <minix/callnr.h> 22433d6423SLionel Sambuc #include <minix/endpoint.h> 23433d6423SLionel Sambuc #include <minix/ipc.h> 24433d6423SLionel Sambuc 25594df55eSDavid van Moolenbroek struct minix_kerninfo *get_minix_kerninfo(void); 26594df55eSDavid van Moolenbroek 2720054ae9SDavid van Moolenbroek vir_bytes minix_get_user_sp(void); 2820054ae9SDavid van Moolenbroek 29433d6423SLionel Sambuc struct ps_strings; /* forward declaration for minix_stack_fill. */ 30433d6423SLionel Sambuc 31594df55eSDavid van Moolenbroek void minix_stack_params(const char *path, char * const *argv, 32594df55eSDavid van Moolenbroek char * const *envp, size_t *stack_size, char *overflow, int *argc, 33594df55eSDavid van Moolenbroek int *envc); 34433d6423SLionel Sambuc void minix_stack_fill(const char *path, int argc, char * const *argv, 35433d6423SLionel Sambuc int envc, char * const *envp, size_t stack_size, char *frame, 36433d6423SLionel Sambuc int *vsp, struct ps_strings **psp); 37433d6423SLionel Sambuc 38433d6423SLionel Sambuc int __execve(const char *_path, char *const _argv[], char *const 39433d6423SLionel Sambuc _envp[], int _nargs, int _nenvps); 40433d6423SLionel Sambuc int _syscall(endpoint_t _who, int _syscallnr, message *_msgptr); 41433d6423SLionel Sambuc void _loadname(const char *_name, message *_msgptr); 42433d6423SLionel Sambuc int _len(const char *_s); 43433d6423SLionel Sambuc void _begsig(int _dummy); 44433d6423SLionel Sambuc 45*0df28c9fSDavid van Moolenbroek #define _VECTORIO_READ 1 46*0df28c9fSDavid van Moolenbroek #define _VECTORIO_WRITE 2 47*0df28c9fSDavid van Moolenbroek ssize_t _vectorio_setup(const struct iovec * iov, int iovcnt, char ** ptr, 48*0df28c9fSDavid van Moolenbroek int op); 49*0df28c9fSDavid van Moolenbroek void _vectorio_cleanup(const struct iovec * iov, int iovcnt, char * buffer, 50*0df28c9fSDavid van Moolenbroek ssize_t r, int op); 51*0df28c9fSDavid van Moolenbroek 52433d6423SLionel Sambuc #endif /* _LIB_H */ 53