From 4116fce6290740b1bda8d546472e2f884a35099b Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Fri, 24 Feb 2012 17:39:27 +0100 Subject: 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. --- cpukit/libfs/src/defaults/default_fdatasync.c | 21 ------------------ cpukit/libfs/src/defaults/default_fsync.c | 10 +++++---- cpukit/libfs/src/defaults/default_fsync_success.c | 26 +++++++++++++++++++++++ cpukit/libfs/src/defaults/default_handlers.c | 4 ++-- 4 files changed, 34 insertions(+), 27 deletions(-) delete mode 100644 cpukit/libfs/src/defaults/default_fdatasync.c create mode 100644 cpukit/libfs/src/defaults/default_fsync_success.c (limited to 'cpukit/libfs/src/defaults') 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 -#include -#include - -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 +#if HAVE_CONFIG_H + #include "config.h" +#endif + #include -#include -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 + * + * + * 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 + +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 }; -- cgit v1.2.3