sl@0: // Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // Name : fdatasync.cpp sl@0: // Part of : LIBC sl@0: // Contains the source for fchdir sl@0: // Version : 1.0 sl@0: // sl@0: sl@0: sl@0: sl@0: #include sl@0: sl@0: /* sl@0: The fdatasync() function shall force all currently queued I/O operations associated sl@0: with the file indicated by file descriptor fildes to the synchronized I/O completion sl@0: state.The functionality shall be equivalent to fsync() with the symbol -> sl@0: _POSIX_SYNCHRONIZED_IO defined, with the exception that all I/O operations shall be sl@0: completed as defined for synchronized I/O data integrity completion.If successful, sl@0: the fdatasync() function shall return the value 0; otherwise, the function shall sl@0: return the value -1 and set errno to indicate the error. sl@0: */ sl@0: sl@0: extern "C" { sl@0: sl@0: EXPORT_C int fdatasync(int filedesc) sl@0: { sl@0: int retVal = -1; sl@0: #ifndef _POSIX_SYNCHRONIZED_IO sl@0: #define _POSIX_SYNCHRONIZED_IO sl@0: #define FLAG_FOR_FSYNC 1 sl@0: #endif sl@0: //Calls fsync that provides equivalent functionality. sl@0: retVal = fsync(filedesc); sl@0: sl@0: #ifdef FLAG_FOR_FSYNC sl@0: #undef _POSIX_SYNCHRONIZED_IO; sl@0: #undef FLAG_FOR_FSYNC sl@0: #endif sl@0: sl@0: return retVal; sl@0: } sl@0: sl@0: } //extern "C" sl@0: