forked from Imagelibrary/rtems
fstests: Initialize swapout task
This commit is contained in:
@@ -11,6 +11,9 @@
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
#include <rtems/ramdisk.h>
|
||||
#include <rtems/blkdev.h>
|
||||
#include <rtems/libio.h>
|
||||
@@ -25,6 +28,20 @@
|
||||
|
||||
dev_t dev = 0;
|
||||
|
||||
static void initialize_swapout_task(void)
|
||||
{
|
||||
int fd = open(RAMDISK_PATH, O_RDONLY);
|
||||
int rv = 0;
|
||||
|
||||
rtems_test_assert(fd >= 0);
|
||||
|
||||
rv = rtems_disk_fd_sync(fd);
|
||||
rtems_test_assert(rv == 0);
|
||||
|
||||
rv = close(fd);
|
||||
rtems_test_assert(rv == 0);
|
||||
}
|
||||
|
||||
void
|
||||
init_ramdisk (void)
|
||||
{
|
||||
@@ -36,6 +53,8 @@ init_ramdisk (void)
|
||||
false, RAMDISK_PATH, &dev);
|
||||
rtems_test_assert (rc == 0);
|
||||
|
||||
|
||||
initialize_swapout_task();
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
Reference in New Issue
Block a user