git » libfiu » commit 89dcdd7

preload/posix: Add more wrapped functions

author Alberto Bertogli
2009-06-19 16:29:31 UTC
committer Alberto Bertogli
2009-06-19 17:58:43 UTC
parent f3b6280774cb7b112f7b717621eebb2c43d896e9

preload/posix: Add more wrapped functions

This time stat() and friends, fork() and friends (including the wait()
family, and kill() which is not exactly a friend but more like a love-hate
relationship), signal() and sigaction().

Signed-off-by: Alberto Bertogli <albertito@blitiri.com.ar>

preload/posix/modules/posix.io.mod +22 -0
preload/posix/modules/posix.proc.mod +41 -0

diff --git a/preload/posix/modules/posix.io.mod b/preload/posix/modules/posix.io.mod
index a01f629..23b99d4 100644
--- a/preload/posix/modules/posix.io.mod
+++ b/preload/posix/modules/posix.io.mod
@@ -84,6 +84,28 @@ int closedir(DIR *dirp);
 	valid errnos: EBADF
 
 
+fiu name base: posix/io/stat/
+
+include: <sys/types.h>
+include: <sys/stat.h>
+include: <unistd.h>
+
+int stat(const char *path, struct stat *buf);
+	on error: -1
+	valid errnos: EACCES EBADF EFAULT ELOOP ENAMETOOLONG ENOENT ENOMEM \
+		ENOTDIR EOVERFLOW
+
+int fstat(int fd, struct stat *buf);
+	on error: -1
+	valid errnos: EACCES EBADF EFAULT ELOOP ENAMETOOLONG ENOENT ENOMEM \
+		ENOTDIR EOVERFLOW
+
+int lstat(const char *path, struct stat *buf);
+	on error: -1
+	valid errnos: EACCES EBADF EFAULT ELOOP ENAMETOOLONG ENOENT ENOMEM \
+		ENOTDIR EOVERFLOW
+
+
 fiu name base: posix/io/net/
 
 int socket(int domain, int type, int protocol);
diff --git a/preload/posix/modules/posix.proc.mod b/preload/posix/modules/posix.proc.mod
new file mode 100644
index 0000000..1054513
--- /dev/null
+++ b/preload/posix/modules/posix.proc.mod
@@ -0,0 +1,41 @@
+
+include: <unistd.h>
+include: <errno.h>
+include: <sys/types.h>
+include: <sys/wait.h>
+include: <signal.h>
+
+fiu name base: posix/proc/
+
+pid_t fork(void);
+	on error: -1
+	valid errnos: EAGAIN ENOMEM
+
+pid_t wait(int *status);
+	on error: -1
+	valid errnos: ECHILD EINTR EINVAL
+
+pid_t waitpid(pid_t pid, int *status, int options);
+	on error: -1
+	valid errnos: ECHILD EINTR EINVAL
+
+int waitid(idtype_t idtype, id_t id, siginfo_t *infop, int options);
+	on error: -1
+	valid errnos: ECHILD EINTR EINVAL
+
+int kill(pid_t pid, int sig);
+	on error: -1
+	valid errnos: EINVAL EPERM ESRCH
+
+# We need to do this typedef because our parser is not smart enough to handle
+# the function definition without it
+v: typedef void (*sighandler_t)(int);
+sighandler_t signal(int signum, sighandler_t handler);
+	on error: SIG_ERR
+        valid errnos: EINVAL
+
+int sigaction(int signum, const struct sigaction *act, \
+		struct sigaction *oldact);
+	on error: -1
+	valid errnos: EFAULT EINVAL
+