getstat_with_namespace

Retrieves selected information about file or directory, in the requested name space.

Library:LibC
Classification:Novell
Service:File and Directory I/O

Syntax

  #include <fsio.h>
   
  int getstat_with_namespace (
     NXPathCtx_t     ctx,
     const char     *path,
     struct stat    *buf,
     unsigned long   requestmap,
     int            _namespace );
  

Parameters

ctx

(IN) Specifies the file system path context. Along with the path parameter, it specifies the entry for which status is to be obtained.

path

(IN) Points to a null-terminated string that specifies the name of the entry (relative to ctx) for which status is to be obtained.

buf

(OUT) Points to the structure containing information about the file.

requestmap

(IN) Specifies a bit mask of the information to return. See Request Flags for Entry Status.

_namespace

(IN) Specifies the name space for the returned information. For a list of possible values, see Section 20.2.7, Name Space Flags.

Return Values

If successful, returns 0. Otherwise, returns -1 or one of the following errors. Unlike stat, errno is not set.

Decimal

Constant

Description

28

EIO

An I/O error occurred while reading from the file system.

81

EOVERFLOW

Either there is a value that is too large to store into the structure pointed to by the buf argument, or the file's size, its number of blocks, or its serial number cannot be stored correctly in the structure.

6

EACCES

Search permission is denied for a component of specified in path.

65

ENAMETOOLONG

The length of the path parameter exceeds {PATH_MAX} or a path component is longer than {NAME_MAX}.

1

ENOENT

A component specified in path does not name an existing file or directory, or path is an empty string.

67

ENOTDIR

A component specified in the path parameter is not a directory.

Remarks

The getstat_with_namespace function returns information in the stat structure located at the address indicated by the buf parameter. The requestmap parameter determines which fields in the stat structure return with information. The _namespace parameter determines the format of the name in the st_name field if the ST_NS_BIT is set in the requestmap parameter. The fields not requested have undefined values.

The sys/stat.h header file contains definitions for the stat structure and the fields are described in stat.

See Also