1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/ossrv/genericopenlibs/openenvcore/libc/src/fchdir.cpp Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,49 @@
1.4 +/*
1.5 +* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
1.6 +* All rights reserved.
1.7 +* This component and the accompanying materials are made available
1.8 +* under the terms of "Eclipse Public License v1.0"
1.9 +* which accompanies this distribution, and is available
1.10 +* at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.11 +*
1.12 +* Initial Contributors:
1.13 +* Nokia Corporation - initial contribution.
1.14 +*
1.15 +* Contributors:
1.16 +*
1.17 +* Description: Contains the source for fchdir
1.18 + *
1.19 +*/
1.20 +
1.21 +
1.22 +#include <unistd.h>
1.23 +#include "reent.h"
1.24 +#include <stdlib.h>
1.25 +#include <errno.h>
1.26 +#include <sys/types.h>
1.27 +#include <sys/stat.h>
1.28 +#include "sysif.h"
1.29 +#include "sysreent.h"
1.30 +
1.31 +
1.32 +/*
1.33 +The fchdir() function shall be equivalent to chdir() except that
1.34 +the directory that is to be the new current working directory is
1.35 +specified by the file descriptor fildes.A conforming application
1.36 +can obtain a file descriptor for a file of type directory using
1.37 +open(), provided that the file status flags and access modes do
1.38 +not contain O_WRONLY or O_RDWR.
1.39 +
1.40 +Upon successful completion, fchdir() shall return 0. Otherwise,
1.41 +it shall return -1 and set errno to indicate the error.
1.42 +
1.43 +Calls the reentrant version of the function.
1.44 +*/
1.45 +extern "C" {
1.46 +EXPORT_C int fchdir(int filedesc)
1.47 + {
1.48 + return _fchdir_r(&errno, filedesc);
1.49 + }
1.50 +
1.51 +}
1.52 +