8 #define RZ_SYS_DEVNULL "nul"
10 #define RZ_SYS_DEVNULL "/dev/null"
51 #if !HAVE_PIPE || (__UNIX__ && HAVE_PIPE)
55 #define rz_sys_pipe pipe
56 #define rz_sys_pipe_close close
58 #if !HAVE_EXECV || (__UNIX__ && HAVE_EXECV && HAVE_PIPE && !HAVE_PIPE2)
61 #define rz_sys_execv execv
63 #if !HAVE_EXECVE || (__UNIX__ && HAVE_EXECVE && HAVE_PIPE && !HAVE_PIPE2)
66 #define rz_sys_execve execve
68 #if !HAVE_EXECVP || (__UNIX__ && HAVE_EXECVP && HAVE_PIPE && !HAVE_PIPE2)
71 #define rz_sys_execvp execvp
73 #if !HAVE_EXECL || (__UNIX__ && HAVE_EXECL && HAVE_PIPE && !HAVE_PIPE2)
76 #define rz_sys_execl execl
78 #if !HAVE_SYSTEM || (__UNIX__ && HAVE_SYSTEM && HAVE_PIPE && !HAVE_PIPE2)
81 #define rz_sys_system system
83 #define rz_sys_xsystem(cmd) RZ_V_NOT(rz_sys_system(cmd), -1)
91 #define rz_sys_mkdir_failed() (errno != EEXIST)
107 #define W32_TCHAR_FSTR "%S"
108 #define W32_TCALL(name) name "W"
109 #define rz_sys_conv_utf8_to_win(buf) rz_utf8_to_utf16(buf)
110 #define rz_sys_conv_utf8_to_win_l(buf, len) rz_utf8_to_utf16_l(buf, len)
111 #define rz_sys_conv_win_to_utf8(buf) rz_utf16_to_utf8(buf)
112 #define rz_sys_conv_win_to_utf8_l(buf, len) rz_utf16_to_utf8_l((wchar_t *)buf, len)
114 #define W32_TCHAR_FSTR "%s"
115 #define W32_TCALL(name) name "A"
116 #define rz_sys_conv_utf8_to_win(buf) rz_utf8_to_acp(buf)
117 #define rz_sys_conv_utf8_to_win_l(buf, len) rz_utf8_to_acp_l(buf, len)
118 #define rz_sys_conv_win_to_utf8(buf) rz_acp_to_utf8(buf)
119 #define rz_sys_conv_win_to_utf8_l(buf, len) rz_acp_to_utf8_l(buf, len)
122 RZ_API char *rz_sys_get_src_dir_w32(
void);
124 RZ_API char **rz_sys_utf8_argv_new(
int argc,
const wchar_t **
argv);
125 RZ_API void rz_sys_utf8_argv_free(
int argc,
char **utf8_argv);
139 #ifndef __has_builtin
140 #define __has_builtin(n) (0)
143 #if __has_builtin(__builtin_debugtrap)
144 #define rz_sys_breakpoint() __builtin_debugtrap()
147 #ifndef rz_sys_breakpoint
149 #define rz_sys_breakpoint() \
153 #define rz_sys_breakpoint() __builtin_trap()
154 #elif __i386__ || __x86_64__
155 #define rz_sys_breakpoint() __asm__ volatile("int3");
156 #elif __arm64__ || __aarch64__
157 #define rz_sys_breakpoint() __asm__ volatile("brk 0");
159 #elif (__arm__ || __thumb__)
161 #define rz_sys_breakpoint() __asm__ volatile("bkpt $0");
163 #define rz_sys_breakpoint() __asm__ volatile("svc $1");
166 #define rz_sys_breakpoint() __asm__ volatile("break");
170 #define rz_sys_breakpoint() \
176 #warning rz_sys_breakpoint not implemented for this platform
177 #define rz_sys_trap() __asm__ __volatile__(".word 0");
178 #define rz_sys_breakpoint() \
const lzma_allocator const uint8_t * in
const lzma_allocator const uint8_t size_t uint8_t * out
static static fork const void static count static fd const char const char static newpath const char static path const char path
static static sync static getppid static getegid const char static filename char static len const char char static bufsiz static mask static vfork const void static prot static getpgrp const char static swapflags static arg static fd static protocol static who struct sockaddr static addrlen static backlog struct timeval struct timezone static tz const struct iovec static count static mode const void const struct sockaddr static tolen const char static pathname void count
static static sync static getppid static getegid const char static filename char static len const char char static bufsiz static mask static vfork const void static prot static getpgrp const char static swapflags cmd
static static sync static getppid static getegid const char static filename char static len const char char static bufsiz static mask static vfork const void static prot static getpgrp const char static swapflags static arg static fd static protocol static who struct sockaddr static addrlen static backlog struct timeval struct timezone static tz const struct iovec static count static mode const void const struct sockaddr static tolen const char static pathname void static offset struct stat static buf void long static basep static whence static length const void static len key
static static sync static getppid static getegid const char static filename char static len const char char static bufsiz static mask static vfork const void static prot static getpgrp const char static swapflags static arg static fd static protocol static who struct sockaddr static addrlen static backlog struct timeval struct timezone static tz const struct iovec static count static mode const void const struct sockaddr static tolen const char static pathname void static offset struct stat static buf void long static basep static whence static length const void static len static semflg const void static shmflg const struct timespec struct timespec static rem const char static group const void length
static static fork const void static count static fd const char const char static newpath char char char static envp time_t static t const char static mode static whence const char static dir time_t static t unsigned static seconds const char struct utimbuf static buf static inc static sig const char pathname
static static fork const void static count static fd const char const char static newpath char char char static envp time_t static t const char static mode static whence const char static dir time_t static t unsigned static seconds const char struct utimbuf static buf static inc pid
static static fork const void static count static fd const char const char static newpath char char argv
static const char struct stat static buf struct stat static buf static vhangup int status
RZ_API RZ_OWN char * rz_syscmd_join(RZ_NONNULL const char *file1, RZ_NONNULL const char *file2)
RZ_API bool rz_sys_mkdirp(const char *dir)
RZ_API int rz_sys_execv(const char *pathname, char *const argv[])
RZ_API int rz_sys_execve(const char *pathname, char *const argv[], char *const envp[])
RZ_API bool rz_sys_stop(void)
Send SIGTSTP signal to every process in this process group.
RZ_API int rz_sys_cmdf(const char *fmt,...) RZ_PRINTF_CHECK(1
RZ_API bool rz_sys_aslr(int val)
Enable or disable ASLR for the calling process.
RZ_API char * rz_sys_getenv(const char *key)
Get the value of an environment variable named key or NULL if none exists.
RZ_API void rz_sys_set_environ(char **e)
RZ_API RZ_OWN char * rz_syscmd_cat(RZ_NONNULL const char *file)
RZ_API int rz_sys_execl(const char *pathname, const char *arg,...)
RZ_API int rz_sys_setenv(const char *key, const char *value)
Set an environment variable in the calling process.
RZ_API void rz_sys_perror_str(const char *fun)
RZ_API RZ_OWN char * rz_syscmd_sort(RZ_NONNULL const char *file)
RZ_API char * rz_sys_whoami(char *buf)
RZ_API int rz_sys_truncate_fd(int fd, ut64 length)
RZ_API int rz_sys_pipe(int pipefd[2], bool close_on_exec)
RZ_API char * rz_sys_cmd_strf(const char *cmd,...) RZ_PRINTF_CHECK(1
RZ_API void rz_sys_exit(int status, bool nocleanup)
RZ_API char RZ_API void rz_sys_backtrace(void)
Print the backtrace at the point this function is called from.
RZ_API int rz_sys_run_rop(const ut8 *buf, int len)
RZ_API int rz_sys_open(const char *path, int perm, int mode)
RZ_API void rz_sys_env_init(void)
RZ_API bool rz_sys_getenv_asbool(const char *key)
Return true if the environment variable has the value 1, false otherwise.
RZ_API RzList * rz_sys_dir(const char *path)
RZ_API int rz_sys_clearenv(void)
Clean all environment variables in the calling process.
RZ_API int rz_sys_fork(void)
RZ_API int rz_sys_pipe_close(int fd)
RZ_API int rz_sys_kill(int pid, int sig)
Send signal sig to process with pid pid.
RZ_API int rz_sys_truncate(const char *file, int sz)
RZ_API int rz_sys_getpid(void)
RZ_API FILE * rz_sys_fopen(const char *path, const char *mode)
RZ_API RZ_OWN char * rz_syscmd_mkdir(RZ_NONNULL const char *dir)
RZ_API bool rz_sys_mkdir(const char *dir)
RZ_API int rz_sys_execvp(const char *file, char *const argv[])
RZ_API bool rz_sys_chdir(RZ_NONNULL const char *s)
Change current directory to s, taking care of home expansion ~.
RZ_API int rz_sys_system(const char *command)
RZ_API void rz_sys_info_free(RSysInfo *si)
RZ_API char * rz_sys_pid_to_path(int pid)
RZ_API int rz_sys_usleep(int usecs)
Sleep for usecs microseconds.
RZ_API int rz_sys_cmdbg(const char *cmd)
RZ_API bool rz_is_heap(void *p)
RZ_API RSysInfo * rz_sys_info(void)
RZ_API int RZ_API char * rz_sys_cmd_str(const char *cmd, const char *input, int *len)
RZ_API RZ_OWN char * rz_syscmd_tail(RZ_NONNULL const char *file, int count)
RZ_API RZ_OWN char * rz_syscmd_head(RZ_NONNULL const char *file, int count)
RZ_API int rz_sys_signal(int sig, void(*handler)(int))
RZ_API int rz_sys_cmd_str_full(const char *cmd, const char *input, char **output, int *len, char **sterr)
RZ_API char * rz_sys_getdir(void)
Get current working directory.
RZ_API int rz_sys_run(const ut8 *buf, int len)
RZ_API int rz_sys_crash_handler(const char *cmd)
RZ_API int rz_sys_sleep(int secs)
Sleep for secs seconds.
RZ_API int rz_sys_open_perms(int rizin_perms)
Convert rizin permissions (RZ_PERM_*) to posix permissions that can be passed to rz_sys_open .
RZ_API RZ_OWN char * rz_syscmd_uniq(RZ_NONNULL const char *file)
RZ_API char ** rz_sys_get_environ(void)
RZ_API bool rz_sys_arch_match(const char *archstr, const char *arch)
RZ_API const char * rz_sys_arch_str(int arch)
RZ_API RZ_OWN char * rz_syscmd_ls(RZ_NONNULL const char *input)
RZ_API int rz_sys_arch_id(const char *arch)
RZ_API int rz_sys_sigaction(int *sig, void(*handler)(int))
#define RZ_PRINTF_CHECK(fmt, dots)
ut64(WINAPI *w32_GetEnabledXStateFeatures)()
static const z80_opcode fd[]
static bool input(void *ud, zip_uint8_t *data, zip_uint64_t length)