cvs.delorie.com/djgpp/doc/libc/libc_612.html   search  
libc.a reference

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

pathconf

Syntax

 
#include <unistd.h>

long pathconf(const char *filename, int name);

Description

This function returns various system-dependent configuration values. The name is one of the following:

_PC_LINK_MAX

The maximum number of directory entries that can refer to a single real file. Always 1 in DJGPP.

_PC_MAX_CANON

The maximum number of bytes in an editable input line. In DJGPP, this is 126 (DOS restriction).

_PC_MAX_INPUT

The maximum number of bytes in a non-editable input line. Also 126 in DJGPP.

_PC_NAME_MAX

The maximum length of an individual file name. If the filesystem where filename resides supports long file names, the result is whatever _get_volume_info returns (usually 255); otherwise 12 will be returned. See section _use_lfn.

_PC_PATH_MAX

The maximum length of a complete path name. If the filesystem where filename resides supports long file names, the result is whatever _get_volume_info returns (usually 260); otherwise 80 will be returned. See section _use_lfn.

_PC_PIPE_BUF

The size of a pipe's internal buffer. In DJGPP, this returns 512.

_PC_CHOWN_RESTRICTED

If non-zero, only priviledged user can change the ownership of files by calling chown, otherwise anyone may give away files. The DJGPP version always returns zero, since MS-DOS files can be freely given away.

_PC_NO_TRUNC

If zero is returned, filenames longer than what pathconf (filename, _PC_NAME_MAX) returns are truncated, otherwise an error occurs if you use longer names. In DJGPP, this returns 0, since DOS always silently truncates long names.

_PC_VDISABLE

A character to use to disable tty special characters. DJGPP currently doesn't support special characters, so this returns -1.

Return Value

The selected configuration value is returned.

Portability

ANSI/ISO C No
POSIX 1003.2-1992; 1003.1-2001

Example

 
char *buf = malloc(pathconf("c:/", _PC_MAX_PATH)+1);


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

  webmaster     delorie software   privacy  
  Copyright © 2004     Updated Apr 2004