Added a shared memory test.

- libposix error printing now configurable via macro definition
- shmget/at/dt tested.
This commit is contained in:
Bahadir Balban
2009-05-12 18:16:25 +03:00
parent 324481a334
commit 33fcceb2b6
24 changed files with 126 additions and 76 deletions

View File

@@ -19,6 +19,7 @@
#include <l4/macros.h>
#include INC_GLUE(memory.h)
#include <shpage.h>
#include <libposix.h>
static inline int l4_fstat(int fd, void *buffer)
{
@@ -30,12 +31,12 @@ static inline int l4_fstat(int fd, void *buffer)
/* Call pager with open() request. Check ipc error. */
if ((err = l4_sendrecv(VFS_TID, VFS_TID, L4_IPC_TAG_FSTAT)) < 0) {
printf("%s: L4 IPC Error: %d.\n", __FUNCTION__, err);
print_err("%s: L4 IPC Error: %d.\n", __FUNCTION__, err);
return err;
}
/* Check if syscall itself was successful */
if ((err = l4_get_retval()) < 0) {
printf("%s: FSTAT Error: %d.\n", __FUNCTION__, err);
print_err("%s: FSTAT Error: %d.\n", __FUNCTION__, err);
return err;
}
return err;
@@ -73,13 +74,13 @@ static inline int l4_stat(const char *pathname, void *buffer)
/* Call vfs with stat() request. Check ipc error. */
if ((err = l4_sendrecv(VFS_TID, VFS_TID, L4_IPC_TAG_STAT)) < 0) {
printf("%s: L4 IPC Error: %d.\n", __FUNCTION__, err);
print_err("%s: L4 IPC Error: %d.\n", __FUNCTION__, err);
return err;
}
/* Check if syscall itself was successful */
if ((err = l4_get_retval()) < 0) {
printf("%s: STAT Error: %d.\n", __FUNCTION__, err);
print_err("%s: STAT Error: %d.\n", __FUNCTION__, err);
return err;
}