os/ossrv/genericopenlibs/openenvcore/libc/src/fpathconf.c
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:
    15 * Name        : fpathconf.c
    16 * Part of     : libc library
    17 * gets configurable system variables.
    18 *
    19 */
    20 
    21 
    22 
    23 #include <errno.h>
    24 #include <limits.h> //_POSIX_XXXX_XXXX
    25 #include <sys/unistd.h> //_PC_XXXX_XXXX
    26 
    27 /*
    28  * fpathconf --
    29  * get configurable system variables.
    30  *
    31 
    32  */
    33 EXPORT_C
    34 long
    35 fpathconf(int fd, int name)
    36 {
    37 	long ret = -1;
    38 	#ifdef __SYMBIAN32__
    39 	fd = fd; /*to fix the warning 'variable/argument not used in function' */
    40 	#endif //__SYMBIAN32__
    41 	switch(name) {
    42 	case _PC_LINK_MAX:
    43 		ret = _POSIX_LINK_MAX;
    44 		break;
    45 	case _PC_NAME_MAX:
    46 		ret = _POSIX_NAME_MAX;
    47 		break;
    48 	case _PC_PATH_MAX:
    49 		ret = _POSIX_PATH_MAX;
    50 		break;
    51 	case _PC_PIPE_BUF:
    52 		ret = _POSIX_PIPE_BUF;
    53 		break;
    54 	case _PC_NO_TRUNC:
    55 		ret = _POSIX_NO_TRUNC;
    56 		break;
    57 	case _PC_VDISABLE: 			//no concept of terminal
    58 	case _PC_MAX_CANON:			//no concept of terminal
    59 	case _PC_MAX_INPUT:			//no concept of terminal
    60 	case _PC_CHOWN_RESTRICTED:	//no concept of ownership
    61 		errno = ENOTSUP;
    62 		break;
    63 	default:
    64 		errno = EINVAL;
    65 		break;
    66 	}
    67 	return ret;
    68 }