[ Bottom of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]

Technical Reference: Base Operating System and Extensions, Volume 1

fscntl Subroutine


Controls file system control operations.


Standard C Library (libc.a)


#include <sys/types.h>

int fscntl ( vfs_id, Command, Argument, ArgumentSize)
int vfs_id;
int Command;
char *Argument;
int ArgumentSize;


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.

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


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.

Related Information

The chfs command.

The stat.h file.

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

[ Top of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]