source: rtems/c/src/lib/libc/fpathconf.c @ 7edb9281

4.104.114.84.95
Last change on this file since 7edb9281 was 73f6236, checked in by Joel Sherrill <joel.sherrill@…>, on 03/01/99 at 22:40:08

Patch from Eric Norum <eric@…> to eliminate external
IO handlers scheme that was implemented originally just to support
sockets. The file system IO switch is more general and works fine.

  • Property mode set to 100644
File size: 2.0 KB
Line 
1/*
2 *  fpathconf() - POSIX 1003.1b - 5.7.1 - Configurable Pathname Varables
3 *
4 *  COPYRIGHT (c) 1989-1998.
5 *  On-Line Applications Research Corporation (OAR).
6 *  Copyright assigned to U.S. Government, 1994.
7 *
8 *  The license and distribution terms for this file may be
9 *  found in the file LICENSE in this distribution or at
10 *  http://www.OARcorp.com/rtems/license.html.
11 *
12 *  $Id$
13 */
14
15#include "libio_.h"
16
17#include <unistd.h>
18#include <errno.h>
19
20long fpathconf(
21  int   fd,
22  int   name
23)
24{
25  long                                    return_value;
26  rtems_libio_t                          *iop;
27  rtems_filesystem_limits_and_options_t  *the_limits;
28
29  rtems_libio_check_fd(fd);
30  iop = rtems_libio_iop(fd);
31  rtems_libio_check_is_open(iop);
32  rtems_libio_check_permissions(iop, LIBIO_FLAGS_READ);
33
34  /*
35   *  Now process the information request.
36   */
37
38  the_limits = &iop->pathinfo.mt_entry->pathconf_limits_and_options;
39
40  switch ( name ) {
41    case _PC_LINK_MAX:
42      return_value = the_limits->link_max;
43      break;
44    case _PC_MAX_CANON:
45      return_value = the_limits->max_canon;
46      break;
47    case _PC_MAX_INPUT:
48      return_value = the_limits->max_input;
49      break;
50    case _PC_NAME_MAX:
51      return_value = the_limits->name_max;
52      break;
53    case _PC_PATH_MAX:
54      return_value = the_limits->path_max;
55      break;
56    case _PC_PIPE_BUF:
57      return_value = the_limits->pipe_buf;
58      break;
59    case _PC_CHOWN_RESTRICTED:
60      return_value = the_limits->posix_chown_restrictions;
61      break;
62    case _PC_NO_TRUNC:
63      return_value = the_limits->posix_no_trunc;
64      break;
65    case _PC_VDISABLE:
66      return_value = the_limits->posix_vdisable;
67      break;
68    case _PC_ASYNC_IO:
69      return_value = the_limits->posix_async_io;
70      break;
71    case _PC_PRIO_IO:
72      return_value = the_limits->posix_prio_io;
73      break;
74    case _PC_SYNC_IO:
75      return_value = the_limits->posix_sync_io;
76      break;
77    default:
78      set_errno_and_return_minus_one( EINVAL );
79      break;
80  }
81
82  return return_value;
83}
Note: See TracBrowser for help on using the repository browser.