$(API_NAME_LIST):
if [ -f $@ ]; then rm $@;fi
+ cat include/api_names_global.h > $@
cat */api_names.txt >> $@
$(SOURCE_HEADERS): $(API_NAME_LIST)
va_end(par); \
p += sprintf(p, ">");
-int execl(const char *path, const char *arg, ...)
+int PROBE_NAME(execl)(const char *path, const char *arg, ...)
{
int res;
PRINTMSG("%s [%d] ", __FUNCTION__, getpid());
return res;
}
-int execlp(const char *file, const char *arg, ...)
+int PROBE_NAME(execlp)(const char *file, const char *arg, ...)
{
int res;
PRINTMSG("%s [%d] ", __FUNCTION__, getpid());
return res;
}
-int execle(const char *path, const char *arg, ...
+int PROBE_NAME(execle)(const char *path, const char *arg, ...
/* original func have one more argument but
* i can't leave it in code by compilation reasons
* so it is commented:
return res;
}
-int execv(const char *path, char *const argv[])
+int PROBE_NAME(execv)(const char *path, char *const argv[])
{
int res;
PRINTMSG("%s [%d] ", __FUNCTION__, getpid());
return res;
}
-int execvp(const char *file, char *const argv[])
+int PROBE_NAME(execvp)(const char *file, char *const argv[])
{
int res;
PRINTMSG("%s [%d] ", __FUNCTION__, getpid());
return res;
}
-int execve(const char *filename, char *const argv[],char *const envp[])
+int PROBE_NAME(execve)(const char *filename, char *const argv[],char *const envp[])
{
int res;
PRINTMSG("%s [%d] ", __FUNCTION__, getpid());
return res;
}
-int execvpe(const char *file, char *const argv[],char *const envp[])
+int PROBE_NAME(execvpe)(const char *file, char *const argv[],char *const envp[])
{
int res;
PRINTMSG("%s [%d] ", __FUNCTION__, getpid());
#ifndef __ALIASES_H__
#define __ALIASES_H__
+
#define weak_alias(f1, f2) void f1 () __attribute__ ((weak, alias (#f2)))
+#define weak_alias_2(f1, pref, f2) weak_alias(f1, pref ## f2)
+#define weak_alias_1(f1, pref, f2) weak_alias_2(f1, pref, f2)
+#define weak_alias_pref(f1, f2) weak_alias_1(f1, PROBE_NAME_PREFIX, f2)
#endif /* __ALIASES_H__ */
--- /dev/null
+#ifndef __API_NAMES_GLOBAL_H__
+#define __API_NAMES_GLOBAL_H__
+
+#define PROBE_NAME_PREFIX __PROBE__
+
+#endif
#include <dlfcn.h>
#include <stdint.h>
#include "probeinfo.h"
+#include "api_names_global.h"
#ifdef __cplusplus
extern "C"{
#endif
+#define GET_VALUE_2(x,y) x##y
+#define GET_VALUE_1(x,y) GET_VALUE_2(x, y)
+#define PROBE_NAME(func) GET_VALUE_1(PROBE_NAME_PREFIX, func)
+
#ifndef likely
#define likely(x) __builtin_expect((x),1)
#define unlikely(x) __builtin_expect((x),0)
symbol = rtdl_next(sname); \
} while (0)
-#define rtdl_next_current_set_once(symbol) \
- rtdl_next_set_once(symbol, __func__)
-
// ========================= print log =====================================
#define PRINTMSG(...) print_log_fmt(MSG_MSG, __FUNCTION__, __LINE__, __VA_ARGS__)
#define PRINTWRN(...) print_log_fmt(MSG_WARNING, __FUNCTION__, __LINE__, __VA_ARGS__)
} while(0); \
errno = (newerrno != 0) ? newerrno : olderrno
-
/************************************ UI APP ******************************************/
static bool _ui_dalc_app_create(void *user_data)
{
voidp_to_uint64(user_data));
}
-int ui_app_main(int argc, char **argv, ui_app_lifecycle_callback_s *callback, void *user_data)
+int PROBE_NAME(ui_app_main)(int argc, char **argv, ui_app_lifecycle_callback_s *callback, void *user_data)
{
static int (*ui_app_mainp)(int argc, char **argv, ui_app_lifecycle_callback_s *callback, void *user_data);
Ecore_Event_Handler* handler;
FLUSH_LOCAL_BUF(); \
} while (0)
-Eina_Bool ecore_event_evas_key_down(void *data, int type, void *event)
+Eina_Bool PROBE_NAME(ecore_event_evas_key_down)(void *data, int type, void *event)
{
static Eina_Bool (*ecore_event_evas_key_downp)(void *data, int type, void *event);
probeInfo_t probeInfo;
return ecore_event_evas_key_downp(data, type, event);
}
-Eina_Bool ecore_event_evas_key_up(void *data, int type, void *event)
+Eina_Bool PROBE_NAME(ecore_event_evas_key_up)(void *data, int type, void *event)
{
static Eina_Bool (*ecore_event_evas_key_upp)(void *data, int type, void *event);
probeInfo_t probeInfo;
return ecore_event_evas_key_upp(data, type, event);
}
-Eina_Bool ecore_event_evas_mouse_button_down(void *data, int type, void *event)
+Eina_Bool PROBE_NAME(ecore_event_evas_mouse_button_down)(void *data, int type, void *event)
{
static Eina_Bool (*ecore_event_evas_mouse_button_downp)(void *data, int type, void *event);
probeInfo_t probeInfo;
return ecore_event_evas_mouse_button_downp(data, type, event);
}
-Eina_Bool ecore_event_evas_mouse_button_up(void *data, int type, void *event)
+Eina_Bool PROBE_NAME(ecore_event_evas_mouse_button_up)(void *data, int type, void *event)
{
static Eina_Bool (*ecore_event_evas_mouse_button_upp)(void *data, int type, void *event);
probeInfo_t probeInfo;
return ecore_event_evas_mouse_button_upp(data, type, event);
}
-Eina_Bool ecore_event_evas_mouse_move(void *data, int type, void *event)
+Eina_Bool PROBE_NAME(ecore_event_evas_mouse_move)(void *data, int type, void *event)
{
static Eina_Bool (*ecore_event_evas_mouse_movep)(void *data, int type, void *event);
probeInfo_t probeInfo;
fsetpos, fsetpos, 0
ftell, ftell, 0
fwrite, fwrite, 0
-getc, _IO_getc, 0
+getc, getc, 0
getchar, getchar, 0
gets, gets, 0
printf, printf, 0
-putc, _IO_putc, 0
+putc, putc, 0
putchar, putchar, 0
puts, puts, 0
rewind, rewind, 0
return path;
}
-int open(const char* path, int oflag, ...)
+int PROBE_NAME(open)(const char* path, int oflag, ...)
{
static int (*openp)(const char* path, int oflag, ...);
char buffer[PATH_MAX];
return ret;
}
-int openat(int fd, const char* path, int oflag, ...)
+int PROBE_NAME(openat)(int fd, const char* path, int oflag, ...)
{
static int (*openatp)(int fd, const char* path, int oflag, ...);
char buffer[PATH_MAX];
return ret;
}
-int creat(const char* path, mode_t mode)
+int PROBE_NAME(creat)(const char* path, mode_t mode)
{
static int (*creatp)(const char* path, mode_t mode);
char buffer[PATH_MAX];
return ret;
}
-int close(int fd)
+int PROBE_NAME(close)(int fd)
{
static int (*closep)(int fd);
DECLARE_VARIABLE_FD;
return ret;
}
-off_t lseek(int fd, off_t offset, int whence)
+off_t PROBE_NAME(lseek)(int fd, off_t offset, int whence)
{
static int (*lseekp)(int fd, off_t offset, int whence);
off_t offret;
return offret;
}
-int fsync(int fd)
+int PROBE_NAME(fsync)(int fd)
{
static int (*fsyncp)(int fd);
return ret;
}
-int fdatasync(int fd)
+int PROBE_NAME(fdatasync)(int fd)
{
static int (*fdatasyncp)(int fd);
-int ftruncate(int fd, off_t length)
+int PROBE_NAME(ftruncate)(int fd, off_t length)
{
static int (*ftruncatep)(int fd, off_t length);
return ret;
}
-int fchown(int fd, uid_t owner, gid_t group)
+int PROBE_NAME(fchown)(int fd, uid_t owner, gid_t group)
{
static int (*fchownp)(int fd, uid_t owner, gid_t group);
-int lockf(int fd, int function, off_t size)
+int PROBE_NAME(lockf)(int fd, int function, off_t size)
{
static int (*lockfp)(int fd, int function, off_t size);
int api_type = FD_API_PERMISSION;
-int fchmod(int fd, mode_t mode)
+int PROBE_NAME(fchmod)(int fd, mode_t mode)
{
static int (*fchmodp)(int fd, mode_t mode);
// Read / Write APIs
// *****************************************************************
-ssize_t pread(int fd, void *buf, size_t nbyte, off_t offset)
+ssize_t PROBE_NAME(pread)(int fd, void *buf, size_t nbyte, off_t offset)
{
static ssize_t (*preadp)(int fd, void *buf, size_t nbyte, off_t offset);
ssize_t sret;
return sret;
}
-ssize_t read(int fd, void *buf, size_t nbyte)
+ssize_t PROBE_NAME(read)(int fd, void *buf, size_t nbyte)
{
static ssize_t (*readp)(int fildes, void *buf, size_t nbyte);
ssize_t sret;
return sret;
}
-ssize_t pwrite(int fd, const void *buf, size_t nbyte, off_t offset)
+ssize_t PROBE_NAME(pwrite)(int fd, const void *buf, size_t nbyte, off_t offset)
{
static ssize_t (*pwritep)(int fd, const void *buf, size_t nbyte, off_t offset);
ssize_t sret;
return sret;
}
-ssize_t write(int fd, const void *buf, size_t nbyte)
+ssize_t PROBE_NAME(write)(int fd, const void *buf, size_t nbyte)
{
static ssize_t (*writep)(int fildes, const void *buf, size_t nbyte);
ssize_t sret;
}
-ssize_t readv(int fd, const struct iovec *iov, int iovcnt)
+ssize_t PROBE_NAME(readv)(int fd, const struct iovec *iov, int iovcnt)
{
static ssize_t (*readvp)(int fd, const struct iovec *iov, int iovcnt);
ssize_t sret;
// why writev is commented ?
#if 0
-ssize_t writev(int fd, const struct iovec *iov, int iovcnt)
+ssize_t PROBE_NAME(writev)(int fd, const struct iovec *iov, int iovcnt)
{
static ssize_t (*writevp)(int fd, const struct iovec *iov, int iovcnt);
// *****************************************************************
// File Attributes APIs
// *****************************************************************
-int fcntl(int fd, int cmd, ...)
+int PROBE_NAME(fcntl)(int fd, int cmd, ...)
{
static int (*fcntlp)(int fd, int cmd, ...);
int arg = 0, api_type = FD_API_OTHER;
return ret;
}
-int dup(int fd)
+int PROBE_NAME(dup)(int fd)
{
static int (*dupp)(int fd);
return ret;
}
-int dup2(int fd, int fd2)
+int PROBE_NAME(dup2)(int fd, int fd2)
{
static int (*dup2p)(int fd, int fd2);
//FIXME dlsym error
// fstat is not in LIBC
#if 0
-int fstat(int fd, struct stat *buf)
+int PROBE_NAME(fstat)(int fd, struct stat *buf)
{
static int (*fstatp)(int fd, struct stat *buf);
}
#endif
-int futimens(int fd, const struct timespec times[2])
+int PROBE_NAME(futimens)(int fd, const struct timespec times[2])
{
static int (*futimensp)(int fd, const struct timespec times[2]);
return path;
}
-FILE* fopen(const char* filename, const char* mode)
+FILE* PROBE_NAME(fopen)(const char* filename, const char* mode)
{
static FILE* (*fopenp)(const char* filename, const char* mode);
char buffer[PATH_MAX];
return fret;
}
-FILE* freopen(const char * filename, const char * mode, FILE * stream)
+FILE* PROBE_NAME(freopen)(const char * filename, const char * mode, FILE * stream)
{
static FILE* (*freopenp)(const char *filename, const char *mode,
FILE *stream);
return fret;
}
-FILE* fdopen(int fildes, const char *mode)
+FILE* PROBE_NAME(fdopen)(int fildes, const char *mode)
{
static FILE* (*fdopenp)(int fildes, const char *mode);
FILE* fret;
return fret;
}
-int fflush(FILE* stream)
+int PROBE_NAME(fflush)(FILE* stream)
{
static int (*fflushp)(FILE* stream);
return ret;
}
-int fclose(FILE* stream)
+int PROBE_NAME(fclose)(FILE* stream)
{
static int (*fclosep)(FILE* stream);
DECLARE_VARIABLE_FD;
return ret;
}
-FILE * tmpfile ( void )
+FILE * PROBE_NAME(tmpfile )( void )
{
static FILE* (*tmpfilep) ( void );
FILE* fret;
return fret;
}
-int fgetpos(FILE* stream, fpos_t* position)
+int PROBE_NAME(fgetpos)(FILE* stream, fpos_t* position)
{
static int (*fgetposp)(FILE* stream, fpos_t* position);
return ret;
}
-int fseek(FILE* stream, long int offset, int origin)
+int PROBE_NAME(fseek)(FILE* stream, long int offset, int origin)
{
static int (*fseekp)(FILE* stream, long int offset, int origin);
return ret;
}
-int fsetpos(FILE* stream, const fpos_t* pos)
+int PROBE_NAME(fsetpos)(FILE* stream, const fpos_t* pos)
{
static int (*fsetposp)(FILE* stream, const fpos_t* pos);
return ret;
}
-long int ftell(FILE* stream)
+long int PROBE_NAME(ftell)(FILE* stream)
{
static long int (*ftellp)(FILE* stream);
long int lret;
return lret;
}
-void rewind(FILE* stream)
+void PROBE_NAME(rewind)(FILE* stream)
{
static void (*rewindp)(FILE* stream);
voidp_to_uint64(stream));
}
-void clearerr(FILE* stream)
+void PROBE_NAME(clearerr)(FILE* stream)
{
static void (*clearerrp)(FILE* stream);
voidp_to_uint64(stream));
}
-int feof(FILE* stream)
+int PROBE_NAME(feof)(FILE* stream)
{
static int (*feofp)(FILE* stream);
return ret;
}
-int ferror(FILE* stream)
+int PROBE_NAME(ferror)(FILE* stream)
{
static int (*ferrorp)(FILE* stream);
return ret;
}
-int fileno(FILE* stream)
+int PROBE_NAME(fileno)(FILE* stream)
{
static int (*filenop)(FILE* stream);
// File read / write APIs
// *******************************************************************
-int vfprintf(FILE* stream, const char* format, va_list arg)
+int PROBE_NAME(vfprintf)(FILE* stream, const char* format, va_list arg)
{
static int (*vfprintfp)(FILE* stream, const char* format, va_list arg);
return ret;
}
-int vfscanf(FILE* stream, const char* format, va_list arg)
+int PROBE_NAME(vfscanf)(FILE* stream, const char* format, va_list arg)
{
static int (*vfscanfp)(FILE* stream, const char* format, va_list arg);
return ret;
}
-int fgetc(FILE* stream)
+int PROBE_NAME(fgetc)(FILE* stream)
{
static int (*fgetcp)(FILE* stream);
}
#if 0 // why is this commented?
-char* fgets(char* str, int size, FILE* stream)
+char* PROBE_NAME(fgets)(char* str, int size, FILE* stream)
{
static char* (*fgetsp)(char* str, int num, FILE* stream);
char* cret;
}
#endif
-int fputc(int character, FILE* stream)
+int PROBE_NAME(fputc)(int character, FILE* stream)
{
static int (*fputcp)(int character, FILE* stream);
return ret;
}
-int fputs(const char* str, FILE* stream)
+int PROBE_NAME(fputs)(const char* str, FILE* stream)
{
static int (*fputsp)(const char* str, FILE* stream);
return ret;
}
-int getc(FILE* stream)
+int PROBE_NAME(getc)(FILE* stream)
{
static int (*getcp)(FILE* stream);
return ret;
}
-int putc(int character, FILE* stream)
+int PROBE_NAME(putc)(int character, FILE* stream)
{
static int (*putcp)(int character, FILE* stream);
return ret;
}
-int ungetc(int character, FILE* stream)
+int PROBE_NAME(ungetc)(int character, FILE* stream)
{
static int (*ungetcp)(int character, FILE* stream);
return ret;
}
-size_t fread(void* ptr, size_t size, size_t count, FILE* stream)
+size_t PROBE_NAME(fread)(void* ptr, size_t size, size_t count, FILE* stream)
{
static size_t (*freadp)(void* ptr, size_t size, size_t count, FILE* stream);
size_t tret;
return tret;
}
-size_t fwrite(const void* ptr, size_t size, size_t count, FILE* stream)
+size_t PROBE_NAME(fwrite)(const void* ptr, size_t size, size_t count, FILE* stream)
{
static size_t (*fwritep)(const void* ptr, size_t size, size_t count, FILE* stream);
size_t tret;
// *********************************************************
// variable parameter function
// *********************************************************
-int fprintf(FILE* stream, const char* format, ...)
+int PROBE_NAME(fprintf)(FILE* stream, const char* format, ...)
{
static int (*vfprintfp)(FILE* stream, const char* format, ...);
return ret;
}
-int fscanf(FILE* stream, const char* format, ...)
+int PROBE_NAME(fscanf)(FILE* stream, const char* format, ...)
{
static int (*vfscanfp)(FILE* stream, const char* format, ...);
}
#if !defined(DA_DEBUG_LOG) && !defined(PRINT_STDOUT)
-int printf(const char* format, ...)
+int PROBE_NAME(printf)(const char* format, ...)
{
static int (*vprintfp)(const char* format, ...);
}
#endif
-int scanf(const char* format, ...)
+int PROBE_NAME(scanf)(const char* format, ...)
{
static int (*vscanfp)(const char* format, ...);
return ret;
}
-int getchar()
+int PROBE_NAME(getchar)()
{
static int (*getcharp)();
return ret;
}
-int putchar(int c)
+int PROBE_NAME(putchar)(int c)
{
static int (*putcharp)(int c);
return ret;
}
-char* gets(char* str)
+char* PROBE_NAME(gets)(char* str)
{
static char* (*getsp)(char* str);
char* cret;
}
#if !defined(DA_DEBUG_LOG) && !defined(PRINT_STDOUT)
-int puts(const char* str)
+int PROBE_NAME(puts)(const char* str)
{
static int (*putsp)(const char* str);
-void setbuf(FILE* stream, char* buf)
+void PROBE_NAME(setbuf)(FILE* stream, char* buf)
{
static void (*setbufp)(FILE* stream, char* buf);
voidp_to_uint64(buf));
}
-void setbuffer(FILE* stream, char* buf, size_t size)
+void PROBE_NAME(setbuffer)(FILE* stream, char* buf, size_t size)
{
static void (*setbufferp)(FILE* stream, char* buf, size_t size);
voidp_to_uint64(buf), (uint64_t)(size));
}
-void setlinebuf(FILE* stream)
+void PROBE_NAME(setlinebuf)(FILE* stream)
{
static int (*setlinebufp)(FILE* stream);
voidp_to_uint64(stream));
}
-int setvbuf(FILE* stream, char* buf, int mode, size_t size)
+int PROBE_NAME(setvbuf)(FILE* stream, char* buf, int mode, size_t size)
{
static int (*setvbufp)(FILE* stream, char* buf, int mode, size_t size);
}
/**************************** ALIASES *********************************/
-weak_alias(__isoc99_scanf, scanf);
+weak_alias_pref(__isoc99_scanf, scanf);
#include "da_memory.h"
#include "binproto.h"
-void *malloc(size_t size)
+void *PROBE_NAME(malloc)(size_t size)
{
static void* (*mallocp)(size_t);
DECLARE_VARIABLE_STANDARD;
void *pret;
- rtdl_next_current_set_once(mallocp);
+ rtdl_next_set_once(mallocp, "malloc");
PRE_PROBEBLOCK();
return pret;
}
-void free(void *ptr)
+void PROBE_NAME(free)(void *ptr)
{
static void (*freep)(void *);
DECLARE_VARIABLE_STANDARD;
- rtdl_next_current_set_once(freep);
+ rtdl_next_set_once(freep, "free");
PRE_PROBEBLOCK();
POST_PACK_PROBEBLOCK_BEGIN();
PREPARE_LOCAL_BUF();
- PACK_COMMON_BEGIN(MSG_PROBE_MEMORY, API_ID_free,
+ PACK_COMMON_BEGIN(MSG_PROBE_MEMORY, API_ID_free,
"p", (int64_t)(int) ptr);
PACK_COMMON_END('v', 0, newerrno, blockresult);
PACK_MEMORY(0, MEMORY_API_FREE, ptr);
POST_PACK_PROBEBLOCK_END();
}
-void *realloc(void *memblock, size_t size)
+void *PROBE_NAME(realloc)(void *memblock, size_t size)
{
static void* (*reallocp)(void*, size_t);
DECLARE_VARIABLE_STANDARD;
void *pret;
- rtdl_next_current_set_once(reallocp);
+ rtdl_next_set_once(reallocp, "realloc");
PRE_PROBEBLOCK();
if(memblock != NULL)
: NULL;
}
-void *calloc(size_t nelem, size_t elsize)
+void *PROBE_NAME(calloc)(size_t nelem, size_t elsize)
{
static void* (*callocp)(size_t, size_t);
DECLARE_VARIABLE_STANDARD;
* of static memory via `temp_calloc`.
*/
callocp = temp_calloc;
- callocp = rtdl_next(__func__);
+ callocp = rtdl_next("calloc");
}
PRE_PROBEBLOCK();
#include "real_functions.h"
-void *memset(void *memblock, int c, size_t n)
+void *PROBE_NAME(memset)(void *memblock, int c, size_t n)
{
static void *(*memsetp)(void *,int,size_t);
DECLARE_VARIABLE_STANDARD;
return pret;
}
-int memcmp(const void * ptr1, const void * ptr2, size_t num)
+int PROBE_NAME(memcmp)(const void * ptr1, const void * ptr2, size_t num)
{
static int(*memcmpp)(const void *,const void *,size_t);
DECLARE_VARIABLE_STANDARD;
return ret;
}
-void *memcpy(void * destination, const void * source, size_t num )
+void *PROBE_NAME(memcpy)(void * destination, const void * source, size_t num )
{
static void *(*memcpyp)(void *,const void *,size_t);
DECLARE_VARIABLE_STANDARD;
}
//FD
-int socket(int domain, int type, int protocol) {
+int PROBE_NAME(socket)(int domain, int type, int protocol) {
static int (*socketp)(int domain, int type, int protocol);
BEFORE_ORIGINAL_SOCK(socket, LIBC);
ret = socketp(domain, type, protocol);
return ret;
}
-int accept(int socket, struct sockaddr *address, socklen_t *address_len) {
+int PROBE_NAME(accept)(int socket, struct sockaddr *address, socklen_t *address_len) {
static int (*acceptp)(int socket, struct sockaddr *address,
socklen_t *address_len);
return ret;
}
-int accept4(int sockfd, struct sockaddr *addr, socklen_t *addrlen, int flags) {
+int PROBE_NAME(accept4)(int sockfd, struct sockaddr *addr, socklen_t *addrlen, int flags) {
static int (*accept4p)(int sockfd, struct sockaddr *addr,
socklen_t *addrlen, int flags);
return ret;
}
-int connect(int socket, const struct sockaddr *address, socklen_t address_len) {
+int PROBE_NAME(connect)(int socket, const struct sockaddr *address, socklen_t address_len) {
static int (*connectp)(int socket, const struct sockaddr *address,
socklen_t address_len);
return ret;
}
-int shutdown(int socket, int how) {
+int PROBE_NAME(shutdown)(int socket, int how) {
static int (*shutdownp)(int socket, int how);
BEFORE_ORIGINAL_SOCK(shutdown, LIBC);
return ret;
}
-int bind(int socket, const struct sockaddr *address, socklen_t address_len) {
+int PROBE_NAME(bind)(int socket, const struct sockaddr *address, socklen_t address_len) {
static int (*bindp)(int socket, const struct sockaddr *address,
socklen_t address_len);
return ret;
}
-int listen(int socket, int backlog) {
+int PROBE_NAME(listen)(int socket, int backlog) {
static int (*listenp)(int socket, int backlog);
BEFORE_ORIGINAL_SOCK(listen, LIBC);
ret = listenp(socket, backlog);
return ret;
}
-ssize_t send(int socket, const void *message, size_t length, int flags) {
+ssize_t PROBE_NAME(send)(int socket, const void *message, size_t length, int flags) {
static ssize_t (*sendp)(int socket, const void *message, size_t length,
int flags);
ssize_t sret, result;
return sret;
}
-ssize_t recv(int socket, void *buffer, size_t length, int flags) {
+ssize_t PROBE_NAME(recv)(int socket, void *buffer, size_t length, int flags) {
static ssize_t (*recvp)(int socket, void *buffer, size_t length, int flags);
ssize_t sret, result;
return sret;
}
-ssize_t sendto(int socket, const void *message, size_t length, int flags,
+ssize_t PROBE_NAME(sendto)(int socket, const void *message, size_t length, int flags,
const struct sockaddr *dest_addr, socklen_t dest_len) {
static ssize_t (*sendtop)(int socket, const void *message, size_t length,
int flags, const struct sockaddr *dest_addr, socklen_t dest_len);
return sret;
}
-ssize_t recvfrom(int socket, void *buffer, size_t length, int flags,
+ssize_t PROBE_NAME(recvfrom)(int socket, void *buffer, size_t length, int flags,
struct sockaddr *address, socklen_t *address_len) {
static ssize_t (*recvfromp)(int socket, void *buffer, size_t length,
int flags, struct sockaddr *address, socklen_t *address_len);
return sret;
}
-ssize_t recvmsg(int socket, struct msghdr *message, int flags) {
+ssize_t PROBE_NAME(recvmsg)(int socket, struct msghdr *message, int flags) {
static ssize_t (*recvmsgp)(int socket, struct msghdr *message, int flags);
ssize_t sret;
return sret;
}
-ssize_t sendmsg(int socket, const struct msghdr *message, int flags) {
+ssize_t PROBE_NAME(sendmsg)(int socket, const struct msghdr *message, int flags) {
static ssize_t (*sendmsgp)(int socket, const struct msghdr *message,
int flags);
ssize_t sret;
return sret;
}
-int getsockopt(int socket, int level, int option_name, void *option_value,
+int PROBE_NAME(getsockopt)(int socket, int level, int option_name, void *option_value,
socklen_t *option_len) {
static int (*getsockoptp)(int socket, int level, int option_name,
void *option_value, socklen_t *option_len);
return ret;
}
-int setsockopt(int socket, int level, int option_name, const void *option_value,
+int PROBE_NAME(setsockopt)(int socket, int level, int option_name, const void *option_value,
socklen_t option_len) {
static int (*setsockoptp)(int socket, int level, int option_name,
const void *option_value, socklen_t option_len);
return ret;
}
-int getpeername(int fd, struct sockaddr *addr, socklen_t *len) {
+int PROBE_NAME(getpeername)(int fd, struct sockaddr *addr, socklen_t *len) {
static int (*getpeernamep)(int s, struct sockaddr *addr, socklen_t *len);
BEFORE_ORIGINAL_SOCK(getpeername, LIBC);
return ret;
}
-int getsockname(int sockfd, struct sockaddr *addr, socklen_t *addrlen) {
+int PROBE_NAME(getsockname)(int sockfd, struct sockaddr *addr, socklen_t *addrlen) {
static int (*getsocknamep)(int sockfd, struct sockaddr *addr,
socklen_t *addrlen);
return ret;
}
-int socketpair(int domain, int type, int protocol, int socket_vector[2]) {
+int PROBE_NAME(socketpair)(int domain, int type, int protocol, int socket_vector[2]) {
static int (*socketpairp)(int domain, int type, int protocol,
int socket_vector[2]);
return ret;
}
-int sockatmark(int __fd) {
+int PROBE_NAME(sockatmark)(int __fd) {
static int (*sockatmarkp)(int __fd);
BEFORE_ORIGINAL_SOCK(sockatmark, LIBC);
return ret;
}
-int isfdtype(int __fd, int __fdtype) {
+int PROBE_NAME(isfdtype)(int __fd, int __fdtype) {
static int (*isfdtypep)(int __fd, int __fdtype);
BEFORE_ORIGINAL_SOCK(isfdtype, LIBC);
return ret;
}
-int select(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds,
+int PROBE_NAME(select)(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds,
struct timeval *timeout) {
static int (*selectp)(int nfds, fd_set *readfds, fd_set *writefds,
fd_set *exceptfds, struct timeval *timeout);
return ret;
}
-int pselect(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds,
+int PROBE_NAME(pselect)(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds,
const struct timespec *ntimeout, const sigset_t *sigmask) {
static int (*pselectp)(int nfds, fd_set *readfds, fd_set *writefds,
fd_set *exceptfds, const struct timespec *ntimeout,
return ret;
}
-int poll(struct pollfd *fds, nfds_t nfds, int timeout) {
+int PROBE_NAME(poll)(struct pollfd *fds, nfds_t nfds, int timeout) {
static int (*pollp)(struct pollfd *ufds, unsigned int nfds, int timeout);
BEFORE_ORIGINAL_SOCK(poll, LIBC);
return ret;
}
-int ppoll(struct pollfd *fds, nfds_t nfds, const struct timespec *timeout_ts,
+int PROBE_NAME(ppoll)(struct pollfd *fds, nfds_t nfds, const struct timespec *timeout_ts,
const sigset_t *sigmask) {
static int (*ppollp)(struct pollfd *fds, nfds_t nfds,
const struct timespec *timeout_ts, const sigset_t *sigmask);
return ret;
}
-int epoll_create(int __size) {
+int PROBE_NAME(epoll_create)(int __size) {
static int (*epoll_createp)(int __size);
BEFORE_ORIGINAL_SOCK(epoll_create, LIBC);
return ret;
}
-int epoll_create1(int __flags) {
+int PROBE_NAME(epoll_create1)(int __flags) {
static int (*epoll_create1p)(int __size);
BEFORE_ORIGINAL_SOCK(epoll_create1, LIBC);
return ret;
}
-int epoll_wait(int __epfd, struct epoll_event *__events, int __maxevents,
+int PROBE_NAME(epoll_wait)(int __epfd, struct epoll_event *__events, int __maxevents,
int __timeout) {
static int (*epoll_waitp)(int __epfd, struct epoll_event *__events,
int __maxevents, int __timeout);
return ret;
}
-int epoll_pwait(int __epfd, struct epoll_event *__events, int __maxevents,
+int PROBE_NAME(epoll_pwait)(int __epfd, struct epoll_event *__events, int __maxevents,
int __timeout, __const __sigset_t *__ss) {
static int (*epoll_pwaitp)(int __epfd, struct epoll_event *__events,
int __maxevents, int __timeout, __const __sigset_t *__ss);
return ret;
}
-int epoll_ctl(int __epfd, int __op, int __fd, struct epoll_event *__event) {
+int PROBE_NAME(epoll_ctl)(int __epfd, int __op, int __fd, struct epoll_event *__event) {
static int (*epoll_ctlp)(int __epfd, int __op, int __fd,
struct epoll_event *__event);
#if 0
//OPTION _//NO FD
-uint32_t htonl(uint32_t hostlong) {
+uint32_t PROBE_NAME(htonl)(uint32_t hostlong) {
static uint32_t (*htonlp)(uint32_t hostlong);
uint32_t uret;
return uret;
}
-uint16_t htons(uint16_t hostshort) {
+uint16_t PROBE_NAME(htons)(uint16_t hostshort) {
static uint16_t (*htonsp)(uint16_t hostshort);
uint16_t uret;
return uret;
}
-int inet_aton(const char *cp, struct in_addr *inp) {
+int PROBE_NAME(inet_aton)(const char *cp, struct in_addr *inp) {
static int (*inet_atonp)(const char *cp, struct in_addr *inp);
BEFORE_ORIGINAL_SOCK(inet_aton, LIBC);
return ret;
}
-in_addr_t inet_addr(const char *cp) {
+in_addr_t PROBE_NAME(inet_addr)(const char *cp) {
static in_addr_t (*inet_addrp)(const char *cp);
in_addr_t iret;
return iret;
}
-in_addr_t inet_network(const char *cp) {
+in_addr_t PROBE_NAME(inet_network)(const char *cp) {
static in_addr_t (*inet_networkp)(const char *cp);
in_addr_t iret;
return iret;
}
-char *inet_ntoa(struct in_addr in) {
+char *PROBE_NAME(inet_ntoa)(struct in_addr in) {
static char * (*inet_ntoap)(struct in_addr in);
char* sret;
return sret;
}
-uint32_t ntohl(uint32_t netlong) {
+uint32_t PROBE_NAME(ntohl)(uint32_t netlong) {
static uint32_t (*ntohlp)(uint32_t netlong);
uint32_t uret;
return uret;
}
-uint16_t ntohs(uint16_t netshort) {
+uint16_t PROBE_NAME(ntohs)(uint16_t netshort) {
static uint16_t (*ntohsp)(uint16_t netshort);
uint16_t uret;
return uret;
}
-in_addr_t inet_lnaof(struct in_addr in) {
+in_addr_t PROBE_NAME(inet_lnaof)(struct in_addr in) {
static in_addr_t (*inet_lnaofp)(struct in_addr in);
in_addr_t iret;
return iret;
}
-in_addr_t inet_netof(struct in_addr in) {
+in_addr_t PROBE_NAME(inet_netof)(struct in_addr in) {
static in_addr_t (*inet_netofp)(struct in_addr in);
in_addr_t iret;
return iret;
}
-const char *inet_ntop(int af, const void *src, char *dst, socklen_t size) {
+const char *PROBE_NAME(inet_ntop)(int af, const void *src, char *dst, socklen_t size) {
static const char* (*inet_ntopp)(int af, const void *src, char *dst,
socklen_t size);
const char* cret;
return cret;
}
-int inet_pton(int af, const char *src, void *dst) {
+int PROBE_NAME(inet_pton)(int af, const char *src, void *dst) {
static int (*inet_ptonp)(int af, const char *src, void *dst);
BEFORE_ORIGINAL_SOCK(inet_pton, LIBC);
return ret;
}
-int getaddrinfo(const char *node, const char *service,
+int PROBE_NAME(getaddrinfo)(const char *node, const char *service,
const struct addrinfo *hints, struct addrinfo **res) {
static int (*getaddrinfop)(const char *node, const char *service,
const struct addrinfo *hints, struct addrinfo **res);
return ret;
}
-void freeaddrinfo(struct addrinfo *res) {
+void PROBE_NAME(freeaddrinfo)(struct addrinfo *res) {
static void (*freeaddrinfop)(struct addrinfo *res);
BEFORE_ORIGINAL_NOFILTER(freeaddrinfo, LIBC);
info, "p", voidp_to_uint64(res));
}
-const char *gai_strerror(int errcode) {
+const char *PROBE_NAME(gai_strerror)(int errcode) {
static const char * (*gai_strerrorp)(int errcode);
const char * cret;
return cret;
}
-int gai_suspend(const struct gaicb* const list[], int nitems,
+int PROBE_NAME(gai_suspend)(const struct gaicb* const list[], int nitems,
const struct timespec *timeout) {
static int (*gai_suspendp)(const struct gaicb* const list[], int nitems,
const struct timespec *timeout);
return ret;
}
-int gai_error(struct gaicb *req) {
+int PROBE_NAME(gai_error)(struct gaicb *req) {
static int (*gai_errorp)(struct gaicb *req);
BEFORE_ORIGINAL_SOCK(gai_error, LIBC);
return ret;
}
-int gai_cancel(struct gaicb *req) {
+int PROBE_NAME(gai_cancel)(struct gaicb *req) {
static int (*gai_cancelp)(struct gaicb *req);
BEFORE_ORIGINAL_SOCK(gai_cancel, LIBC);
return ret;
}
-int getaddrinfo_a(int mode, struct gaicb *list[], int nitems,
+int PROBE_NAME(getaddrinfo_a)(int mode, struct gaicb *list[], int nitems,
struct sigevent *sevp) {
static int (*getaddrinfo_ap)(int mode, struct gaicb *list[], int nitems,
struct sigevent *sevp);
return ret;
}
-int getdomainname(char *name, size_t len) {
+int PROBE_NAME(getdomainname)(char *name, size_t len) {
static int (*getdomainnamep)(char *name, size_t len);
BEFORE_ORIGINAL_SOCK(getdomainname, LIBC);
return ret;
}
-int setdomainname(const char *name, size_t len) {
+int PROBE_NAME(setdomainname)(const char *name, size_t len) {
static int (*setdomainnamep)(const char *name, size_t len);
BEFORE_ORIGINAL_SOCK(setdomainname, LIBC);
return ret;
}
-int gethostname(char *name, size_t len) {
+int PROBE_NAME(gethostname)(char *name, size_t len) {
static int (*gethostnamep)(char *name, size_t len);
BEFORE_ORIGINAL_SOCK(gethostname, LIBC);
return ret;
}
-int sethostname(const char *name, size_t len) {
+int PROBE_NAME(sethostname)(const char *name, size_t len) {
static int (*sethostnamep)(const char *name, size_t len);
BEFORE_ORIGINAL_SOCK(sethostname, LIBC);
return ret;
}
-int getnameinfo(const struct sockaddr *sa, socklen_t salen, char *host,
+int PROBE_NAME(getnameinfo)(const struct sockaddr *sa, socklen_t salen, char *host,
socklen_t hostlen, char *serv, socklen_t servlen, unsigned int flags) {
static int (*getnameinfop)(const struct sockaddr *sa, socklen_t salen,
char *host, socklen_t hostlen, char *serv, socklen_t servlen,
return ret;
}
-struct hostent *gethostbyname(const char *name) {
+struct hostent *PROBE_NAME(gethostbyname)(const char *name) {
static struct hostent * (*gethostbynamep)(const char *name);
struct hostent* pret;
return pret;
}
-struct hostent *gethostbyaddr(const void *addr, socklen_t len, int type) {
+struct hostent *PROBE_NAME(gethostbyaddr)(const void *addr, socklen_t len, int type) {
static struct hostent * (*gethostbyaddrp)(const void *addr, socklen_t len,
int type);
struct hostent* pret;
return pret;
}
-void sethostent(int stayopen) {
+void PROBE_NAME(sethostent)(int stayopen) {
static void (*sethostentp)(int stayopen);
BEFORE_ORIGINAL_SOCK(sethostent, LIBC);
info, "d", stayopen);
}
-void endhostent(void) {
+void PROBE_NAME(endhostent)(void) {
static void (*endhostentp)(void);
BEFORE_ORIGINAL_SOCK(endhostent, LIBC);
info, "s", "");
}
-void herror(const char *s) {
+void PROBE_NAME(herror)(const char *s) {
static void (*herrorp)(const char *s);
BEFORE_ORIGINAL_SOCK(herror, LIBC);
info, "p", voidp_to_uint64(s));
}
-const char *hstrerror(int err) {
+const char *PROBE_NAME(hstrerror)(int err) {
static const char* (*hstrerrorp)(int err);
const char* cret;
return cret;
}
-struct hostent *gethostent(void) {
+struct hostent *PROBE_NAME(gethostent)(void) {
static struct hostent* (*gethostentp)(void);
struct hostent* pret;
return pret;
}
-struct hostent *gethostbyname2(const char *name, int af) {
+struct hostent *PROBE_NAME(gethostbyname2)(const char *name, int af) {
static struct hostent * (*gethostbyname2p)(const char *name, int af);
struct hostent* pret;
return pret;
}
-int gethostent_r(struct hostent *rret, char *buf, size_t buflen,
+int PROBE_NAME(gethostent_r)(struct hostent *rret, char *buf, size_t buflen,
struct hostent **result, int *h_errnop) {
static int (*gethostent_rp)(struct hostent *rret, char *buf, size_t buflen,
struct hostent **result, int *h_errnop);
return ret;
}
-int gethostbyaddr_r(const void *addr, socklen_t len, int type,
+int PROBE_NAME(gethostbyaddr_r)(const void *addr, socklen_t len, int type,
struct hostent *rret, char *buf, size_t buflen, struct hostent **result,
int *h_errnop) {
static int (*gethostbyaddr_rp)(const void *addr, socklen_t len, int type,
return ret;
}
-int gethostbyname_r(const char *name, struct hostent *rret, char *buf,
+int PROBE_NAME(gethostbyname_r)(const char *name, struct hostent *rret, char *buf,
size_t buflen, struct hostent **result, int *h_errnop) {
static int (*gethostbyname_rp)(const char *name, struct hostent *rret,
char *buf, size_t buflen, struct hostent **result, int *h_errnop);
return ret;
}
-int gethostbyname2_r(const char *name, int af, struct hostent *rret, char *buf,
+int PROBE_NAME(gethostbyname2_r)(const char *name, int af, struct hostent *rret, char *buf,
size_t buflen, struct hostent **result, int *h_errnop) {
static int (*gethostbyname2_rp)(const char *name, int af,
struct hostent *rret, char *buf, size_t buflen,
return ret;
}
-struct servent *getservbyname(const char *name, const char *proto) {
+struct servent *PROBE_NAME(getservbyname)(const char *name, const char *proto) {
static struct servent * (*getservbynamep)(const char *name,
const char *proto);
struct servent* pret;
return pret;
}
-void setservent(int stayopen) {
+void PROBE_NAME(setservent)(int stayopen) {
static void (*setserventp)(int stayopen);
BEFORE_ORIGINAL_SOCK(setservent, LIBC);
info, "d", stayopen);
}
-void endservent(void) {
+void PROBE_NAME(endservent)(void) {
static void (*endserventp)(void);
BEFORE_ORIGINAL_SOCK(endservent, LIBC);
info, "s", "");
}
-struct servent *getservent(void) {
+struct servent *PROBE_NAME(getservent)(void) {
static struct servent * (*getserventp)(void);
struct servent* pret;
return pret;
}
-struct servent *getservbyport(int port, const char *proto) {
+struct servent *PROBE_NAME(getservbyport)(int port, const char *proto) {
static struct servent * (*getservbyportp)(int port, const char *proto);
struct servent* pret;
return pret;
}
-int getservent_r(struct servent *result_buf, char *buf, size_t buflen,
+int PROBE_NAME(getservent_r)(struct servent *result_buf, char *buf, size_t buflen,
struct servent **result) {
static int (*getservent_rp)(struct servent *result_buf, char *buf,
size_t buflen, struct servent **result);
return ret;
}
-int getservbyname_r(const char *name, const char *proto,
+int PROBE_NAME(getservbyname_r)(const char *name, const char *proto,
struct servent *result_buf, char *buf, size_t buflen,
struct servent **result) {
static int (*getservbyname_rp)(const char *name, const char *proto,
return ret;
}
-int getservbyport_r(int port, const char *proto, struct servent *result_buf,
+int PROBE_NAME(getservbyport_r)(int port, const char *proto, struct servent *result_buf,
char *buf, size_t buflen, struct servent **result) {
static int (*getservbyport_rp)(int port, const char *proto,
struct servent *result_buf, char *buf, size_t buflen,
return ret;
}
-struct netent* getnetent(void) {
+struct netent* PROBE_NAME(getnetent)(void) {
static struct netent * (*getnetentp)(void);
struct netent* pret;
return pret;
}
-struct netent *getnetbyname(const char *name) {
+struct netent *PROBE_NAME(getnetbyname)(const char *name) {
static struct netent * (*getnetbynamep)(const char *name);
struct netent* pret;
return pret;
}
-struct netent *getnetbyaddr(uint32_t net, int type) {
+struct netent *PROBE_NAME(getnetbyaddr)(uint32_t net, int type) {
static struct netent * (*getnetbyaddrp)(uint32_t net, int type);
struct netent * pret;
return pret;
}
-void setnetent(int stayopen) {
+void PROBE_NAME(setnetent)(int stayopen) {
static void (*setnetentp)(int stayopen);
BEFORE_ORIGINAL_SOCK(setnetent, LIBC);
info, "d", stayopen);
}
-void endnetent(void) {
+void PROBE_NAME(endnetent)(void) {
static void (*endnetentp)(void);
BEFORE_ORIGINAL_SOCK(endnetent, LIBC);
info, "s", "");
}
-int getnetent_r(struct netent *result_buf, char *buf, size_t buflen,
+int PROBE_NAME(getnetent_r)(struct netent *result_buf, char *buf, size_t buflen,
struct netent **result, int *h_errnop) {
static int (*getnetent_rp)(struct netent *result_buf, char *buf,
size_t buflen, struct netent **result, int *h_errnop);
return ret;
}
-int getnetbyname_r(const char *name, struct netent *result_buf, char *buf,
+int PROBE_NAME(getnetbyname_r)(const char *name, struct netent *result_buf, char *buf,
size_t buflen, struct netent **result, int *h_errnop) {
static int (*getnetbyname_rp)(const char *name, struct netent *result_buf,
char *buf, size_t buflen, struct netent **result, int *h_errnop);
return ret;
}
-int getnetbyaddr_r(uint32_t net, int type, struct netent *result_buf, char *buf,
+int PROBE_NAME(getnetbyaddr_r)(uint32_t net, int type, struct netent *result_buf, char *buf,
size_t buflen, struct netent **result, int *h_errnop) {
static int (*getnetbyaddr_rp)(uint32_t net, int type,
struct netent *result_buf, char *buf, size_t buflen,
return ret;
}
-struct protoent *getprotoent(void) {
+struct protoent *PROBE_NAME(getprotoent)(void) {
static struct protoent * (*getprotoentp)(void);
struct protoent * pret;
return pret;
}
-struct protoent *getprotobyname(const char *name) {
+struct protoent *PROBE_NAME(getprotobyname)(const char *name) {
static struct protoent * (*getprotobynamep)(const char *name);
struct protoent * pret;
return pret;
}
-struct protoent *getprotobynumber(int proto) {
+struct protoent *PROBE_NAME(getprotobynumber)(int proto) {
static struct protoent * (*getprotobynumberp)(int proto);
struct protoent * pret;
return pret;
}
-void setprotoent(int stayopen) {
+void PROBE_NAME(setprotoent)(int stayopen) {
static void (*setprotoentp)(int stayopen);
BEFORE_ORIGINAL_SOCK(setprotoent, LIBC);
info, "d", stayopen);
}
-void endprotoent(void) {
+void PROBE_NAME(endprotoent)(void) {
static void (*endprotoentp)(void);
BEFORE_ORIGINAL_SOCK(endprotoent, LIBC);
info, "s", "");
}
-int getprotoent_r(struct protoent *result_buf, char *buf, size_t buflen,
+int PROBE_NAME(getprotoent_r)(struct protoent *result_buf, char *buf, size_t buflen,
struct protoent **result) {
static int (*getprotoent_rp)(struct protoent *result_buf, char *buf,
size_t buflen, struct protoent **result);
return ret;
}
-int getprotobyname_r(const char *name, struct protoent *result_buf, char *buf,
+int PROBE_NAME(getprotobyname_r)(const char *name, struct protoent *result_buf, char *buf,
size_t buflen, struct protoent **result) {
static int (*getprotobyname_rp)(const char *name,
struct protoent *result_buf, char *buf, size_t buflen,
return ret;
}
-int getprotobynumber_r(int proto, struct protoent *result_buf, char *buf,
+int PROBE_NAME(getprotobynumber_r)(int proto, struct protoent *result_buf, char *buf,
size_t buflen, struct protoent **result) {
static int (*getprotobynumber_rp)(int proto, struct protoent *result_buf,
char *buf, size_t buflen, struct protoent **result);
return ret;
}
-unsigned int if_nametoindex(__const char *__ifname) {
+unsigned int PROBE_NAME(if_nametoindex)(__const char *__ifname) {
static unsigned int (*if_nametoindexp)(__const char *__ifname);
unsigned int uret;
return uret;
}
-char *if_indextoname(unsigned int __ifindex, char *__ifname) {
+char *PROBE_NAME(if_indextoname)(unsigned int __ifindex, char *__ifname) {
static char * (*if_indextonamep)(unsigned int __ifindex, char *__ifname);
char * cret;
return cret;
}
-struct if_nameindex *if_nameindex(void) {
+struct if_nameindex *PROBE_NAME(if_nameindex)(void) {
static struct if_nameindex * (*if_nameindexp)(void);
struct if_nameindex * pret;
return pret;
}
-void if_freenameindex(struct if_nameindex *__ptr) {
+void PROBE_NAME(if_freenameindex)(struct if_nameindex *__ptr) {
static void (*if_freenameindexp)(struct if_nameindex *__ptr);
BEFORE_ORIGINAL_NOFILTER(if_freenameindex, LIBC);
info, "p", voidp_to_uint64(__ptr));
}
-int getifaddrs(struct ifaddrs **ifap) {
+int PROBE_NAME(getifaddrs)(struct ifaddrs **ifap) {
static int (*getifaddrsp)(struct ifaddrs **ifap);
BEFORE_ORIGINAL_NOFILTER(getifaddrs, LIBC);
return ret;
}
-void freeifaddrs(struct ifaddrs *ifa) {
+void PROBE_NAME(freeifaddrs)(struct ifaddrs *ifa) {
static void (*freeifaddrsp)(struct ifaddrs *ifa);
BEFORE_ORIGINAL_NOFILTER(freeifaddrs, LIBC);
//To do
-uint16_t htobe16(uint16_t host_16bits)
+uint16_t PROBE_NAME(htobe16)(uint16_t host_16bits)
{
static uint16_t (*htobe16p)(uint16_t host_16bits);
uint16_t uret;
return uret;
}
-uint16_t htole16(uint16_t host_16bits)
+uint16_t PROBE_NAME(htole16)(uint16_t host_16bits)
{
static uint16_t (*htole16p)(uint16_t host_16bits);
uint16_t uret;
return uret;
}
-uint16_t be16toh(uint16_t big_endian_16bits)
+uint16_t PROBE_NAME(be16toh)(uint16_t big_endian_16bits)
{
static uint16_t (*be16tohp)(uint16_t big_endian_16bits);
uint16_t uret;
return uret;
}
-uint16_t le16toh(uint16_t little_endian_16bits)
+uint16_t PROBE_NAME(le16toh)(uint16_t little_endian_16bits)
{
static uint16_t (*le16tohp)(uint16_t little_endian_16bits);
uint16_t uret;
return uret;
}
-uint32_t htobe32(uint32_t host_32bits)
+uint32_t PROBE_NAME(htobe32)(uint32_t host_32bits)
{
static uint32_t (*htobe32p)(uint32_t host_32bits);
uint32_t uret;
return uret;
}
-uint32_t htole32(uint32_t host_32bits)
+uint32_t PROBE_NAME(htole32)(uint32_t host_32bits)
{
static uint32_t (*htole32p)(uint32_t host_32bits);
uint32_t uret;
return uret;
}
-uint32_t be32toh(uint32_t big_endian_32bits)
+uint32_t PROBE_NAME(be32toh)(uint32_t big_endian_32bits)
{
static uint32_t (*be32tohp)(uint32_t big_endian_32bits);
uint32_t uret;
return uret;
}
-uint32_t le32toh(uint32_t little_endian_32bits)
+uint32_t PROBE_NAME(le32toh)(uint32_t little_endian_32bits)
{
static uint32_t (*le32tohp)(uint32_t little_endian_32bits);
uint32_t uret;
return uret;
}
-uint64_t htobe64(uint64_t host_64bits)
+uint64_t PROBE_NAME(htobe64)(uint64_t host_64bits)
{
static uint64_t (*htobe64p)(uint64_t host_64bits);
uint64_t uret;
return uret;
}
-uint64_t htole64(uint64_t host_64bits)
+uint64_t PROBE_NAME(htole64)(uint64_t host_64bits)
{
static uint64_t (*htole64p)(uint64_t host_64bits);
uint64_t uret;
return uret;
}
-uint64_t be64toh(uint64_t big_endian_64bits)
+uint64_t PROBE_NAME(be64toh)(uint64_t big_endian_64bits)
{
static uint64_t (*be64tohp)(uint64_t big_endian_64bits);
uint64_t uret;
return uret;
}
-uint64_t le64toh(uint64_t little_endian_64bits)
+uint64_t PROBE_NAME(le64toh)(uint64_t little_endian_64bits)
{
static uint64_t (*le64tohp)(uint64_t little_endian_64bits);
uint64_t uret;
return uret;
}
-struct in_addr inet_makeaddr(int net, int host)
+struct in_addr PROBE_NAME(inet_makeaddr)(int net, int host)
{
static struct in_addr (*inet_makeaddrp)(int net, int host);
struct in_addr iret;
#include "real_functions.h"
-int pthread_mutex_init(pthread_mutex_t *mutex,
+int PROBE_NAME(pthread_mutex_init)(pthread_mutex_t *mutex,
const pthread_mutexattr_t *attr) {
static int (*pthread_mutex_initp)(pthread_mutex_t *mutex,
const pthread_mutexattr_t *attr);
return ret;
}
-int pthread_mutex_destroy(pthread_mutex_t *mutex) {
+int PROBE_NAME(pthread_mutex_destroy)(pthread_mutex_t *mutex) {
static int (*pthread_mutex_destroyp)(pthread_mutex_t *mutex);
BEFORE_ORIGINAL_SYNC(pthread_mutex_destroy, LIBPTHREAD);
return pthread_mutex_lockp(mutex);
}
-int pthread_mutex_lock(pthread_mutex_t *mutex) {
+int PROBE_NAME(pthread_mutex_lock)(pthread_mutex_t *mutex) {
static int (*pthread_mutex_lockp)(pthread_mutex_t *mutex);
DECLARE_VARIABLE_STANDARD;
return ret;
}
-int pthread_mutex_timedlock(pthread_mutex_t *mutex,
+int PROBE_NAME(pthread_mutex_timedlock)(pthread_mutex_t *mutex,
const struct timespec *abs_timeout) {
static int (*pthread_mutex_timedlockp)(pthread_mutex_t *mutex,
const struct timespec *abs_timeout);
return ret;
}
-int pthread_mutex_trylock(pthread_mutex_t *mutex) {
+int PROBE_NAME(pthread_mutex_trylock)(pthread_mutex_t *mutex) {
static int (*pthread_mutex_trylockp)(pthread_mutex_t *mutex);
BEFORE_ORIGINAL_SYNC(pthread_mutex_trylock, LIBPTHREAD);
return pthread_mutex_unlockp(mutex);
}
-int pthread_mutex_unlock(pthread_mutex_t *mutex) {
+int PROBE_NAME(pthread_mutex_unlock)(pthread_mutex_t *mutex) {
static int (*pthread_mutex_unlockp)(pthread_mutex_t *mutex);
BEFORE_ORIGINAL_SYNC(pthread_mutex_unlock, LIBPTHREAD);
return ret;
}
-int pthread_mutexattr_init(pthread_mutexattr_t *attr) {
+int PROBE_NAME(pthread_mutexattr_init)(pthread_mutexattr_t *attr) {
static int (*pthread_mutexattr_initp)(pthread_mutexattr_t *attr);
BEFORE_ORIGINAL_SYNC(pthread_mutexattr_init, LIBPTHREAD);
return ret;
}
-int pthread_mutexattr_destroy(pthread_mutexattr_t *attr) {
+int PROBE_NAME(pthread_mutexattr_destroy)(pthread_mutexattr_t *attr) {
static int (*pthread_mutexattr_destroyp)(pthread_mutexattr_t *attr);
BEFORE_ORIGINAL_SYNC(pthread_mutexattr_destroy, LIBPTHREAD);
return ret;
}
-int pthread_mutexattr_getprioceiling(const pthread_mutexattr_t *attr,
+int PROBE_NAME(pthread_mutexattr_getprioceiling)(const pthread_mutexattr_t *attr,
int *prioceiling) {
static int (*pthread_mutexattr_getprioceilingp)(
const pthread_mutexattr_t *attr, int *prioceiling);
return ret;
}
-int pthread_mutexattr_setprioceiling(pthread_mutexattr_t *attr,
+int PROBE_NAME(pthread_mutexattr_setprioceiling)(pthread_mutexattr_t *attr,
int prioceiling) {
static int (*pthread_mutexattr_setprioceilingp)(
pthread_mutexattr_t *attr, int prioceiling);
return ret;
}
-int pthread_mutexattr_getprotocol(const pthread_mutexattr_t *attr,
+int PROBE_NAME(pthread_mutexattr_getprotocol)(const pthread_mutexattr_t *attr,
int *protocol) {
static int (*pthread_mutexattr_getprotocolp)(
const pthread_mutexattr_t *attr, int *protocol);
return ret;
}
-int pthread_mutexattr_setprotocol(pthread_mutexattr_t *attr,
+int PROBE_NAME(pthread_mutexattr_setprotocol)(pthread_mutexattr_t *attr,
int protocol) {
static int (*pthread_mutexattr_setprotocolp)(
pthread_mutexattr_t *attr, int protocol);
return ret;
}
-int pthread_mutexattr_getpshared(const pthread_mutexattr_t *attr,
+int PROBE_NAME(pthread_mutexattr_getpshared)(const pthread_mutexattr_t *attr,
int *pshared) {
static int (*pthread_mutexattr_getpsharedp)(
const pthread_mutexattr_t *attr, int *pshared);
return ret;
}
-int pthread_mutexattr_setpshared(pthread_mutexattr_t *attr,
+int PROBE_NAME(pthread_mutexattr_setpshared)(pthread_mutexattr_t *attr,
int pshared) {
static int (*pthread_mutexattr_setpsharedp)(
pthread_mutexattr_t *attr, int pshared);
return ret;
}
-int pthread_mutexattr_gettype(const pthread_mutexattr_t *attr, int *type) {
+int PROBE_NAME(pthread_mutexattr_gettype)(const pthread_mutexattr_t *attr, int *type) {
static int (*pthread_mutexattr_gettypep)(
const pthread_mutexattr_t *attr, int *type);
return ret;
}
-int pthread_mutexattr_settype(pthread_mutexattr_t *attr, int type) {
+int PROBE_NAME(pthread_mutexattr_settype)(pthread_mutexattr_t *attr, int type) {
static int (*pthread_mutexattr_settypep)(
pthread_mutexattr_t *attr, int type);
int prioceiling, int *old_ceiling);
*/
-int pthread_cond_init(pthread_cond_t *cond, const pthread_condattr_t *attr) {
+int PROBE_NAME(pthread_cond_init)(pthread_cond_t *cond, const pthread_condattr_t *attr) {
static int (*pthread_cond_initp)(pthread_cond_t *cond,
const pthread_condattr_t *attr);
return ret;
}
-int pthread_cond_destroy(pthread_cond_t *cond) {
+int PROBE_NAME(pthread_cond_destroy)(pthread_cond_t *cond) {
static int (*pthread_cond_destroyp)(pthread_cond_t *cond);
BEFORE_ORIGINAL_SYNC(pthread_cond_destroy, LIBPTHREAD);
return ret;
}
-int pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex) {
+int PROBE_NAME(pthread_cond_wait)(pthread_cond_t *cond, pthread_mutex_t *mutex) {
static int (*pthread_cond_waitp)(pthread_cond_t *cond,
pthread_mutex_t *mutex);
return ret;
}
-int pthread_cond_timedwait(pthread_cond_t *cond, pthread_mutex_t *mutex,
+int PROBE_NAME(pthread_cond_timedwait)(pthread_cond_t *cond, pthread_mutex_t *mutex,
const struct timespec *abstime) {
static int (*pthread_cond_timedwaitp)(pthread_cond_t *cond,
pthread_mutex_t *mutex, const struct timespec *abstime);
return ret;
}
-int pthread_cond_signal(pthread_cond_t *cond) {
+int PROBE_NAME(pthread_cond_signal)(pthread_cond_t *cond) {
static int (*pthread_cond_signalp)(pthread_cond_t *cond);
BEFORE_ORIGINAL_SYNC(pthread_cond_signal, LIBPTHREAD);
return ret;
}
-int pthread_cond_broadcast(pthread_cond_t *cond) {
+int PROBE_NAME(pthread_cond_broadcast)(pthread_cond_t *cond) {
static int (*pthread_cond_broadcastp)(pthread_cond_t *cond);
BEFORE_ORIGINAL_SYNC(pthread_cond_broadcast, LIBPTHREAD);
return ret;
}
-int pthread_create(pthread_t *thread, const pthread_attr_t *attr,
+int PROBE_NAME(pthread_create)(pthread_t *thread, const pthread_attr_t *attr,
void *(*start_routine) (void*), void *arg)
{
static int (*pthread_createp)(pthread_t *thread,
return ret;
}
-int pthread_join(pthread_t thread, void **retval)
+int PROBE_NAME(pthread_join)(pthread_t thread, void **retval)
{
static int (*pthread_joinp)(pthread_t thread, void **retval);
return ret;
}
-void pthread_exit(void *retval)
+void PROBE_NAME(pthread_exit)(void *retval)
{
pthread_t pSelf;
static void (*pthread_exitp)(void *retval) __attribute__((noreturn));
}
-int pthread_cancel(pthread_t thread)
+int PROBE_NAME(pthread_cancel)(pthread_t thread)
{
static int (*pthread_cancelp)(pthread_t thread);
return ret;
}
-int pthread_detach(pthread_t thread)
+int PROBE_NAME(pthread_detach)(pthread_t thread)
{
static int (*pthread_detachp)(pthread_t thread);
return ret;
}
-pthread_t pthread_self(void)
+pthread_t PROBE_NAME(pthread_self)(void)
{
pthread_t ret_pthr;
static pthread_t (*pthread_selfp)(void);
return ret_pthr;
}
-int pthread_equal(pthread_t t1, pthread_t t2)
+int PROBE_NAME(pthread_equal)(pthread_t t1, pthread_t t2)
{
static int (*pthread_equalp)(pthread_t t1, pthread_t t2);
return pthread_setcancelstatep(state, oldstate);
}
-int pthread_setcancelstate(int state, int *oldstate)
+int PROBE_NAME(pthread_setcancelstate)(int state, int *oldstate)
{
pthread_t pSelf;
static int (*pthread_setcancelstatep)(int state, int *oldstate);
return ret;
}
-int pthread_setcanceltype(int type, int *oldtype)
+int PROBE_NAME(pthread_setcanceltype)(int type, int *oldtype)
{
pthread_t pSelf;
static int (*pthread_setcanceltypep)(int type, int *oldtype);
return ret;
}
-int pthread_attr_init(pthread_attr_t *attr)
+int PROBE_NAME(pthread_attr_init)(pthread_attr_t *attr)
{
pthread_t thread = 0;
static int (*pthread_attr_initp)(pthread_attr_t *attr);
return ret;
}
-int pthread_attr_destroy(pthread_attr_t *attr)
+int PROBE_NAME(pthread_attr_destroy)(pthread_attr_t *attr)
{
pthread_t thread = 0;
static int (*pthread_attr_destroyp)(pthread_attr_t *attr);
return ret;
}
-int pthread_attr_getdetachstate(const pthread_attr_t *attr, int *detachstate)
+int PROBE_NAME(pthread_attr_getdetachstate)(const pthread_attr_t *attr, int *detachstate)
{
pthread_t thread = 0;
static int (*pthread_attr_getdetachstatep)(const pthread_attr_t *attr,
return ret;
}
-int pthread_attr_setdetachstate(pthread_attr_t *attr, int detachstate)
+int PROBE_NAME(pthread_attr_setdetachstate)(pthread_attr_t *attr, int detachstate)
{
pthread_t thread = 0;
static int (*pthread_attr_setdetachstatep)(pthread_attr_t *attr,
return ret;
}
-int pthread_attr_getstacksize(const pthread_attr_t *attr, size_t *stacksize)
+int PROBE_NAME(pthread_attr_getstacksize)(const pthread_attr_t *attr, size_t *stacksize)
{
pthread_t thread = 0;
static int (*pthread_attr_getstacksizep)(const pthread_attr_t *attr,
return ret;
}
-int pthread_attr_setstacksize(pthread_attr_t *attr, size_t stacksize)
+int PROBE_NAME(pthread_attr_setstacksize)(pthread_attr_t *attr, size_t stacksize)
{
pthread_t thread = 0;
static int (*pthread_attr_setstacksizep)(pthread_attr_t *attr,
*
* happens on pthread-2.18 (target TV emul), not happens on pthread-2.13
*/
-int pthread_attr_getstackaddr(const pthread_attr_t *attr, void **stackaddr)
+int PROBE_NAME(pthread_attr_getstackaddr)(const pthread_attr_t *attr, void **stackaddr)
{
pthread_t thread = 0;
static int (*pthread_attr_getstackaddrp)(const pthread_attr_t *attr,
return ret;
}
-int pthread_attr_setstackaddr(pthread_attr_t *attr, void *stackaddr)
+int PROBE_NAME(pthread_attr_setstackaddr)(pthread_attr_t *attr, void *stackaddr)
{
pthread_t thread = 0;
static int (*pthread_attr_setstackaddrp)(pthread_attr_t *attr,
}
#endif
-int pthread_attr_getinheritsched(const pthread_attr_t *attr, int *inheritsched)
+int PROBE_NAME(pthread_attr_getinheritsched)(const pthread_attr_t *attr, int *inheritsched)
{
pthread_t thread = 0;
static int (*pthread_attr_getinheritschedp)(const pthread_attr_t *attr,
return ret;
}
-int pthread_attr_setinheritsched(pthread_attr_t *attr, int inheritsched)
+int PROBE_NAME(pthread_attr_setinheritsched)(pthread_attr_t *attr, int inheritsched)
{
pthread_t thread = 0;
static int (*pthread_attr_setinheritschedp)(pthread_attr_t *attr,
return ret;
}
-int pthread_attr_getschedparam(const pthread_attr_t *attr,
+int PROBE_NAME(pthread_attr_getschedparam)(const pthread_attr_t *attr,
struct sched_param *param)
{
pthread_t thread = 0;
return ret;
}
-int pthread_attr_setschedparam(pthread_attr_t *attr,
+int PROBE_NAME(pthread_attr_setschedparam)(pthread_attr_t *attr,
const struct sched_param *param)
{
pthread_t thread = 0;
return ret;
}
-int pthread_attr_getschedpolicy(const pthread_attr_t *attr, int *policy)
+int PROBE_NAME(pthread_attr_getschedpolicy)(const pthread_attr_t *attr, int *policy)
{
pthread_t thread = 0;
static int (*pthread_attr_getschedpolicyp)(const pthread_attr_t *attr,
return ret;
}
-int pthread_attr_setschedpolicy(pthread_attr_t *attr, int policy)
+int PROBE_NAME(pthread_attr_setschedpolicy)(pthread_attr_t *attr, int policy)
{
pthread_t thread = 0;
static int (*pthread_attr_setschedpolicyp)(pthread_attr_t *attr,
return ret;
}
-int pthread_attr_getguardsize(const pthread_attr_t *attr, size_t *guardsize)
+int PROBE_NAME(pthread_attr_getguardsize)(const pthread_attr_t *attr, size_t *guardsize)
{
pthread_t thread = 0;
static int (*pthread_attr_getguardsizep)(const pthread_attr_t *attr,
return ret;
}
-int pthread_attr_setguardsize(pthread_attr_t *attr, size_t guardsize)
+int PROBE_NAME(pthread_attr_setguardsize)(pthread_attr_t *attr, size_t guardsize)
{
pthread_t thread = 0;
static int (*pthread_attr_setguardsizep)(pthread_attr_t *attr,
return ret;
}
-int pthread_attr_getscope(const pthread_attr_t *attr, int *contentionscope)
+int PROBE_NAME(pthread_attr_getscope)(const pthread_attr_t *attr, int *contentionscope)
{
pthread_t thread = 0;
static int (*pthread_attr_getscopep)(const pthread_attr_t *attr,
return ret;
}
-int pthread_attr_setscope(pthread_attr_t *attr, int contentionscope)
+int PROBE_NAME(pthread_attr_setscope)(pthread_attr_t *attr, int contentionscope)
{
pthread_t thread = 0;
static int (*pthread_attr_setscopep)(pthread_attr_t *attr,
return ret;
}
-int pthread_attr_getstack(const pthread_attr_t *attr,
+int PROBE_NAME(pthread_attr_getstack)(const pthread_attr_t *attr,
void **stackaddr, size_t *stacksize)
{
pthread_t thread = 0;
return ret;
}
-int pthread_attr_setstack(pthread_attr_t *attr,
+int PROBE_NAME(pthread_attr_setstack)(pthread_attr_t *attr,
void *stackaddr, size_t stacksize)
{
pthread_t thread = 0;
#include "probeinfo.h"
#include "da_ui.h"
-Evas_Object *elm_win_add(Evas_Object *parent, const char* name, Elm_Win_Type type)
+Evas_Object *PROBE_NAME(elm_win_add)(Evas_Object *parent, const char* name, Elm_Win_Type type)
{
static Evas_Object * (*elm_win_addp)(Evas_Object *parent, const char* name, Elm_Win_Type type);
return ret;
}
-Evas_Object *elm_controlbar_add (Evas_Object *parent)
+Evas_Object *PROBE_NAME(elm_controlbar_add)(Evas_Object *parent)
{
static Evas_Object * (*elm_controlbar_addp)(Evas_Object *parent);
return ret;
}
-Evas_Object *elm_naviframe_add(Evas_Object *parent)
+Evas_Object *PROBE_NAME(elm_naviframe_add)(Evas_Object *parent)
{
static Evas_Object * (*elm_naviframe_addp)(Evas_Object *parent);
return ret;
}
-Evas_Object *elm_pager_add(Evas_Object *parent)
+Evas_Object *PROBE_NAME(elm_pager_add)(Evas_Object *parent)
{
static Evas_Object * (*elm_pager_addp)(Evas_Object *parent);
import re
import os
+defines={}
def __add_item(data_dict, dict_keys, data):
""" dict_keys is supposed to be a list with length 2, where the first element is the
def __parse_file(libs_data, file):
+ defines_tag = "#define"
filename_tag = "#filename"
lib_tag = "#lib"
feature_tag = "#feature"
current_filename = ""
current_libs = []
current_feature = ""
+ current_line = 0
for line in file:
+ current_line = current_line + 1
if line == "\n":
continue
elif line[:9] == filename_tag:
current_libs = [lib_tmp]
elif line[:8] == feature_tag:
current_feature = re.sub("\"", "", line.split()[1])
+ elif line[:7] == defines_tag:
+ list = line.split()
+ if len(list) < 2 or len(list) > 3:
+ print "WARNING: Wrong string in api_names.txt +" + str(current_line) + ": <" + line + ">"
+ if len(list) != 3:
+ continue
+
+ global defines
+ print "defines[" + list[1] + "] = " + list[2]
+ defines[list[1]] = list[2]
+ elif line[:1] == "#":
+ #print "WARNING: commented code : <" + line + ">"
+ continue
else:
splitted = line.split()
if len(splitted) < 3:
- print "WARNING: Wrong string in api_names.txt : <" + line + ">"
+ print "WARNING: Wrong string in api_names.txt +" + str(current_line) + ": <" + line + ">"
continue
func = splitted[0][:-1]
- handler = splitted[1][:-1]
+ handler = defines["PROBE_NAME_PREFIX"] + splitted[1][:-1]
probe_type = splitted[2]
if len(current_libs) == 1 and (current_libs[0] == "???" or current_libs[0] == "---"):