1/* This file lists the functions that are wrapped by libtricks, their */ 2/* arguments, and the way to call them. This is then used to generate */ 3/* the wrapper functions declarations in wrapped.h, the wrapper functions */ 4/* definitions wrapdef.h (actually, only assignments of the function */ 5/* variables), the structure of wrapped functions in wrapstruct.h, */ 6/* and the temporary definitions (that hold until one of them is executed)*/ 7/* in wraptmpf.h */ 8/**/ */ 9/**/ */ 10/* each line of this file lists 4 fields, seperated by a ";". */ 11/* The first field is the name of the wrapped function, then it's return */ 12/* value. After that come the function arguments with types, and the last */ 13/* field contains the function arguments without types. */ 14/**/ 15 16/* __*xstat are used on glibc systems instead of just *xstat. */ 17/**/ 18 19WRAP_LSTAT;int;LSTAT_ARG(int ver, const char *file_name, struct stat *buf);LSTAT_ARG(ver, file_name, buf);LSTAT 20WRAP_STAT;int;STAT_ARG(int ver, const char *file_name, struct stat *buf);STAT_ARG(ver, file_name, buf);STAT 21WRAP_FSTAT;int;FSTAT_ARG(int ver, int fd, struct stat *buf);FSTAT_ARG(ver, fd, buf);FSTAT 22#ifdef HAVE_FSTATAT 23WRAP_FSTATAT;int;FSTATAT_ARG(int ver, int dir_fd, const char *path, struct stat *buf, int flags);FSTATAT_ARG(ver, dir_fd, path, buf, flags);FSTATAT 24#endif /* HAVE_FSTATAT */ 25 26#ifdef STAT64_SUPPORT 27WRAP_LSTAT64;int;LSTAT64_ARG(int ver, const char *file_name, struct stat64 *buf);LSTAT64_ARG(ver, file_name, buf);LSTAT64 28WRAP_STAT64;int;STAT64_ARG(int ver, const char *file_name, struct stat64 *buf);STAT64_ARG(ver, file_name, buf);STAT64 29WRAP_FSTAT64;int;FSTAT64_ARG(int ver, int fd, struct stat64 *buf);FSTAT64_ARG(ver, fd, buf);FSTAT64 30#ifdef HAVE_FSTATAT 31WRAP_FSTATAT64;int;FSTATAT64_ARG(int ver, int dir_fd, const char *path, struct stat64 *buf, int flags);FSTATAT64_ARG(ver, dir_fd, path, buf, flags);FSTATAT64 32#endif /* HAVE_FSTATAT */ 33#endif /* STAT64_SUPPORT */ 34 35#ifdef __APPLE__ 36#ifdef __LP64__ 37getattrlist;int;(const char *path, void *attrList, void *attrBuf, size_t attrBufSize, unsigned int options);(path, attrList, attrBuf, attrBufSize, options) 38#ifdef HAVE_FGETATTRLIST 39fgetattrlist;int;(int fd, void *attrList, void *attrBuf, size_t attrBufSize, unsigned int options);(fd, attrList, attrBuf, attrBufSize, options) 40#endif 41#else 42getattrlist;int;(const char *path, void *attrList, void *attrBuf, size_t attrBufSize, unsigned long options);(path, attrList, attrBuf, attrBufSize, options) 43#ifdef HAVE_FGETATTRLIST 44fgetattrlist;int;(int fd, void *attrList, void *attrBuf, size_t attrBufSize, unsigned long options);(fd, attrList, attrBuf, attrBufSize, options) 45#endif 46#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5 47getattrlist$UNIX2003;int;(const char *path, void *attrList, void *attrBuf, size_t attrBufSize, unsigned long options);(path, attrList, attrBuf, attrBufSize, options) 48#endif 49#endif 50#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5 51lstat$INODE64;int;(const char *file_name, struct stat *buf);(file_name, buf) 52stat$INODE64;int;(const char *file_name, struct stat *buf);(file_name, buf) 53fstat$INODE64;int;(int fd, struct stat *buf);(fd, buf) 54posix_spawn;int;(pid_t * __restrict pid, const char * __restrict path, const posix_spawn_file_actions_t *file_actions, const posix_spawnattr_t * __restrict attrp, char *const argv[ __restrict], char *const envp[ __restrict]);(pid, path, file_actions, attrp, argv, envp) 55posix_spawnp;int;(pid_t * __restrict pid, const char * __restrict path, const posix_spawn_file_actions_t *file_actions, const posix_spawnattr_t * __restrict attrp, char *const argv[ __restrict], char *const envp[ __restrict]);(pid, path, file_actions, attrp, argv, envp) 56#endif 57execve;int;(const char *path, char *const argv[], char *const envp[]);(path, argv, envp) 58execl;int;(const char *path, const char *arg0, ...) 59execle;int;(const char *path, const char *arg0, ...) 60execlp;int;(const char *path, const char *arg0, ...) 61execv;int;(const char *path, char *const argv[]);(path, argv) 62execvp;int;(const char *file, char *const argv[]);(file, argv) 63execvP;int;(const char *file, const char *search_path, char *const argv[]);(file, search_path, argv) 64#endif /* ifdef __APPLE__ */ 65 66WRAP_MKNOD;int;MKNOD_ARG(int ver, const char *pathname, mode_t mode, dev_t XMKNOD_FRTH_ARG dev);MKNOD_ARG(ver, pathname, mode, dev);MKNOD 67 68#ifdef HAVE_FSTATAT 69#ifdef HAVE_MKNODAT 70WRAP_MKNODAT;int;MKNODAT_ARG(int ver, int dir_fd, const char *pathname, mode_t mode, dev_t dev);MKNODAT_ARG(ver, dir_fd, pathname, mode, dev);MKNODAT 71#endif /* HAVE_MKNODAT */ 72#endif /* HAVE_FSTATAT */ 73 74/*opendir;DIR *;(const char *name);(name)*/ 75/*closedir;int;(DIR *dir);(dir)*/ 76/*readdir;struct dirent *;(DIR *dir);(dir)*/ 77/*readlink;READLINK_RETVAL_TYPE;(const char *path, READLINK_BUF_TYPE *buf, READLINK_BUFSIZE_TYPE bufsize);(path, buf, bufsize)*/ 78/*telldir;off_t;(DIR *dir);(dir)*/ 79 80chown;int;(const char *path, uid_t owner, gid_t group);(path, owner, group) 81lchown;int;(const char *path, uid_t owner, gid_t group);(path, owner, group) 82fchown;int;(int fd, uid_t owner, gid_t group);(fd, owner, group) 83chmod;int;(const char *path, mode_t mode);(path, mode) 84fchmod;int;(int fd, mode_t mode);(fd, mode) 85#if defined HAVE_LCHMOD 86lchmod;int;(const char *path, mode_t mode);(path, mode) 87#endif 88#if defined __APPLE__ && !defined __LP64__ 89#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5 90lchown$UNIX2003;int;(const char *path, uid_t owner, gid_t group);(path, owner, group) 91chmod$UNIX2003;int;(const char *path, mode_t mode);(path, mode) 92fchmod$UNIX2003;int;(int fd, mode_t mode);(fd, mode) 93#endif 94#endif /* if defined __APPLE__ && !defined __LP64__ */ 95mkdir;int;(const char *path, mode_t mode);(path, mode) 96unlink;int;(const char *pathname);(pathname) 97rmdir;int;(const char *pathname);(pathname) 98remove;int;(const char *pathname);(pathname) 99rename;int;(const char *oldpath, const char *newpath);(oldpath, newpath) 100/*__execve;int;(const char *path, char *const argv[], char *const envp[]);(path,argv,envp)*/ 101/*execve;int;(const char *path, char *const argv[], char *const envp[]);(path,argv,envp)*/ 102 103#ifdef FAKEROOT_FAKENET 104fork;pid_t;(void);() 105vfork;pid_t;(void);() 106close;int;(int fd);(fd) 107dup2;int;(int oldfd, int newfd);(oldfd, newfd) 108#endif /* FAKEROOT_FAKENET */ 109 110/* for fakeroot */ 111 112getuid;uid_t;(void);() 113getgid;gid_t;(void);() 114geteuid;uid_t;(void);() 115getegid;gid_t;(void);() 116setuid;int;(uid_t id);(id) 117setgid;int;(gid_t id);(id) 118seteuid;int;(uid_t id);(id) 119setegid;int;(gid_t id);(id) 120setreuid;int;(SETREUID_ARG ruid, SETREUID_ARG euid);(ruid, euid) 121setregid;int;(SETREGID_ARG rgid, SETREGID_ARG egid);(rgid, egid) 122#if defined __APPLE__ && !defined __LP64__ 123#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5 124setreuid$UNIX2003;int;(SETREUID_ARG ruid, SETREUID_ARG euid);(ruid, euid) 125setregid$UNIX2003;int;(SETREGID_ARG rgid, SETREGID_ARG egid);(rgid, egid) 126#endif 127#endif /* if defined __APPLE__ && !defined __LP64__ */ 128#ifdef HAVE_GETRESUID 129getresuid;int;(uid_t *ruid, uid_t *euid, uid_t *suid);(ruid, euid, suid) 130#endif /* HAVE_GETRESUID */ 131#ifdef HAVE_GETRESGID 132getresgid;int;(gid_t *rgid, gid_t *egid, gid_t *sgid);(rgid, egid, sgid) 133#endif /* HAVE_GETRESGID */ 134#ifdef HAVE_SETRESUID 135setresuid;int;(uid_t ruid, uid_t euid, uid_t suid);(ruid, euid, suid) 136#endif /* HAVE_SETRESUID */ 137#ifdef HAVE_SETRESGID 138setresgid;int;(gid_t rgid, gid_t egid, gid_t sgid);(rgid, egid, sgid) 139#endif /* HAVE_SETRESGID */ 140#ifdef HAVE_SETFSUID 141setfsuid;uid_t;(uid_t fsuid);(fsuid) 142#endif /* HAVE_SETFSUID */ 143#ifdef HAVE_SETFSGID 144setfsgid;gid_t;(gid_t fsgid);(fsgid) 145#endif /* HAVE_SETFSGID */ 146initgroups;int;(const char *user, INITGROUPS_SECOND_ARG group);(user, group) 147setgroups;int;(SETGROUPS_SIZE_TYPE size, const gid_t *list);(size, list) 148setpriority;int;(int which, int who, int prio);(which, who, prio) 149#ifdef HAVE_CAPSET 150capset;int;(cap_user_header_t hdrp, const cap_user_data_t datap);(hdrp, datap) 151#endif /* HAVE_CAPSET */ 152#ifdef HAVE_LISTXATTR 153listxattr; ssize_t;(const char *path, char *list, size_t size);(path, list, size) 154#endif /* HAVE_LISTXATTR */ 155#ifdef HAVE_LLISTXATTR 156llistxattr; ssize_t;(const char *path, char *list, size_t size);(path, list, size) 157#endif /* HAVE_LLISTXATTR */ 158#ifdef HAVE_FLISTXATTR 159flistxattr; ssize_t;(int fd, char *list, size_t size);(fd, list, size) 160#endif /* HAVE_FLISTXATTR */ 161#ifdef HAVE_GETXATTR 162getxattr;ssize_t;(const char *path, const char *name, void *value, size_t size);(path, name, value, size) 163#endif /* HAVE_GETXATTR */ 164#ifdef HAVE_LGETXATTR 165lgetxattr;ssize_t;(const char *path, const char *name, void *value, size_t size);(path, name, value, size) 166#endif /* HAVE_LGETXATTR */ 167#ifdef HAVE_FGETXATTR 168fgetxattr;ssize_t;(int fd, const char *name, void *value, size_t size);(fd, name, value, size) 169#endif /* HAVE_FGETXATTR */ 170#ifdef HAVE_SETXATTR 171setxattr;ssize_t;(const char *path, const char *name, void *value, size_t size, int flags);(path, name, value, size, flags) 172#endif /* HAVE_SETXATTR */ 173#ifdef HAVE_LSETXATTR 174lsetxattr;ssize_t;(const char *path, const char *name, void *value, size_t size, int flags);(path, name, value, size, flags) 175#endif /* HAVE_LSETXATTR */ 176#ifdef HAVE_FSETXATTR 177fsetxattr;ssize_t;(int fd, const char *name, void *value, size_t size, int flags);(fd, name, value, size, flags) 178#endif /* HAVE_FSETXATTR */ 179#ifdef HAVE_REMOVEXATTR 180removexattr;ssize_t;(const char *path, const char *name);(path, name) 181#endif /* HAVE_REMOVEXATTR */ 182#ifdef HAVE_LREMOVEXATTR 183lremovexattr;ssize_t;(const char *path, const char *name);(path, name) 184#endif /* HAVE_LREMOVEXATTR */ 185#ifdef HAVE_FREMOVEXATTR 186fremovexattr;ssize_t;(int fd, const char *name);(fd, name) 187#endif /* HAVE_FREMOVEXATTR */ 188 189#ifdef HAVE_FSTATAT 190#ifdef HAVE_FCHMODAT 191fchmodat;int;(int dir_fd, const char *path, mode_t mode, int flags);(dir_fd, path, mode, flags) 192#endif /* HAVE_FCHMODAT */ 193#ifdef HAVE_FCHOWNAT 194fchownat;int;(int dir_fd, const char *path, uid_t owner, gid_t group, int flags);(dir_fd, path, owner, group, flags) 195#endif /* HAVE_FCHOWNAT */ 196#ifdef HAVE_MKDIRAT 197mkdirat;int;(int dir_fd, const char *pathname, mode_t mode);(dir_fd, pathname, mode) 198#endif /* HAVE_MKDIRAT */ 199#ifdef HAVE_OPENAT 200openat;int;(int dir_fd, const char *pathname, int flags);(dir_fd, pathname, flags) 201#endif /* HAVE_OPENAT */ 202#ifdef HAVE_RENAMEAT 203renameat;int;(int olddir_fd, const char *oldpath, int newdir_fd, const char *newpath);(olddir_fd, oldpath, newdir_fd, newpath) 204#endif /* HAVE_RENAMEAT */ 205#ifdef HAVE_UNLINKAT 206unlinkat;int;(int dir_fd, const char *pathname, int flags);(dir_fd, pathname, flags) 207#endif /* HAVE_UNLINKAT */ 208#endif /* HAVE_FSTATAT */ 209 210#ifdef HAVE_ACL_T 211acl_get_fd;acl_t;(int fd);(fd) 212acl_get_file;acl_t;(const char *path_p, acl_type_t type);(path_p, type) 213acl_set_fd;int;(int fd, acl_t acl);(fd, acl) 214acl_set_file;int;(const char *path_p, acl_type_t type, acl_t acl);(path_p, type, acl) 215#endif /* HAVE_ACL_T */ 216 217#ifdef HAVE_FTS_READ 218fts_read;FTSENT *;(FTS *ftsp);(ftsp) 219#ifdef __APPLE__ 220#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5 221fts_read$INODE64;FTSENT *;(FTS *ftsp);(ftsp) 222#endif 223#endif /* ifdef __APPLE__ */ 224#endif /* HAVE_FTS_READ */ 225#ifdef HAVE_FTS_CHILDREN 226fts_children;FTSENT *;(FTS *ftsp, int options);(ftsp, options) 227#ifdef __APPLE__ 228#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5 229fts_children$INODE64;FTSENT *;(FTS *ftsp, int options);(ftsp, options) 230#endif 231#endif /* ifdef __APPLE__ */ 232#endif /* HAVE_FTS_CHILDREN */ 233 234#ifdef __sun 235sysinfo;int;(int command, char *buf, long count);(command, buf, count) 236#endif 237