[ Next Article | Previous Article | Book Contents | Library Home | Legal | Search ]
Base Operating System and Extensions Technical Reference, Volume 1

fscntl Subroutine

Purpose

Controls file system control operations.

Library

Standard C Library (libc.a)

Syntax

#include <sys/types.h>
int fscntl (vfs_id, Command, Argument,  ArgumentSize)
int vfs_id;
int Command;
char *Argument;
int ArgumentSize;

Description

The fscntl subroutine performs a variety of file system-specific functions. These functions typically require root user authority.

At present, only one file system, the Journaled File System, supports any commands via the fscntl subroutine.

Note: Application programs should not call this function, which is reserved for system management commands such as the chfs command.

Parameters

vfs_id Identifies the file system to be acted upon. This information is returned by the stat subroutine in the st_vfs field of the stat.h file.
Command Identifies the operation to be performed.
Argument Specifies a pointer to a block of file system specific information that defines how the operation is to be performed.
ArgumentSize Defines the size of the buffer pointed to by the Argument parameter.

Return Values

Upon successful completion, the fscntl subroutine returns a value of 0. Otherwise, a value of -1 is returned and the errno global variable is set to indicate the error.

Error Codes

The fscntl subroutine fails if one or both of the following are true:

EINVAL The vfs_id parameter does not identify a valid file system.
EINVAL The Command parameter is not recognized by the file system.

Implementation Specifics

This subroutine is part of Base Operating System (BOS) Runtime.

Related Information

The chfs command.

The stat.h file.

Understanding File-System Helpers in AIX Version 4.3 General Programming Concepts: Writing and Debugging Programs explains file system helpers and examines file system-helper execution syntax.


[ Next Article | Previous Article | Book Contents | Library Home | Legal | Search ]