Chapter Contents

Previous

Next
pfsctl

pfsctl



Pass Command and Arguments to a Physical File System (PFS)

Portability: SAS/C extension


SYNOPSIS
DESCRIPTION
RETURN VALUE
PORTABILITY
USAGE NOTES
RELATED FUNCTIONS


SYNOPSIS

#include <sys/pfsctl.h>

int pfsctl(const char * pfs_type, int pfs_cmd, int argLength,
     void *argBuffer);


DESCRIPTION

pfsctl enables you to pass file system specific commands and arguments to a Physical File System (PFS). The meaning of the command and argument are defined by the PFS. The function is similar to w_ioctl, but directs its commands to the Physical File System rather than an individual file or device.

pfsctl accepts the following arguments:

pfs_type
is an 8-character file system type name. The pfs_type name must match a name that was specified on the TYPE operand of the FILESYSTYPE statement, or the NAME operand of a SUBFILESYSTYPE statement in the BPXPRMxx parmlib member that defined the PFS to OS/390 UNIX System Services. Alternately, the pfs_type may be set to NO_TCPSTACK_AFFINITY, which will disable affinity for a specific transport.

The following PFS types are pre-defined in pfsctl.h:

#define NO_TCPSTACK_AFFINITY  _PFS_NONE

/* Physical File Types                    
#define _PFS_NONE       "        "
#define _PFS_KERNEL     "KERNEL  "
#define _PFS_INET       "INET    "
#define _PFS_CINET      "CINET   "

pfs_cmd
is an integer that specifies a PFS-specific command that is passed to the file system. Command values less than zero are reserved by OS/390 USS. And command values less than 0x40000000 are considered to be authorized.

The following PFS commands are pre-defined in pfsctl.h:

#define PC_SETIBMOPTCMD   0xC0000005  /* Set TCP/IP Stack Affinity   */
#define PC_ADDFILE        0x80000007  /* add file to LFS File Cache  */
#define PC_DELETEFILE     0x80000008  /* del file in LFS File Cache  */
#define PC_REFRESHCACHE   0x80000009  /* refresh LFS File Cache      */
#define PC_PURGECACHE     0x8000000A  /* purge LFS File Cache        */

argLength
specifies the length in bytes of the argBuffer argument. There is no restriction on the length of the argument buffer.

argBuffer
is a pointer to the buffer that holds the arguments to be passed to and/or received from the PFS.


RETURN VALUE

If successful, depending on the PFS and the command involved, pfsctl returns the length of any returned data placed in the argument buffer.

If unsuccessful, -1 is returned and errno is set to indicate the type of error.


PORTABILITY

pfsctl is implemented only under OS/390 UNIX System Services.

The pfsctl function may be useful in OS/390 USS applications; however, it is not defined by the POSIX.1 standard and should not be used in portable applications.


USAGE NOTES

PC_SETIBMOPTCMD

This command can be used to select a particular TCP/IP stack for integrated sockets when OS/390 is configured with multiple transports for the AF_INET address family (CINET). The pfs_type must match one of the TCP/IP stack names specified in the NAME operand of a SUBFILESYSTYPE statement in the BPXPRMxx parmlib member with a TYPE operand of CINET.

The command causes all future AF_INET integrated socket calls to be associated with the chosen TCP/IP stack.

The argBuffer parameter is not used, and argLength should be 0, unless one is setting persistent address space affinity. If the argument value is one, with an argument length of 4, the chosen TCP/IP stack is persistent over job steps within a job and over UNIX process termination and re-dubbing in that address space.

The selected TCP/IP stack is inherited over fork and preserved over exec. A child process may cancel affinity by issuing the pfsctl call with a pfs_type of NO_TCPSTACK_AFFINITY.

The command may be reissued to change affinity for any future integrated sockets that are created.

The command has no effect if only one AF_INET TCP/IP stack is defined (INET). However, the command will fail if the pfs_type does not match the transport configured in the BPXPRMxx parmlib member.

PC_ADDFILE

This command can be used to add a file to the kernel file cache. Set pfs_type to KERNEL. argBuffer must contain the full pathname of the HFS file that is to be added to the LFS Cache. argLength must specify the length of the pathname. The intended usage of this command is for read-only files that are loaded into the cache at startup time.

PC_DELETEFILE

This command can be used to delete a file from the kernel file cache. Set pfs_type to KERNEL. argBuffer must contain the full pathname of the HFS file that is to be deleted in the LFS Cache. argLength must contain the length of the pathname.

PC_PURGECACHE

This command can be used to purge the kernel file cache. Set pfs_type to KERNEL. The argBuffer parameter is not used, and argLength should be 0.

PC_REFRESHCACHE

This command can be used to refresh the files in the kernel file cache. Set pfs_type to KERNEL. The argBuffer parameter is not used, and argLength should be 0. Refreshing the cache will eliminate any fragmentation in the cache dataspace.


RELATED FUNCTIONS

w_ioctl


Chapter Contents

Previous

Next

Top of Page

Copyright © 2001 by SAS Institute Inc., Cary, NC, USA. All rights reserved.