www.delorie.com/gnu/docs/glibc/libc_652.html   search  
Buy the book!

The GNU C Library

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

31.6 Limits on File System Capacity

The POSIX.1 standard specifies a number of parameters that describe the limitations of the file system. It's possible for the system to have a fixed, uniform limit for a parameter, but this isn't the usual case. On most systems, it's possible for different file systems (and, for some parameters, even different files) to have different maximum limits. For example, this is very likely if you use NFS to mount some of the file systems from other machines.

Each of the following macros is defined in `limits.h' only if the system has a fixed, uniform limit for the parameter in question. If the system allows different file systems or files to have different limits, then the macro is undefined; use pathconf or fpathconf to find out the limit that applies to a particular file. See section 31.9 Using pathconf.

Each parameter also has another macro, with a name starting with `_POSIX', which gives the lowest value that the limit is allowed to have on any POSIX system. See section 31.8 Minimum Values for File System Limits.

Macro: int LINK_MAX
The uniform system limit (if any) for the number of names for a given file. See section 14.4 Hard Links.

Macro: int MAX_CANON
The uniform system limit (if any) for the amount of text in a line of input when input editing is enabled. See section 17.3 Two Styles of Input: Canonical or Not.

Macro: int MAX_INPUT
The uniform system limit (if any) for the total number of characters typed ahead as input. See section 17.2 I/O Queues.

Macro: int NAME_MAX
The uniform system limit (if any) for the length of a file name component.

Macro: int PATH_MAX
The uniform system limit (if any) for the length of an entire file name (that is, the argument given to system calls such as open).

Macro: int PIPE_BUF
The uniform system limit (if any) for the number of bytes that can be written atomically to a pipe. If multiple processes are writing to the same pipe simultaneously, output from different processes might be interleaved in chunks of this size. See section 15. Pipes and FIFOs.

These are alternative macro names for some of the same information.

Macro: int MAXNAMLEN
This is the BSD name for NAME_MAX. It is defined in `dirent.h'.

The value of this macro is an integer constant expression that represents the maximum length of a file name string. It is defined in `stdio.h'.

Unlike PATH_MAX, this macro is defined even if there is no actual limit imposed. In such a case, its value is typically a very large number. This is always the case on the GNU system.

Usage Note: Don't use FILENAME_MAX as the size of an array in which to store a file name! You can't possibly make an array that big! Use dynamic allocation (see section 3.2 Allocating Storage For Program Data) instead.

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

  webmaster     delorie software   privacy  
  Copyright 2003   by The Free Software Foundation     Updated Jun 2003