forked from Imagelibrary/rtems
* include/chain.h, include/clockdrv.h, include/console.h, include/iosupp.h, include/rtc.h, include/spurious.h, include/timerdrv.h, include/vmeintr.h, include/motorola/mc68230.h, include/rtems/libcsupport.h, include/rtems/libio.h, include/rtems/libio_.h, include/rtems/termiostypes.h, include/sys/termios.h, include/zilog/z8036.h, include/zilog/z8530.h, include/zilog/z8536.h, src/__brk.c, src/__gettod.c, src/__sbrk.c, src/__times.c, src/access.c, src/base_fs.c, src/cfgetispeed.c, src/cfgetospeed.c, src/cfsetispeed.c, src/cfsetospeed.c, src/chdir.c, src/chmod.c, src/chown.c, src/chroot.c, src/close.c, src/ctermid.c, src/dup.c, src/dup2.c, src/eval.c, src/fchdir.c, src/fchmod.c, src/fcntl.c, src/fdatasync.c, src/fpathconf.c, src/fs_null_handlers.c, src/fstat.c, src/fsync.c, src/ftruncate.c, src/getdents.c, src/getpwent.c, src/hosterr.c, src/ioctl.c, src/isatty.c, src/libio.c, src/libio_sockets.c, src/link.c, src/lseek.c, src/lstat.c, src/malloc.c, src/mallocfreespace.c, src/mkdir.c, src/mkfifo.c, src/mknod.c, src/mount.c, src/newlibc.c, src/no_libc.c, src/no_posix.c, src/open.c, src/pathconf.c, src/pipe.c, src/privateenv.c, src/read.c, src/readlink.c, src/rewinddir.c, src/rmdir.c, src/seekdir.c, src/stat.c, src/symlink.c, src/sync.c, src/tcdrain.c, src/tcflow.c, src/tcflush.c, src/tcgetattr.c, src/tcgetprgrp.c, src/tcsendbreak.c, src/tcsetattr.c, src/tcsetpgrp.c, src/telldir.c, src/termios.c, src/termiosinitialize.c, src/truncate.c, src/umask.c, src/unixlibc.c, src/unlink.c, src/unmount.c, src/utime.c, src/write.c: URL for license changed.
88 lines
2.0 KiB
C
88 lines
2.0 KiB
C
/*
|
|
* fpathconf() - POSIX 1003.1b - 5.7.1 - Configurable Pathname Varables
|
|
*
|
|
* COPYRIGHT (c) 1989-1999.
|
|
* On-Line Applications Research Corporation (OAR).
|
|
*
|
|
* The license and distribution terms for this file may be
|
|
* found in the file LICENSE in this distribution or at
|
|
* http://www.rtems.com/license/LICENSE.
|
|
*
|
|
* $Id$
|
|
*/
|
|
|
|
#if HAVE_CONFIG_H
|
|
#include "config.h"
|
|
#endif
|
|
|
|
#include <rtems/libio_.h>
|
|
#include <rtems/seterr.h>
|
|
|
|
#include <unistd.h>
|
|
#include <errno.h>
|
|
|
|
long fpathconf(
|
|
int fd,
|
|
int name
|
|
)
|
|
{
|
|
long return_value;
|
|
rtems_libio_t *iop;
|
|
rtems_filesystem_limits_and_options_t *the_limits;
|
|
|
|
rtems_libio_check_fd(fd);
|
|
iop = rtems_libio_iop(fd);
|
|
rtems_libio_check_is_open(iop);
|
|
rtems_libio_check_permissions(iop, LIBIO_FLAGS_READ);
|
|
|
|
/*
|
|
* Now process the information request.
|
|
*/
|
|
|
|
the_limits = &iop->pathinfo.mt_entry->pathconf_limits_and_options;
|
|
|
|
switch ( name ) {
|
|
case _PC_LINK_MAX:
|
|
return_value = the_limits->link_max;
|
|
break;
|
|
case _PC_MAX_CANON:
|
|
return_value = the_limits->max_canon;
|
|
break;
|
|
case _PC_MAX_INPUT:
|
|
return_value = the_limits->max_input;
|
|
break;
|
|
case _PC_NAME_MAX:
|
|
return_value = the_limits->name_max;
|
|
break;
|
|
case _PC_PATH_MAX:
|
|
return_value = the_limits->path_max;
|
|
break;
|
|
case _PC_PIPE_BUF:
|
|
return_value = the_limits->pipe_buf;
|
|
break;
|
|
case _PC_CHOWN_RESTRICTED:
|
|
return_value = the_limits->posix_chown_restrictions;
|
|
break;
|
|
case _PC_NO_TRUNC:
|
|
return_value = the_limits->posix_no_trunc;
|
|
break;
|
|
case _PC_VDISABLE:
|
|
return_value = the_limits->posix_vdisable;
|
|
break;
|
|
case _PC_ASYNC_IO:
|
|
return_value = the_limits->posix_async_io;
|
|
break;
|
|
case _PC_PRIO_IO:
|
|
return_value = the_limits->posix_prio_io;
|
|
break;
|
|
case _PC_SYNC_IO:
|
|
return_value = the_limits->posix_sync_io;
|
|
break;
|
|
default:
|
|
rtems_set_errno_and_return_minus_one( EINVAL );
|
|
break;
|
|
}
|
|
|
|
return return_value;
|
|
}
|