os/ossrv/genericopenlibs/openenvcore/libc/src/fchdir.cpp
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     1 /*
     2 * Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
     5 * under the terms of "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     8 *
     9 * Initial Contributors:
    10 * Nokia Corporation - initial contribution.
    11 *
    12 * Contributors:
    13 *
    14 * Description:  Contains the source for fchdir
    15  *
    16 */
    17 
    18  
    19 #include <unistd.h>
    20 #include "reent.h"
    21 #include <stdlib.h>
    22 #include <errno.h>
    23 #include <sys/types.h>
    24 #include <sys/stat.h>
    25 #include "sysif.h"
    26 #include "sysreent.h"
    27 
    28 
    29 /*
    30 The fchdir() function shall be equivalent to chdir() except that
    31 the directory that is to be the new current working directory is
    32 specified by the file descriptor fildes.A conforming application
    33 can obtain a file descriptor for a file of type directory using 
    34 open(), provided that the file status flags and access modes do 
    35 not contain O_WRONLY or O_RDWR.
    36     
    37 Upon successful completion, fchdir() shall return 0. Otherwise,
    38 it shall return -1 and set errno to indicate the error. 
    39 
    40 Calls the reentrant version of the function.
    41 */	
    42 extern "C" {
    43 EXPORT_C int fchdir(int filedesc)
    44 	{
    45 	return _fchdir_r(&errno, filedesc);
    46 	}
    47 
    48 }
    49