Changeset View
Changeset View
Standalone View
Standalone View
sys/compat/linux/linux_util.h
Show All 36 Lines | |||||
#define _LINUX_UTIL_H_ | #define _LINUX_UTIL_H_ | ||||
#include <sys/uio.h> | #include <sys/uio.h> | ||||
MALLOC_DECLARE(M_LINUX); | MALLOC_DECLARE(M_LINUX); | ||||
MALLOC_DECLARE(M_EPOLL); | MALLOC_DECLARE(M_EPOLL); | ||||
extern char linux_emul_path[]; | extern char linux_emul_path[]; | ||||
extern int linux_use_emul_path; | |||||
int linux_emul_convpath(const char *, enum uio_seg, char **, int, int); | int linux_pwd_onexec(struct thread *); | ||||
void linux_pwd_onexec_native(struct thread *); | |||||
#define LUSECONVPATH(td) atomic_load_int(&linux_use_emul_path) | |||||
#define LCONVPATH_AT(upath, pathp, i, dfd) \ | |||||
do { \ | |||||
int _error; \ | |||||
\ | |||||
_error = linux_emul_convpath(upath, UIO_USERSPACE, \ | |||||
pathp, i, dfd); \ | |||||
if (*(pathp) == NULL) \ | |||||
return (_error); \ | |||||
} while (0) | |||||
#define LCONVPATH(upath, pathp, i) \ | |||||
LCONVPATH_AT(upath, pathp, i, AT_FDCWD) | |||||
#define LCONVPATHEXIST(upath, pathp) LCONVPATH(upath, pathp, 0) | |||||
#define LCONVPATHEXIST_AT(upath, pathp, dfd) LCONVPATH_AT(upath, pathp, 0, dfd) | |||||
#define LCONVPATHCREAT(upath, pathp) LCONVPATH(upath, pathp, 1) | |||||
#define LCONVPATHCREAT_AT(upath, pathp, dfd) LCONVPATH_AT(upath, pathp, 1, dfd) | |||||
#define LFREEPATH(path) free(path, M_TEMP) | |||||
#define DUMMY(s) \ | #define DUMMY(s) \ | ||||
LIN_SDT_PROBE_DEFINE0(dummy, s, not_implemented); \ | LIN_SDT_PROBE_DEFINE0(dummy, s, not_implemented); \ | ||||
int \ | int \ | ||||
linux_ ## s(struct thread *td, struct linux_ ## s ## _args *args) \ | linux_ ## s(struct thread *td, struct linux_ ## s ## _args *args) \ | ||||
{ \ | { \ | ||||
static pid_t pid; \ | static pid_t pid; \ | ||||
\ | \ | ||||
▲ Show 20 Lines • Show All 121 Lines • Show Last 20 Lines |