OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [rtems/] [c/] [src/] [lib/] [libc/] [pathconf.c] - Blame information for rev 507

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 30 unneback
/*
2
 *  pathconf() - POSIX 1003.1b - 5.7.1 - Configurable Pathname Varables
3
 *
4
 *  COPYRIGHT (c) 1989-1999.
5
 *  On-Line Applications Research Corporation (OAR).
6
 *
7
 *  The license and distribution terms for this file may be
8
 *  found in the file LICENSE in this distribution or at
9
 *  http://www.OARcorp.com/rtems/license.html.
10
 *
11
 *  $Id: pathconf.c,v 1.2 2001-09-27 12:01:15 chris Exp $
12
 */
13
 
14
#include <unistd.h>
15
#include <errno.h>
16
#include <sys/types.h>
17
#include <sys/stat.h>
18
#include <fcntl.h>
19
 
20
long pathconf(
21
  const char *path,
22
  int         name
23
)
24
{
25
  int status;
26
  int fd;
27
 
28
  fd = open( path, O_RDONLY );
29
  if ( fd == -1 )
30
    return -1;
31
 
32
  status = fpathconf( fd, name );
33
 
34
  (void) close( fd );
35
 
36
  return status;
37
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.