diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2012-02-24 17:39:27 +0100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2012-03-13 12:23:45 +0100 |
commit | 4116fce6290740b1bda8d546472e2f884a35099b (patch) | |
tree | e2382e483adde28c13f3ef058cf15ea44e2c532b /cpukit/libfs/src/defaults | |
parent | Filesystem: Change node type enum values (diff) | |
download | rtems-4116fce6290740b1bda8d546472e2f884a35099b.tar.bz2 |
Filesystem: New defaults fsync_h and fdatasync_h
New defaults rtems_filesystem_default_fsync_or_fdatasync() and
rtems_filesystem_default_fsync_or_fdatasync_success() for fsync_h and
fdatasync_h. The rtems_filesystem_default_fsync_or_fdatasync() sets now
errno to EINVAL according to POSIX.
Diffstat (limited to 'cpukit/libfs/src/defaults')
-rw-r--r-- | cpukit/libfs/src/defaults/default_fdatasync.c | 21 | ||||
-rw-r--r-- | cpukit/libfs/src/defaults/default_fsync.c | 10 | ||||
-rw-r--r-- | cpukit/libfs/src/defaults/default_fsync_success.c | 26 | ||||
-rw-r--r-- | cpukit/libfs/src/defaults/default_handlers.c | 4 |
4 files changed, 34 insertions, 27 deletions
diff --git a/cpukit/libfs/src/defaults/default_fdatasync.c b/cpukit/libfs/src/defaults/default_fdatasync.c deleted file mode 100644 index 90677df5c4..0000000000 --- a/cpukit/libfs/src/defaults/default_fdatasync.c +++ /dev/null @@ -1,21 +0,0 @@ -/* - * COPYRIGHT (c) 2010. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.rtems.com/license/LICENSE. - * - * $Id$ - */ - -#include <rtems/libio.h> -#include <rtems/libio_.h> -#include <rtems/seterr.h> - -int rtems_filesystem_default_fdatasync( - rtems_libio_t *iop -) -{ - rtems_set_errno_and_return_minus_one( ENOTSUP ); -} diff --git a/cpukit/libfs/src/defaults/default_fsync.c b/cpukit/libfs/src/defaults/default_fsync.c index 5cd352e9d4..d610af8ce3 100644 --- a/cpukit/libfs/src/defaults/default_fsync.c +++ b/cpukit/libfs/src/defaults/default_fsync.c @@ -9,13 +9,15 @@ * $Id$ */ -#include <rtems/libio.h> +#if HAVE_CONFIG_H + #include "config.h" +#endif + #include <rtems/libio_.h> -#include <rtems/seterr.h> -int rtems_filesystem_default_fsync( +int rtems_filesystem_default_fsync_or_fdatasync( rtems_libio_t *iop ) { - rtems_set_errno_and_return_minus_one( ENOTSUP ); + rtems_set_errno_and_return_minus_one( EINVAL ); } diff --git a/cpukit/libfs/src/defaults/default_fsync_success.c b/cpukit/libfs/src/defaults/default_fsync_success.c new file mode 100644 index 0000000000..591527e3e8 --- /dev/null +++ b/cpukit/libfs/src/defaults/default_fsync_success.c @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2012 embedded brains GmbH. All rights reserved. + * + * embedded brains GmbH + * Obere Lagerstr. 30 + * 82178 Puchheim + * Germany + * <rtems@embedded-brains.de> + * + * The license and distribution terms for this file may be + * found in the file LICENSE in this distribution or at + * http://www.rtems.com/license/LICENSE. + */ + +#if HAVE_CONFIG_H + #include "config.h" +#endif + +#include <rtems/libio_.h> + +int rtems_filesystem_default_fsync_or_fdatasync_success( + rtems_libio_t *iop +) +{ + return 0; +} diff --git a/cpukit/libfs/src/defaults/default_handlers.c b/cpukit/libfs/src/defaults/default_handlers.c index 286c2b4157..2a10a19125 100644 --- a/cpukit/libfs/src/defaults/default_handlers.c +++ b/cpukit/libfs/src/defaults/default_handlers.c @@ -30,7 +30,7 @@ const rtems_filesystem_file_handlers_r rtems_filesystem_handlers_default = { .lseek_h = rtems_filesystem_default_lseek, .fstat_h = rtems_filesystem_default_fstat, .ftruncate_h = rtems_filesystem_default_ftruncate, - .fsync_h = rtems_filesystem_default_fsync, - .fdatasync_h = rtems_filesystem_default_fdatasync, + .fsync_h = rtems_filesystem_default_fsync_or_fdatasync, + .fdatasync_h = rtems_filesystem_default_fsync_or_fdatasync, .fcntl_h = rtems_filesystem_default_fcntl }; |