/*****START OF SPECIFICATIONS****************************************
*
* $MAC (BPXYVFSI) COMP(SCPX4) PROD(FOM):
*
*01* MACRO NAME: BPXYVFSI
*
*01* DSECT NAME: N/A
*
*01* DESCRIPTIVE NAME: Virtual File System Interface Definition for C
*
*02* ACRONYM: N/A
* */
/*01* PROPRIETARY STATEMENT= */
/***PROPRIETARY_STATEMENT********************************************/
/* */
/* */
/* LICENSED MATERIALS - PROPERTY OF IBM */
/* 5650-ZOS COPYRIGHT IBM CORP. 1993, 2013 */
/* */
/* STATUS= HBB7790 */
/* */
/***END_OF_PROPRIETARY_STATEMENT*************************************/
/*
*01* EXTERNAL CLASSIFICATION: GUPI
*01* END OF EXTERNAL CLASSIFICATION:
*
*01* FUNCTION: Provide a C language header file for the VFS Callable
* Services Interface.
*
* Defines C structures for the control blocks and tokens that
* are used with the v_ (BPX1V) Callable Services.
*
* Defines C prototypes and macros for the Callable Services.
* The macros make use of the callable services vector tables
* so that the caller does not have to be statically bound
* to the services or to their stubs.
* The callable services may be invoked by either their official
* names or by C-friendly names, i.e. as bpx1vgt() or v_get().
*
* The following structures are defined here:
*
* Common structures used on both the VFS and PFS interfaces.
* ----------------------------------------------------------
* GTOK - General Eight Byte Token
* FID - File Identifier
* CBHDR - General Control Block Header
* ATTR - File Attribute Structure
* UIO - User I/O Structure
* DIRENT - Directory Entries for v_readdir/vn_readdir.
* FSATTR - File System Attributes of v_fstatfs/vfs_statfs
*
* Structures specific to the VFS interface.
* -----------------------------------------
* VFSTOK & VNTOK - Opaque Tokens for file systems and files.
* OSS - Operating System Specific Information Structure
* RPNMNTE - Mount Entry Structures returned by v_rpn.
* NREG - Registration Parameter Block used with v_reg
* VLOCK - Byte Range Locking Structure for v_lockctl.
*
*
* Conditional Processing is controlled by the following symbols:
*
* _NOFCNTL - suppresses the inclusion of fcntl.h
*
* To suppress the inclusion of fcntl.h #define _NOFCNTL
* and do one of the following before you include this header:
*
* (1) If you are not going to call v_lockctl:
*
* #define FLOCK char - to provide a dummy type for vl_flock
* or
*
* (2) If you will call v_lockctl
*
* #define or typedef FLOCK to your program's flock struct
*
*
* _BPX_MNTE2 - Produces Version 2 of the Mount Entry @P5A
*
*
* _BPXLL - converts the following fields from (Highword,LowWord)
* pairs into a single 8-byte long long data type: @P5A
*
* at_size
* at_blocks
* u_offset
* u_fssizelimit
* fs_maxfilesize
* me_bytesread
* me_byteswritten
*
*
* _BPXRTL_VFSI - Makes adjustments necessary for the RTL. @P7A
*
* _LP64 - Makes the UIO and ATTR compatable with LP64 @P7A
*
* __XPLINK__ - Makes the V_XXXX Linkages OS_UPSTACK @P7A
*
*
*
* Structures that are input to the services must be initialized
* prior to being passed on the calls.
* This means that the id and length fields are set correctly
* and that unused fields are zero.
*
* Macros are provided for initializing these structures
* in two ways:
*
* (1) For each potential input structure, XXX, there is an XXX_HDR
* macro defined that can be used to initialize the header and
* zero out the rest of the structure when the local copy
* is declared. For example:
*
* ATTR attr2 = { ATTR_HDR };
*
*
* (2) The CBINIT macro can be used to initialize an area after
* it has been declared. For example:
*
* struct { int abc;
* UIO uio2;
* ATTR attr2;
* int def;
* } area2;
* ...
*
* CBINIT(area2.uio2,UIO);
*
*
*******************************************************************
*
*01* METHOD OF ACCESS:
*
*02* C/370:
*
* #include <bpxyvfsi.h>
*
*02* PL/X:
*
* None
*
*02* ASM:
*
* None
*
*
*01* DEPENDENCIES: Changes to the macros listed below must be reflected
* in the corresponding structures of this header.
*
*01* NOTES:
*
* This header file is consistent with the following mappings:
*
* BPXYATTR
* BPXYDIRE
* BPXYFUIO
* BPXYMNTE
* BPXYNREG
* BPXYOSS
* BPXYSSTF
* BPXYVLOK
*
*01* COMPONENT: OpenMVS (SCPX4)
*
*01* DISTRIBUTION LIBRARY: AFOMHDR1
*
*01* CHANGE-ACTIVITY:
****END OF SPECIFICATIONS*********************************************/
#ifndef __BPXYVFSI_Common
#define __BPXYVFSI_Common
/********************************************************************/
/********************************************************************/
/** **/
/** Common structures used on both the VFS and PFS interfaces. **/
/** **/
/********************************************************************/
/********************************************************************/
/*------------------------------------------------------------------*/
/* Deal with gratuitous longs 7@DVA*/
/* For compatibility with 31-bit apps, they stay as longs. */
/* For 64-bit apps, they get converted to ints. */
/* In common section because they are in both PFSI and VFSI. */
/*------------------------------------------------------------------*/
#ifdef _LP64
typedef int BPXL32 ;
typedef unsigned int BPXUL32 ;
#else
typedef long BPXL32 ;
typedef unsigned long BPXUL32 ;
#endif
/*------------------------------------------------------------------*/
/* Set up for 64-bit addressing and pack the structures 6@DVA*/
/*------------------------------------------------------------------*/
#ifdef _LP64
#define _PTR32 __ptr32
#pragma pack(1)
#else
#define _PTR32
#endif
/*------------------------------------------------------------------*/
/* Opaque Tokens */
/*------------------------------------------------------------------*/
typedef struct s_gtok { /* General Eight Byte Token */
#ifdef _LP64
void *gtok[1]; /* @DVA*/
#else
void *gtok[2];
#endif
} GTOK ;
typedef struct s_fid { /* File Identifier */
int fid[2]; /* PFS Specific values */
} FID ;
/*------------------------------------------------------------------*/
/* General Control Block Header and Typedef for BIT */
/*------------------------------------------------------------------*/
typedef struct s_cbhdr {
char cbid[4]; /* Eye catcher */
int cblen; /* Length */
} CBHDR;
typedef unsigned int BIT;
/*------------------------------------------------------------------*/
/* ATTR - File Attribute Structure (BPXYATTR)*/
/* */
/* File types and permissions of at_mode are defined in modes.h. */
/* Audit bits of at_aaudit & at_uaudit are defined in stat.h. */
/*------------------------------------------------------------------*/
#ifdef _BPXLL
typedef _Packed struct s_attr {
#else
typedef struct s_attr {
#endif
CBHDR at_hdr;
/* POSIX fields */
int at_mode; /* Type & Permissions st_mode */
int at_ino; /* inode number st_ino */
int at_dev; /* device number st_dev */
int at_nlink; /* link count st_nlink*/
int at_uid; /* uid of owner st_uid */
int at_gid; /* group id of owner st_gid */
#ifdef _BPXLL
long long at_size;
#else
int at_sizeh; /* file size (high word) */
int at_size; /* file size st_size */
#endif
int at_atime; /* last access time st_atime*/
int at_mtime; /* last modified time st_mtime*/
int at_ctime; /* status change time st_ctime*/
/* OE Extensions */
int at_major; /* Major number for char spec */
int at_minor; /* Minor number for char spec */
int at_aaudit; /* auditor audit info */
int at_uaudit; /* user audit info */
int at_blksize; /* File block size */
int at_createtime; /* File Creation time */
union { /*@DFA*/
char AT_auditid[16]; /* SAF Audit ID */
struct { /* Guard Time Value: @DFA*/
int sec; /* Seconds @DFA*/
int msec; /* Micro-seconds @DFA*/
} AT_guardtime; /*@DFA*/
char AT_cver[8]; /* Creation Verifier @DFA*/
/* See below for non-union names @DFA*/
} at_u1; /*@DFA*/
char rsvd1[4];
int at_genmask; /* Setgen Mask */
/* SetAttr Change Flags: */
BIT at_modechg :1; /* to mode indicated */
BIT at_ownchg :1; /* to UID indicated */
BIT at_setgen :1; /* to General Attr flags */
BIT at_trunc :1; /* truncate size */
BIT at_atimechg :1; /* the Atime */
BIT at_atimeTOD :1; /* Atime to TOD */
BIT at_mtimechg :1; /* the Mtime */
BIT at_mtimeTOD :1; /* Mtime to TOD */
BIT at_aauditchg :1; /* auditor audit info */
BIT at_uauditchg :1; /* user audit info */
BIT at_ctimechg :1; /* the Ctime */
BIT at_ctimeTOD :1; /* Ctime to TOD */
BIT at_reftimechg :1; /* Reference time change */
BIT at_refTOD :1; /* Reference time to TOD */
BIT at_filefmtchg :1; /* File format change @DAA*/
BIT at_guardtimechk :1; /* Guard Time Check @DFA*/
BIT at_cverset :1; /* Creation Ver Set @DFA*/
BIT at_charsetidchg :1; /* Change File Info @DNA*/
BIT at_lp64times :1; /* 64-bit fields used @P7A*/
BIT at_seclabelchg :1; /* change seclabel @DQA*/
BIT :12;
#ifdef _BPXRTL_VFSI /*@P7A*/
struct file_tag at_filetag; /* Ccsid and TxtFlag @P7A*/
char at_charsetid[8]; /* (Not used) @P7C*/
#else /*@P7A*/
char at_charsetid[12]; /* CharSetId */
/* First 4 bytes of CharSetId is the FileTag */
#endif /*@P7A*/
#ifdef _BPXLL
long long at_blocks;
#else
int at_blocksh; /* blocks allocated (high word)*/
int at_blocks; /* blocks allocated */
#endif
int at_genvalue; /* General Attribute Flags */
int at_reftime; /* Reference Time */
FID at_fid; /* File FID */
char at_filefmt; /* File format @DAA*/
char at_fspflag2; /* Fsp flag2 w/acl flags @DOA*/
char rsvd2[02]; /* @DOC*/
int at_ctimemsec; /* Micro-seconds of Ctime @DFA*/
char at_seclabel[8]; /* security label @DOA*/
char rsvd3[4]; /* @DOC*/
/* +A0 --- End Ver 1 --- @P5A*/
char at_atime64[8]; /* Large Time Fields @P5A*/
char at_mtime64[8]; /*@P5A*/
char at_ctime64[8]; /*@P5A*/
char at_createtime64[8]; /*@P5A*/
char at_reftime64[8]; /*@P5A*/
char at_rsvd4[8]; /*@P5A*/
char at_rsvd5[16]; /*@P5A*/
/* +E0 --- End Ver 2 --- @P5A*/
} ATTR ;
#define ATTR_ID "ATTR"
#define ATTR_HDR {{ATTR_ID}, sizeof(ATTR)}
/* Field names without the union qualifiers @DFA*/
#define at_auditid at_u1.AT_auditid /*@DFA*/
#define at_guardtime at_u1.AT_guardtime /*@DFA*/
#define at_cver at_u1.AT_cver /*@DFA*/
/*----------------------------------------------------*/
/* FSP Flag2 (ACL) constants */
/*------------------------------------------------@DOA*/
#define ATTR_ACCESS_ACL 128 /* access acl exists @DOA*/
#define ATTR_FMODEL_ACL 64 /* file model acl exists @DOA*/
#define ATTR_DMODEL_ACL 32 /* dir model acl exists @DOA*/
/*----------------------------------------------------*/
/* File Format Type Constants */
/*------------------------------------------------@DAA*/
#define ATTR_FFNA 0 /* Not specified */
#define ATTR_FFBinary 1 /* Binary data */
/* Text data delimiters: */
#define ATTR_FFNL 2 /* New Line */
#define ATTR_FFCR 3 /* Carrage Return */
#define ATTR_FFLF 4 /* Line Feed */
#define ATTR_FFCRLF 5 /* CR & LF */
#define ATTR_FFLFCR 6 /* LF & CR */
#define ATTR_FFCRNL 7 /* CR & NL */
/* Data consists of Records: */
#define ATTR_FFRECORD 8 /* Records @DZA*/
/*---------------------------------------------- 7@DGA*/
/* genvalue Constants -- use for ATTR or any other */
/* structures with genvalue */
/*----------------------------------------------------*/
#define GENVAL_PROGCTL 2 /* file can be program controlled */
#define GENVAL_APF 4 /* file can be APF authorized */
#define GENVAL_NOSHRAS 8 /* file cannot run in a shared AS */
#define GENVAL_NODELFILES 32 /* files are not to be deleted from
this directory @P4A*/
/*--------------------------------------------------------------*/
/* The macro below tests the at_mode and at_genvalue fields */
/* to see if the file is an External Symbolic Link. */
/*--------------------------------------------------------------*/
#ifndef S_IFEXTL
#define S_IFEXTL 0x00000001 /* External Link in at_genvalue */
#define S_ISEXTL(m,gv) ( S_ISLNK(m) && ((gv) & S_IFEXTL) )
#endif
/*--------------------------------------------------------------*/
/* Vfs_Token and/or Mount Point Inode Number that may be @PBA*/
/* returned by v_lookup, v_readdir, and v_getattr. */
/* */
/* These are placed in the 12 byte at_charsetid field and */
/* can be extracted as follows: */
/* ATTR *A; given an attr structure */
/* struct at_vinfo *AV; define a ptr to at_vinfo */
/* unsigned int MtPtInodNum; area to put Inode number */
/* unsigned int MtPtDevno; area to put Devno */
/* VFSTOK VT; area to put vfs token */
/* */
/* AV = (struct at_vinfo *)(&A->at_charsetid); */
/* */
/* For v_lookup and v_readdir the Vfs Token can be gotten with: */
/* memcpy(&VT,&AV->at_vfstok,sizeof(VT)); */
/* */
/* For v_readdir and v_getattr to get the Mount Point Ino: */
/* MtPtInodNum = AV->at_vmtptino; */
/* */
/* For v_getattr to get the Mount Point's Devno: */
/* MtPtDevno = (unsigned int)(AV->at_vfstok.gtok[1]); */
/* */
/*--------------------------------------------------------------*/
struct at_vinfo { /* Cross Mount Point Info @PBA*/
GTOK at_vfstok; /* Cross MtPt Vfs Tok @PBA*/
unsigned int at_vmtptino; /* Root's MtPt's Ino @PBA*/
};
/*------------------------------------------------------------------*/
/* UIO - User I/O Structure (BPXYFUIO)*/
/* */
/* For 31-Bit addresses: u_buffaddr points to the buffer */
/* */
/* For 64-Bit addresses: u_addr64 is on and */
/* u_buff64vaddr points to the buffer */
/* */
/*------------------------------------------------------------------*/
typedef struct s_uio {
CBHDR u_hdr;
/* u_buffaddr64 (Real) @DMA*/
#ifndef _LP64 /*@P7A*/
char *u_buffaddr; /* Buffer 31-bit address */
#else /*@P7A*/
char u_buffaddr[4]; /*@P7A*/
#endif /*@P7A*/
int u_buffalet; /* Alet for Buffer Address */
#ifdef _BPXLL
long long u_offset;
#else
#ifndef _LP64 /*@P7A*/
int u_offseth; /* Cursor (high word) */
int u_offset; /* Cursor */
#else /*@P7A*/
off_t u_offset; /*@P7A*/
#endif /*@P7A*/
#endif
int u_count; /* Number of bytes */
short u_asid; /* Addr Space ID: set by LFS */
BIT u_rw :1; /* 0=Read, 1=Write */
BIT u_key :4; /* Storage Key: set by LFS */
BIT u_sync :1; /* Sync data on write */
BIT u_syncd :1; /* Sync was done: LFS/PFS only*/
BIT u_chkacc :1; /* Perform Access check */
BIT u_realpage :1; /* u_buffaddr -> real page @D4A*/
BIT u_limitex :1; /* File size limit exceeded
@D6A*/
BIT u_iovinuio :1; /* uio buff is an iov @D9A*/
BIT u_shutd :1; /* do shutdown after send @DMA*/
BIT u_addr64 :1; /* 64-Bit Addressing @DMA*/
BIT u_seekcur :1; /* For pread/pwrite @P5A*/
BIT :2; /* Reserved @D6C*/
union { /* Vnop Specific Fields: */
int u_rdindex; /* Readdir Index */
int u_iovalet; /* Sendmsg/Recvmsg IOV's ALET */
} u_vs; /* */
union { /* Vnop Specific Fields2: @DFA*/
int U_rddflags; /* Readdir Flags @DFA*/
int U_iovbufalet; /* IOV's Buffer's ALET @DFC*/
/* See below for non-union names @DFA*/
} u_vs2; /*@DFA*/
#ifndef _BPXLL
int u_fssizelimithw; /* filesize limit hiword @D6A*/
int u_fssizelimitlw; /* filesize limit loword @D6A*/
#else
long long u_fssizelimit;
#endif
union { /* Vnop Specific Fields3: @DFA*/
char U_cver[8]; /* Readdir Cookie Verifier@DFA*/
char u_internal[16]; /* Internal fields @D9A*/
/* See below for non-union names @DFA*/
} u_vs3; /*@DFA*/
int u_iovresidualcnt; /* remaining bytes to be moved
@D9A*/
int u_totalbytesrw; /* total number of bytes to be
moved @D9A*/
#ifndef _LP64 /*@P7A*/
char u_buff64vaddr[8]; /* 64-Bit Virtual Addr @P5A*/
#else /*@P7A*/
char *u_buff64vaddr; /*@P7A*/
#endif /*@P7A*/
} UIO ;
/* Field names w/o the union qualifier @DFA*/
#define u_iovbufalet u_vs2.U_iovbufalet /*@DFA*/
#define u_rddflags u_vs2.U_rddflags /*@DFA*/
#define u_cver u_vs3.U_cver /*@DFA*/
/* u_rddflags - Readdir/ReaddirPlus Flags @DFA*/
#define FUIORETCURSOR 4 /* Return cursor in dirents @E1A*/
#define FUIOCVERRET 2 /* Cookie Ver being Returned @DFA*/
#define FUIORDDPLUS 1 /* ReaddirPlus requested @DFA*/
#define UIO_ID "FUIO"
#define UIO_HDR {{UIO_ID}, sizeof(UIO)}
#ifdef _BPXLL
#define UIO_NONEWFILES 0x8000000000000000LL
#else
#define UIO_NONEWFILES 0x80000000 /* No new files
can be created @D6A*/
#endif
/*------------------------------------------------------------------*/
/* DIRENT - Directory Entries for v_readdir/vn_readdir. (BPXYDIRE)*/
/* */
/* Entry Extension */
/* ---- ---- ------//-------- -------- ------- */
/* | TL | NL | name | Ino | | */
/* ---- ---- ------//-------- -------- ------- */
/* 0 2 4 4+NL 8+NL TL */
/* */
/* The Extension may not be returned by all PFSes. */
/* */
/* When (u_rddflags & FUIORDDPLUS) == FUIORDDPLUS @DFA*/
/* the directory entries look like: @DFA*/
/* @DFA*/
/* ---- ---- ------//-------- ------------------------- @DFA*/
/* | TL | NL | name | Attributes | @DFA*/
/* ---- ---- ------//-------- ------------------------- @DFA*/
/* 0 2 4 4+NL TL @DFA*/
/* */
/* When (u_rddflags & FUIORETCURSOR) == FUIORETCURSOR @E1A*/
/* the directory entries look like: */
/* */
/* ---- ---- ------//-------- ------------------------- */
/* | TL | NL | name | ino | cursor | */
/* ---- ---- ------//-------- ------------------------- */
/* 0 2 4 4+NL 8+NL TL */
/* */
/*------------------------------------------------------------------*/
typedef struct s_dirent { /* Directory Entry */
short dir_len; /* Total entry length */
short dir_namelen; /* Name length */
char dir_name[1]; /* File name, 1-255 bytes */
} DIRENT ;
typedef struct s_dirext { /* Directory Extension */
int dir_ino; /* File Ino number */
union {
char DIR_other[1]; /* PFS specific data */
char DIR_cursor[8]; /* cursor @E1A*/
} dir_u1;
} DIREXT;
/* Field names without the union qualifiers */
#define dir_other dir_u1.DIR_other /* @E1A*/
#define dir_cursor dir_u1.DIR_cursor /* @E1A*/
/* The dir_name field is of variable length.
|
| Given the following two pointers:
| DIRENT *dp;
| DIREXT *dx;
|
| To move from one entry to the next:
|
| dp = (DIRENT *) ((int)dp + dp->dir_len);
|
| To copy the name field to a standard C string buffer:
|
| memcpy(dp->dir_name, name, dp->dir_namelen);
| name[dp->dir_namelen] = '\0';
|
| To address the optional extension structure:
|
| if ((dp->dir_len) > (4 + dp->dir_namelen)) {
|
| dx = (DIREXT *) ((int)dp + 4 + dp->dir_namelen);
|
| ino = dx->dir_ino;
| }
| else
| ino = 0;
|
| To address the readdirplus attributes: @DFA
| @DFA
| ATTR *da; @DFA
| @DFA
| da = (ATTR *) ((int)dp + 4 + dp->dir_namelen); @DFA
| ino = da->at_ino; @DFA
|
*/
/*------------------------------------------------------------------*/
/* FSATTR - File System Attributes of v_fstatfs/vfs_statfs(BPXYSSTF)*/
/*------------------------------------------------------------------*/
struct fsf_prop { /* NFS V3 Properties @DFA*/
BIT fs_fsf_v3ret :1; /* V3 Prop Returned @DFA*/
BIT :2;
BIT fs_fsf_CanSetTime :1; /* time_delta accuracy @DFA*/
BIT fs_fsf_homogeneous :1; /* pathconf same for all@DFA*/
BIT :1;
BIT fs_fsf_symlink :1; /* Supports Symlinks @DFA*/
BIT fs_fsf_link :1; /* Supports Hard Links @DFA*/
}; /*@DFA*/
typedef struct s_fsattr {
CBHDR fs_hdr; /* (f_OEcbid and f_OEcblen) */
BPXUL32 fs_blocksize; /* Block size (f_bsize) @DVC*/
int rsvd1; /* Reserved */
int rsvd2; /* Reserved */
BPXUL32 fs_totalspace; /* Total space. The total
number of blocks on file
system in units of f_frsize
(f_blocks) @DVC*/
int rsvd3; /* Reserved */
BPXUL32 fs_usedspace; /* Used space in blocks
(f_OEusedspace) @DVC*/
int rsvd4; /* Reserved */
BPXUL32 fs_freespace; /* Free space in blocks
(f_bavail) @DVC*/
BPXUL32 fs_fsid; /* File system ID (f_fsid)@DVC*/
/* Flags: */
BIT :1; /* Reserved @DCA*/
BIT fs_exported :1; /* Filesys is exported
(ST_OEEXPORTED) @DCA*/
BIT :6; /* Reserved @DFC*/
struct fsf_prop fs_nfsprop; /* NFS V3 Properties @DFA*/
BIT :8; /* Reserved @DFC*/
BIT :5; /* Reserved @DJC*/
BIT fs_nosec :1; /* No Security Checks @DJA*/
BIT fs_nosuid :1; /* SetUID/SetGID not supported
(ST_NOSUID) @DBM*/
BIT fs_rdonly :1; /* Filesys is read only
(ST_RDONLY) @DBM*/
#ifdef _BPXLL
long long fs_maxfilesize;
#else
int fs_maxfilesizehw; /* High word of max file size
(f_OEmaxfilesizehw) @DBM*/
BPXUL32 fs_maxfilesizelw;/* Low word of max file size
(f_OEmaxfilesizelw) @DVC*/
#endif
char rsvd5[16]; /* Reserved @DBA*/
BPXUL32 fs_frsize; /* Fundamental filesystem
block size (f_frsize) @DVC*/
int rsvd6; /* Reserved @DBC*/
int rsvd7; /* Reserved @DBC*/
BPXUL32 fs_bfree; /* Total number of free blocks
(f_bfree) @DVC*/
BPXUL32 fs_files; /* Total number of file nodes
in the file system (f_files)
@DVC*/
BPXUL32 fs_ffree; /* Total number of free file
nodes (f_ffree) @DVC*/
BPXUL32 fs_favail; /* Number of free file nodes
available to unprivileged
users (f_favail) @DVC*/
BPXUL32 fs_namemax; /* Maximum file name length
(f_namemax) @DVC*/
BPXUL32 fs_invarsec; /* Number of seconds fs will
remain unchanged
(f_OEinvarsec) @DVC*/
BPXUL32 fs_time_delta_sec;/* Granularity of setting @DVC*/
BPXUL32 fs_time_delta_ns;/* file times @DVC*/
char rsvd8[12]; /* Reserved @DBC*/
} FSATTR ;
#define FSATTR_ID "SSTF"
#define FSATTR_HDR {{FSATTR_ID}, sizeof(FSATTR)}
/*------------------------------------------------------------------*/
/* PFS Type values for me_fstype and pfsi_pfstype. */
/*------------------------------------------------------------------*/
#define MNT_FSTYPE_LOCAL 1 /* Files are local */
#define MNT_FSTYPE_REMOTE 2 /* Files are remote */
#define MNT_FSTYPE_PIPE 3 /* Files are pipes/fifos */
#define MNT_FSTYPE_SOCKET 4 /* Files are sockets */
#define MNT_FSTYPE_CSPS 6 /* STREAMS char spec @DHA*/
/*------------------------------------------------------------------*/
/* Alternative Macro for Initializing Input Structures. */
/*------------------------------------------------------------------*/
#define CBINIT(cb,typ) { \
memset(&(cb),'\0',sizeof(typ)); \
memcpy(((CBHDR *)(&(cb))) -> cbid, typ ## _ID, 4); \
((CBHDR *)(&(cb))) -> cblen = sizeof(typ); \
}
/*------------------------------------------------------------------*/
/* I/O Control Command Codes used by w_pioctl & vn_ioctl (BPXYIOCC)*/
/*------------------------------------------------------------------*/
#ifndef IOC_EDITACL
#define IOC_EDITACL 0x2000C100 /* Edit ACL: _IO('A',0) @P2A*/
#endif
/*------------------------------------------------------------------*/
/* File Group Pathconf structure used by v_pathconf (BPXYPCF) */
/*------------------------------------------------------------------*/
/*@DFA*/
struct PC_filegrp { /* PathConf File Group @DFA*/
int pcfglinkmax; /* Link Max @DFA*/
int pcfgnamemax; /* Name Max @DFA*/
/* Flags: @DFA*/
BIT pcfgnotrunc :1; /* No Trunc @DFA*/
BIT pcfgchownRstd :1; /* Chown Rstd @DFA*/
BIT pcfgcaseinsensitive :1; /* Case Insensitive @DFA*/
BIT pcfgcasenonpreserving :1; /* Case non-presrv @DFA*/
BIT :4; /*@DFA*/
char pcfgRsvd[3]; /*@DFA*/
} ;
/* 3@PDA*/
/*------------------------------------------------------------------*/
/* VLOCK - Byte Range Locking Structure for v_lockctl. (BPXYVLOK)*/
/* and for vn_lockctl @PEM*/
/* */
/* The POSIX flock structure and locking constants are defined */
/* in the fcntl.h header, which is included here. */
/*------------------------------------------------------------------*/
#ifndef _NOFCNTL /* If pgm does not request that*/
#include <fcntl.h> /* fcntl.h be suppressed, */
#define FLOCK struct flock /* see prolog for details. */
#endif
typedef struct s_vlock {
CBHDR vl_hdr;
/* LOCKER: fields that are used with VL_REGLOCKER*/
int vl_serverpid; /* Server's PID */
int vl_clientpid; /* Server's Client's PID */
GTOK vl_lockertok; /* Token for Locker(Spid+Cpid) */
/* TID: individual lock owner within a locker. */
char vl_clienttid[8]; /* Client's Thread's TID */
/* OBJECT: represents a single locked file */
int vl_objclass; /* Object Class: HFS, MVS, etc */
char vl_objid[12]; /* Obj's Unique Id within class*/
GTOK vl_objtok; /* Token for Object(Class+Id) */
/*----------------------------------------------
! The two fields below were never used and are
! being left here so old programs that may
! have referenced them will not suffer
! compile failures with this new header. @DUA*/
/*----------------------------------------------
! We are taking back these two fields:
! char vl_dosmode
! char vl_dosaccess
! Have advised FVT on the disappearing of the
! fields @DYA*/
/*-----------------------------------------------*/
BIT vl_nosplitmerge :1; /*Do not split or merge
ranges @DYA*/
BIT :7; /* Reserved @DYA*/
char vl_rsvd; /* Reserved @DUC @DYC*/
char vl_blklocklen; /* Length for Blocking Lk @DUA*/
char vl_rsvd2[5]; /*@DUC*/
GTOK vl_vntoken; /* Unix Obj Vnode Token @DUA*/
/* Lock information: range and type, etc */
FLOCK vl_flock; /* POSIX flock structure */
/* Version 2 Extensions - - - - - - - - - - @DUA*/
int vl_rsvd3; /*@DUA*/
struct s_brlm_rangelock /*@DUA*/
* _PTR32 vl_blockinglock; /* Ptr to Blocking Lock @DVC*/
/*@DUA*/
union { /*@DUA*/
/*--------------------------------------@DUA*/
struct { /* Async Locking Ext @DUA*/
/*--------------------------------------@DUA*/
#ifdef _LP64 /*@PGA*/
void * vl_ax_aiocb; /* Aiocb Ptr64 @PGA*/
#else /*@PGA*/
int vl_rsvd4; /*@DUA*/
void * _PTR32 vl_ax_aiocb; /* Aiocb @DVC*/
#endif /*@PGA*/
int vl_ax_aiocblen; /* Aiocblen @DUA*/
} vl_aioext; /*@DUA*/
/*------------------------------------------*/
struct { /* UnloadLocks Extensions @PIC @PHA*/
/*------------------------------------------*/
/* Ptr to Output Chain is always Ptr32 @PHA*/
int vl_rsvd52; /*@PHA*/
struct s_brlm_unloadlockslist /*@DUA*/
* _PTR32 vl_ull_outlistptr; /* Chain Ptr @DVC*/
/* Pointer to Input Mask is in @PIA*/
/* vl_ullIext below @PIA*/
/* Input Fields @PIC @PHA*/
char vl_ull_subpool; /* Subpool @DUA*/
char vl_ull_masklen; /* InMask Len @DYA*/
char vl_ull_retwaiters; /* Held & Wait @DUA*/
} vl_ullext; /*@PIC @PHA*/
struct { /* UnloadLocks Input Extension @DUA*/
#ifdef _LP64 /*@PHA*/
/* Input Ptr64 to Object Mask @PHA*/
/* like vl_objectmask @PHA*/
void * vl_ull_inmaskptr; /*@PHA*/
#else /*@PHA*/
int vl_rsvd5; /*@DUA*/
/* Input Ptr32 to Object Mask @PHA*/
/* like vl_objectmask @PHA*/
void * _PTR32 vl_ull_inmaskptr; /*@PHA*/
#endif /*@PHA*/
/* Input Fields: subpool,masklen,retwaiters
logically belong here but that would
change their fully qualified names. PIA*/
} vl_ullIext; /*@PIC @DUA*/
/*------------------------------------------*/
struct { /* Purge Masks Extension @DUA*/
/*------------------------------------------*/
#ifdef _LP64 /*@PHA*/
struct vl_purgemasks * /*@PHA*/
vl_pg_masks; /* Obj/Own Masks Ptr64 @PHA*/
#else /*@PHA*/
int vl_rsvd6; /*@DUA*/
struct vl_purgemasks * _PTR32 /*@DVC*/
vl_pg_masks; /* Obj/Own Masks @DVC*/
#endif /*@PHA*/
int vl_pg_maskslen; /* Masks Len @DUA*/
} vl_pgext; /*@DUA*/
} vl_u; /*@DUA*/
/*@DUA*/
char vl_rsvd7[12]; /*@DUA*/
} VLOCK;
/* Simple Field Names @DUA*/
/*@DUA*/
#define vl_aiocb vl_u.vl_aioext.vl_ax_aiocb /*@DUA*/
#define vl_aiocblen vl_u.vl_aioext.vl_ax_aiocblen /*@DUA*/
/*@DUA*/
/*2@PHC*/
#define vl_outlistptr vl_u.vl_ullext.vl_ull_outlistptr /*@DUA*/
#define vl_inmaskptr vl_u.vl_ullIext.vl_ull_inmaskptr /*@PIC@DYA*/
#define vl_subpool vl_u.vl_ullext.vl_ull_subpool /*@DUA*/
#define vl_masklen vl_u.vl_ullext.vl_ull_masklen /*@DYA*/
#define vl_retwaiters vl_u.vl_ullext.vl_ull_retwaiters /*@PHA*/
#define vl_pgmasks vl_u.vl_pgext.vl_pg_masks /*@DUA*/
#define vl_pgmaskslen vl_u.vl_pgext.vl_pg_maskslen /*@DUA*/
/* Constants */
#define VLOCK_ID "VLOK"
#define VLOCK_HDR {{VLOCK_ID}, sizeof(VLOCK)}
/* Values for Object Class: vl_objclass */
#define VL_HFS 0 /* Unix File */
#define VL_MVS 1 /* Legacy MVS dataset */
#define VL_LFSESA 2 /* Lan File Server */
#define VL_NFSCOBJCL 3 /* NFS Client object @DYA*/
/* Values for v_lockctl cmd */
#define VL_REGLOCKER 1
#define VL_UNREGLOCKER 2
#define VL_LOCK 3
#define VL_LOCKWAIT 4
#define VL_UNLOCK 5
#define VL_QUERY 6
#define VL_PURGE 7
#define VL_LOCKASY 8 /*@DUA*/
#define VL_LOCKCANCEL 9 /*@DUA*/
#define VL_UNLOADLOCKS 10 /*@DUA*/
/* UnLoadLocks Constants, for vl_retwaiters @DUA*/
#define ull_retwaiters 1 /* Output Holders & Waiters @DUA*/
#define ull_retalllocks 3 /* All Locks, Held & Waiting @DUA*/
/* The vl_objid used by fcntl() for POSIX locking of HFS files */
struct hfsobjid {
int hfsobj_devno; /* device number (at_dev) */
FID hfsobj_fid; /* file ID (at_fid) */
};
/*------------------------------------------------------------*/
/* Purge Locks Masks @DUA*/
/*------------------------------------------------------------*/
struct vl_purgemasks { /*@DUA*/
char vl_objectmask[16]; /* ObjectId Mask @DUA*/
char vl_ownermask[16]; /* Lock OwnerId Mask @DUA*/
};
/* These can be set, for example, as follows:
* int AllFoxes[4] = {-1,-1,-1,-1};
* int ClientTIDs[4] = {-1,-1,0,0};
* struct vl_purgemasks PM;
* memcpy(PM.vl_objectmask,AllFoxes,16);
* memcpy(PM.vl_ownermask,ClientTIDs,16); @DUA*/
/*------------------------------------------------------------*/
/* Lock Owner Structure - v_lockctl and v_open @DUA*/
/*------------------------------------------------------------*/
typedef struct s_lockowner { /*@DUA*/
int lo_serverpid; /* Server's PID */
int lo_clientpid; /* Server's Client's ID */
char lo_clienttid[8]; /* Client's Thread's ID */
} LOCKOWNER ; /*@DUA*/
/*------------------------------------------------------------*/
/* BRLM_RangeLock - A blocking lock or an unloaded lock. @DUA*/
/*------------------------------------------------------------*/
typedef struct s_brlm_rangelock { /*@DUA*/
LOCKOWNER rl_owner; /* Owner: Spid, Cpid, Ctid */
char rl_offset[8]; /* 8-byte file offset */
char rl_length[8]; /* 8-byte lock length */
BIT rl_waiter :1; /* A waiting request */
BIT :7;
char rl_openacc; /* Open Access Mode */
char rl_opendeny; /* Open Deny Mode */
char rl_access; /* Lock Access or 5=OModes */
} BRLM_RANGELOCK; /*@DUA*/
/* Values for rl_access @DUA*/
#define rl_shared 1 /* Read lock */
#define rl_excl 2 /* Write lock */
#define rl_shr2excl 3 /* Read waiting for wrt */
#define rl_openmodes 5 /* Acc & Deny Modes */
/*------------------------------------------------------------*/
/* BRLM UnloadLocks List @DUA*/
/*------------------------------------------------------------*/
struct s_ull_entry { /* One Unloaded Lock Entry @DUA*/
int ull_objclass; /* Object Class */
char ull_objid[12]; /* Object Id */
BRLM_RANGELOCK ull_rangelock; /* Range Lock */
int rsvd2;
} ; /*@DUA*/
/* One Unloaded Lock List Segment @DUA*/
typedef struct s_brlm_unloadlockslist { /*@DUA*/
char ull_id[8]; /* 'IGWLBULL' */
int ull_length; /* Total length */
char ull_ver; /* Version */
char ull_sp; /* Storage SubPool */
char ull_key; /* Storage Key */
char rsvd1;
struct s_brlm_unloadlockslist
* _PTR32 ull_next; /* Next on Chain @DVC*/
int ull_count; /* Number of Entries */
struct s_ull_entry ull_entries[64]; /* 1 to 64 Locks */
} BRLM_UNLOADLOCKSLIST; /*@DUA*/
#ifdef _LP64
#pragma pack(reset)
#endif
#endif /* End of Common Structures */
#if !defined(__BPXYVFSI) & !defined(__BPXYVFSI_Common_Only)
#define __BPXYVFSI
/********************************************************************/
/********************************************************************/
/** **/
/** Structures specific to the VFS interface. **/
/** **/
/********************************************************************/
/********************************************************************/
/* 3@PDA*/
#ifdef _LP64
#pragma pack(1)
#endif
/*------------------------------------------------------------------*/
/* VFSTOK & VNTOK - Opaque Tokens for file systems and files. */
/*------------------------------------------------------------------*/
typedef struct s_vfstok { /* VFS Token */
char vfstok[8];
} VFSTOK ;
typedef struct s_vntok { /* Vnode Token */
char vntok[8];
} VNTOK ;
/*------------------------------------------------------------------*/
/* OSS - Operating System Specific Information Structure (BPXYOSS )*/
/*------------------------------------------------------------------*/
typedef struct s_oss {
CBHDR os_hdr;
int os_diribc; /* Directory I/O block cnt */
int os_readibc; /* Read I/O block cnt */
int os_writeibc; /* Write I/O block cnt */
BIT os_xmtpt :1; /* v_lookup cross mt pts @P5A*/
BIT os_noremote :1; /* v_rpn don't cross into remote
file sys, like NFSC @01A*/
BIT :30;
GTOK os_opentoken; /* v_open token @DUA*/
} OSS ;
#define OSS_ID "OSS "
#define OSS_HDR {{OSS_ID}, sizeof(OSS)}
/*------------------------------------------------------- @DUA*/
/* Special os_opentoken values - @DUA*/
/* These are to be used to set the first word of the @DUA*/
/* open token to the special values that correspond @DUA*/
/* to the special stateids passed by the client. @DUA*/
/* They are used as in this example: @DUA*/
/* OSS O; @DUA*/
/* O.os_opentoken.gtok[0] = OS_OTMANDCHK; @DUA*/
/*------------------------------------------------------- @DUA*/
#define OS_OTADVCHK (void*)(0) /* Advisory Check, V4 only @DUA*/
#define OS_OTMANDCHK (void*)(2) /* Mandatory Check, all @DUA*/
#define OS_OTOVERRIDE (void*)(1) /* No Checking - Rd Only @DUA*/
#ifdef _BPX_MNTE3 /*@DXA*/
#ifndef _BPX_MNTE2 /*@DXA*/
#define _BPX_MNTE2 1 /*@DXA*/
#endif /*@DXA*/
#endif /*@DXA*/
/*------------------------------------------------------------------*/
/* RPNMNTE - Mount Entry Structures returned by v_rpn. (BPXYMNTE)*/
/* NOTE: me_mountpoint is not filled in by v_rpn. */
/*------------------------------------------------------------------*/
#ifdef _BPX_MNTE2
#ifndef __syslistdef /*@P8A*/
#define __syslistdef 1 /*@P8A*/
typedef struct s_syslistdef {
short int mt_syslistnum; /* Number of systems in list
@DRA*/
short int mt_syslistflags; /* Flags @DRA*/
char mt_syslist[32] [8];/* System names @DRA*/
} SYSLISTDEF; /*@DRA*/
#else /* Use the definition from mntent.h @P8A*/
#define mt_syslistnum mnt2_syslistnum /*@P8A*/
#define mt_syslistflags mnt2_syslistflags /*@P8A*/
#define mt_syslist mnt2_syslist /*@P8A*/
#endif /*@P8A*/
/*
* Values for mt_syslistflags
*/
#define MNT_SYSLIST_INCLUDE 0x0000 /*@DRA*/
#define MNT_SYSLIST_EXCLUDE 0x0001 /*@DRA*/
#endif
typedef struct s_mnteh { /* w_getmntent header */
CBHDR mh_hdr; /* Header with total length */
char mh_cursor[8]; /* Internal cursor */
int mh_devno; /* File System devno to find */
#ifndef _BPX_MNTE2 /* mnte header definition @DLA*/
int rsvd; /* Reserved - must be
zero on entry @D5C*/
#else /* mnte2 header definition@DLA*/
int mh_bodylen; /* Length of the mnte body@DLA*/
char rsvd[8]; /* Reserved - must be
zero on entry @DLC*/
#endif /*@DLA*/
} MNTEH;
typedef struct s_mnte { /* w_getmntent returned entry */
int me_fstype; /* File system type */
int me_mode; /* File system mount mode */
int me_dev; /* st_dev of this file system */
int me_parentdev; /* st_dev of parent file sys */
int me_rootino; /* st_ino of the mount point */
char me_status; /* status of the file system. */
char me_ddname[9]; /* ddname specified on mount */
char me_fstname[9]; /* FILESYSTYPE Name */
char me_fsname[45]; /* File System Name (HFS DSN) */
int me_pathlen; /* Length of mount point path */
char me_mountpoint[1024]; /* Mount point pathname */
char me_jobname[8]; /* Job Name issuing Quiesce */
int me_pid; /* PID that issued Quiesce */
int me_parmoffset; /* Offset of mount parameter
from me_fstype @D8C*/
short me_parmlen; /* Length of mount parameter
@D5A*/
#ifndef _BPX_MNTE2 /* mnte base definition @DLA*/
char rsvd[54]; /* Reserved for expansion @D5C*/
#else /* mnte2 base definition@DLA*/
char me_sysname[8]; /* system mounted on @DKA*/
char me_qsysname[8]; /* quiesce system name @DKA*/
char me_fromsys[8]; /* filesystem moved from this
system @DKA*/
short rsvd1; /* reserved for alignment @DKA*/
int me_rflags; /* request flags @DKA*/
int me_status2; /* more status fields @DKA*/
int me_success; /* filesystems moved ok @DKA*/
int me_readct; /* Number of reads @DLA*/
int me_writect; /* Number of writes done @DLA*/
int me_diribc; /* Number directoryI/O blks@DLA*/
int me_readibc; /* Number read I/O blocks @DLA*/
int me_writeibc; /* Number write I/O blocks @DLA*/
#ifdef _BPXLL
long long me_bytesread;
long long me_byteswritten;
#else
int me_bytesreadhw; /* Total number bytes read
high word @DLA*/
int me_bytesreadlw; /* Total number bytes read
low word @DLA*/
int me_byteswrittenhw;/*Total number bytes-wrote
high word @DLA*/
int me_byteswrittenlw;/*Total number bytes-wrote
low word @DLA*/
#endif
char me_filetag[4]; /* File tag @DNA*/
int me_syslistoff; /* offset to syslist @DRA*/
short me_syslistlen; /* length of syslist @DRA*/
short me_aggnamelen; /* length of aggregate name
@DSA*/
int me_aggnameoff; /* offset to aggregate name
@DSA*/
char me_roseclabel[8];/* read only seclabel @DTA*/
#endif /* @DLA*/
#ifdef _BPX_MNTE3 /*@DXA*/
int me_mntsec; /* Seconds since mount @DXA*/
int me_fstoken; /* VfsPtr for this filesys @DXA*/
int me_pfsnormalstatusoffset;/* Offset of Pfs normal status
@DXA*/
short me_pfsnormalstatuslength;/* Length of Pfs normal status
@DXA*/
short me_pfsexcpstatuslength; /* Length of Pfs exception status
@DXA*/
int me_pfsexcpstatusoffset; /* Offset of Pfs exception status
@DXA*/
unsigned int me_fsusrmntuid; /* UID of user that mounted the
file system. Always 0 for
privileged mounts. @E0A*/
char me_expansion[76]; /* Expansion room @E0C@DXA*/
#endif /*@DXA*/
} MNTE;
typedef struct s_rpnmnte { /* v_rpn returned entry: */
MNTEH rpn_mnteh; /* w_getmntent header */
MNTE rpn_mnte; /* one w_getmntent entry */
} RPNMNTE;
#define MNTEH_ID "MNTE"
/*#define MNTE2H_ID "MNT2" */ /*@DLA*/
#define MNTE2H_ID "\xD4\xD5\xE3\xF2" /* MNT2 In Hex @DSC*/
#define MNTE3H_ID "\xD4\xD5\xE3\xF3" /* MNT3 In Hex @DXC*/
/*#define MNTE2H MNTEH delete conflict @P8D @DLA*/
#define MNTEH_HDR {{MNTEH_ID}, sizeof(MNTEH)+sizeof(MNTE)}
/* Values for me_fstype are in the common area. */
/* Values for me_mode */
#define MNT_MODE_RDWR 0x00000000 /*@P8C*/
#define MNT_MODE_RDONLY 0x00000001 /*@P8C*/
#define MNT_MODE_NOSUID 0x00000002 /*@P8C @DCA*/
#define MNT_MODE_EXPORT 0x00000004 /*@P8C @DCA*/
#define MNT_MODE_NOSEC 0x00000008 /*@P8C*/
#define MNT_MODE_NOAUTO 16 /*@DKA*/
#define MNT_MODE_CLIENT 32 /*@DKA*/
#define MNT_MODE_AUNMOUNT 64 /*@DPA*/
#define MNT_MODE_SECACL 128 /*@DOA*/
#define MNT_MODE_RSVD1 256 /*@P9A*/
/* Values for me_status */
#define MNT_FILE_ACTIVE 0x00 /*@D5A*/
#define MNT_FILE_DEAD 0x01
#define MNT_FILE_RESET 0x02
#define MNT_FILE_DRAIN 0x04
#define MNT_FILE_FORCE 0x08
#define MNT_FILE_IMMED 0x10
#define MNT_FILE_NORM 0x20
#define MNT_FILE_IMMED_TRIED 0x40
#define MNT_FILE_QUIESCED 0x80
#define MNT_FILE_MOUNT_IN_PROGRESS 0x81 /*@D7A*/
#define MNT_FILE_ASYNCH_MOUNT 0x82 /*@D5A*/
/* Values for me_status2 */
#define MNT_FILE_UNOWNED 0x01
#define MNT_FILE_INRECOVERY 0x02
#define MNT_FILE_SUPERQUIESCED 0x04
#define MNT_FILE_RECYCLESTARTED 0x08 /*@DXA*/
#define MNT_FILE_RECYCLEMOUNTING 0x10 /*@DXA*/
#define MNT_FILE_RECYCLENOTACTIVE 0x20 /*@DXA*/
/* Values for me_rflags */
#define MNT_REQUEST_CHANGE 0x01
#define MNT_REQUEST_NEWAUTO 0x02
/*------------------------------------------------------------------*/
/* NREG - Registration Parameter Block used with v_reg (BPXYNREG)*/
/* */
/* NOTE: The CBINIT macro cannot be used with this structure. */
/*------------------------------------------------------------------*/
typedef struct s_nreg {
char nr_id[4]; /* Identifier */
signed short nr_len; /* Length */
short nr_ver; /* Version */
int nr_type; /* Server Type in*/
int nr_namelen; /* Server Name Length in*/
char nr_name[32]; /* Server Name in*/
int nr_maxvntok; /* Maximum VNTOK limit inout*/
BIT nr_hotc :1; /* Exit needs Hotc Env in*/
BIT nr_nowait :1; /* Don't wait for Quiesce in*/
BIT nr_secsfd :1; /* secondary sfd server in*/
BIT nr_allocdevno :1; /* Allocate a Devno in @DUA*/
BIT :4; /* Reserved */
char rsvd1[3]; /* Reserved */
char nr_exitname[8]; /* Exit name in*/
char nr_initparm[8]; /* Init parm for Exit in*/
int nr_abendcode; /* Abend Code out*/
int nr_abendrsn; /* Abend Reason out*/
char nr_pfstype[8]; /* Dependant PFS in*/
} NREG;
#define NREG_ID "NREG"
#define NREG_VERSION 2
#define NREG_HDR {NREG_ID}, sizeof(NREG), NREG_VERSION
#define NREG_FILE 1 /* File Server e.g.NFSS */
#define NREG_LOCK 2 /* Lock Server e.g.LOCKD */
#define NREG_FEXP 3 /* File Exporter e.g. DFS */
#define NREG_SFDS 4 /* Shared FD server: NW @DIA*/
#define nr_devno nr_abendrsn /* Output Devno @DUA*/
/*------------------------------------------------------------------*/
/* v_open @DUA*/
/*------------------------------------------------------------------*/
/* Open_Parms Structure @DUA*/
typedef struct s_openparms { /*@DUA*/
int open_type; /* Type of Open */
LOCKOWNER openowner; /* Owner for Shr Options */
int shr_access; /* Read, Write, Both */
int shr_deny; /* None, Read, Write, Both */
GTOK open_token; /* Open Token */
VNTOK newvntoken; /* Output new Vnode Token */
BIT :30;
BIT modacc :1; /* Upgrade/Downgrade Acc */
BIT moddeny :1; /* Upgrade/Downgrade Deny */
char rsvd[12]; /* Reserved */
} OPENPARMS ; /*@DUA*/
/* Open_Type paramter constants @DUA*/
#define OPEN_CREATE_UNCHECKED 1 /* use UnChecked protocol */
#define OPEN_CREATE_GUARDED 2 /* use Guarded protocol */
#define OPEN_CREATE_EXCLUSIVE 3 /* use Exclusive protocol */
#define OPEN_FILE 4 /* Open an existing file */
#define OPEN_NLM_SHR 5 /* V2/V3 NLM SHR Options */
#define OPEN_UPGRADE 6 /* UpGrade SHR Options */
#define OPEN_DOWNGRADE 7 /* DownGrade SHR Options */
/* Shr_Access parameter constants @DUA*/
#define SHRACC_WRITE 1 /* Access Intent is to Write @PAC*/
#define SHRACC_READ 2 /* Access Intent is to Read @PAC*/
#define SHRACC_BOTH 3 /* Access Intent is Read & Write */
/* Shr_Deny parameter constants @DUA*/
#define SHRDENY_NONE 0 /* No access is denied. */
#define SHRDENY_WRITE 1 /* Deny Write access. @PAC*/
#define SHRDENY_READ 2 /* Deny Read access. @PAC*/
#define SHRDENY_BOTH 3 /* Deny Read and Write access. */
/*********************************************************************/
/*********************************************************************/
/** **/
/** Calling Interface Definitions **/
/** **/
/*********************************************************************/
/*********************************************************************/
/*-------------------------------------------------------------------*/
/* Macros to translate the vnode calls to their callable services */
/*-------------------------------------------------------------------*/
#define v_ioctl _VCALL(V_IOCTL ,99) /*@DWA*/
#define v_reg _VCALL(V_REG ,145)
#define v_rpn _VCALL(V_RPN ,146)
#define v_get _VCALL(V_GET ,148)
#define v_rel _VCALL(V_REL ,149)
#define v_lookup _VCALL(V_LOOKUP ,150)
#define v_rdwr _VCALL(V_RDWR ,151)
#define v_readdir _VCALL(V_READDIR ,152)
#define v_readlink _VCALL(V_READLINK,153)
#define v_create _VCALL(V_CREATE ,154)
#define v_mkdir _VCALL(V_MKDIR ,155)
#define v_symlink _VCALL(V_SYMLINK ,156)
#define v_getattr _VCALL(V_GETATTR ,157)
#define v_setattr _VCALL(V_SETATTR ,158)
#define v_link _VCALL(V_LINK ,159)
#define v_rmdir _VCALL(V_RMDIR ,160)
#define v_remove _VCALL(V_REMOVE ,161)
#define v_rename _VCALL(V_RENAME ,162)
#define v_fstatfs _VCALL(V_FSTATFS ,163)
#define v_lockctl _VCALL(V_LOCKCTL ,164)
#define v_export _VCALL(V_EXPORT ,218) /*@DCA*/
#define v_access _VCALL(V_ACCESS ,235) /*@DDA*/
#define w_pioctl _VCALL(W_PIOCTL ,245) /*@P2A*/
#define v_pathconf _VCALL(V_PATHCONF,259) /*@DFA*/
#define v_open _VCALL(V_OPEN ,295) /*@DUA*/
#define v_close _VCALL(V_CLOSE ,296) /*@DUA*/
/*-------------------------------------------------------------------*/
/* Callable Services Typedefs and Prototypes */
/* */
/* NOTE: Each "len" parameter contains the length of the */
/* parameter that follows. */
/*-------------------------------------------------------------------*/
typedef void V_REG (int len, NREG *,
int *rv, int *rc, int *rsn);
typedef void V_RPN (OSS *,
int pathlen, char *path,
VFSTOK *, VNTOK *,
int mlen, RPNMNTE *,
int alen, ATTR *,
int *rv, int *rc, int *rsn);
typedef void V_EXPORT (OSS *, /*@DCA*/
int function,
char *filesysname,
VFSTOK *, VNTOK *,
int mlen, RPNMNTE *,
int alen, ATTR *,
char *volhdl,
int *rv, int *rc, int *rsn);
typedef void V_GET (VFSTOK, OSS *,
FID, VNTOK *,
int *rv, int *rc, int *rsn);
typedef void V_REL (VNTOK, OSS *,
int *rv, int *rc, int *rsn);
typedef void V_LOOKUP (VNTOK, OSS *,
int namelen, char *name,
int alen, ATTR *,
VNTOK *,
int *rv, int *rc, int *rsn);
typedef void V_RDWR (VNTOK, OSS *,
UIO *,
int alen, ATTR *,
int *rv, int *rc, int *rsn);
typedef void V_READDIR (VNTOK, OSS *,
UIO *,
int *rv, int *rc, int *rsn);
typedef void V_READLINK(VNTOK, OSS *,
UIO *,
int *rv, int *rc, int *rsn);
typedef void V_CREATE (VNTOK, OSS *,
int namelen, char *name,
int alen, ATTR *,
VNTOK *,
int *rv, int *rc, int *rsn);
typedef void V_MKDIR (VNTOK, OSS *,
int namelen, char *name,
int alen, ATTR *,
VNTOK *,
int *rv, int *rc, int *rsn);
typedef void V_SYMLINK (VNTOK, OSS *,
int namelen, char *name,
int pathlen, char *pathname,
int alen, ATTR *,
int *rv, int *rc, int *rsn);
typedef void V_GETATTR (VNTOK, OSS *,
int alen, ATTR *,
int *rv, int *rc, int *rsn);
typedef void V_SETATTR (VNTOK, OSS *,
int alen, ATTR *,
int *rv, int *rc, int *rsn);
typedef void V_LINK (VNTOK, OSS *,
int namelen, char *name,
VNTOK todir,
int *rv, int *rc, int *rsn);
typedef void V_RMDIR (VNTOK, OSS *,
int namelen, char *name,
int *rv, int *rc, int *rsn);
typedef void V_REMOVE (VNTOK, OSS *,
int namelen, char *name,
int *rv, int *rc, int *rsn);
typedef void V_RENAME (VNTOK, OSS *,
int oldlen, char *oldname,
VNTOK newdir,
int newlen, char *newname,
int *rv, int *rc, int *rsn);
typedef void V_FSTATFS (VNTOK, OSS *,
int falen, FSATTR *,
int *rv, int *rc, int *rsn);
typedef void V_ACCESS (VNTOK, OSS *,
int mode,
int *rv, int *rc, int *rsn);
typedef void V_LOCKCTL (OSS *,
int cmd,
int vlen, VLOCK *,
int *rv, int *rc, int *rsn);
typedef void W_PIOCTL (int pathlen, char *path, /*@P2A*/
int cmd,
int arglen, char *arg,
int *rv, int *rc, int *rsn);
typedef void V_PATHCONF (VNTOK, OSS *, /*@DFA*/
int pc_len, struct PC_filegrp *,
int alen, ATTR *,
int *rv, int *rc, int *rsn);
typedef void V_OPEN (VNTOK, OSS *, /*@DUA*/
int OpenParm_Length, OPENPARMS *OpenParm,
int Name_length, char *Name,
int CreateParm_Length, void *CreateParm,
int OAttr_length, ATTR *OAttr,
int *rv, int *rc, int *rsn);
typedef void V_CLOSE (VNTOK, OSS *, /*@DUA*/
GTOK *Open_Token,
int *rv, int *rc, int *rsn);
typedef void V_IOCTL (VNTOK, OSS *,
int cmd,
int Argumentlen,
char *Argument,
int *rv, int *rc, int *rsn); /*@DWA*/
/*-------------------------------------------------------------------*/
/* Macros & structures used to address the OE Callable Services */
/*-------------------------------------------------------------------*/
/* _VCALL Macro to invoke the i'th Vnode Callable Service */
#define _VCALL(op,i) ((op *) \
( (*(struct _v_cvt *_PTR32 *_PTR32)0x10) -> \
_v_cvtcsrt -> _v_csrtvopt -> _v_vopptr[i] )) /*@PFC*/
/* Stub System Control Blocks for addressing the Callable Services */
struct _v_vopt { /* OpenEdition Callable Services */
void * _PTR32 filler; /* @DVC*/
void * _PTR32 _v_vopptr[400]; /* @DVC*/
};
struct _v_csrt { /* MVS Callable Services Table */
char filler[0x18];
struct _v_vopt *_PTR32 _v_csrtvopt; /* @DVC*/
};
struct _v_cvt { /* The CVT */
char filler[0x220];
struct _v_csrt * _PTR32 _v_cvtcsrt; /* @DVC*/
};
/*------------------------------------------------------------------*/
/* Done packing structures for 64-bit compiles 3@DVA*/
/*------------------------------------------------------------------*/
#ifdef _LP64
#pragma pack(reset)
#endif
/*-------------------------------------------------------------------*/
/* Interface Linkages */
/*-------------------------------------------------------------------*/
#if !defined(__XPLINK__) && !defined(_LP64) /*@P7A*/
#pragma linkage(V_REG , OS)
#pragma linkage(V_RPN , OS)
#pragma linkage(V_GET , OS)
#pragma linkage(V_REL , OS)
#pragma linkage(V_LOOKUP , OS)
#pragma linkage(V_RDWR , OS)
#pragma linkage(V_READDIR , OS)
#pragma linkage(V_READLINK, OS)
#pragma linkage(V_CREATE , OS)
#pragma linkage(V_MKDIR , OS)
#pragma linkage(V_SYMLINK , OS)
#pragma linkage(V_GETATTR , OS)
#pragma linkage(V_SETATTR , OS)
#pragma linkage(V_LINK , OS)
#pragma linkage(V_RMDIR , OS)
#pragma linkage(V_REMOVE , OS)
#pragma linkage(V_RENAME , OS)
#pragma linkage(V_FSTATFS , OS)
#pragma linkage(V_LOCKCTL , OS)
#pragma linkage(V_EXPORT , OS) /*@DCA*/
#pragma linkage(V_ACCESS , OS) /*@DDA*/
#pragma linkage(W_PIOCTL , OS) /*@P2A*/
#pragma linkage(V_PATHCONF, OS) /*@DFA*/
#pragma linkage(V_OPEN , OS) /*@DUA*/
#pragma linkage(V_CLOSE , OS) /*@DUA*/
#pragma linkage(V_IOCTL , OS) /*@DWA*/
#else /* Linkage Versions for LP64 & XPLINK @P7A*/
#ifdef _LP64 /*@P7A*/
#pragma linkage(V_REG , OS64_NOSTACK)
#pragma linkage(V_RPN , OS64_NOSTACK)
#pragma linkage(V_GET , OS64_NOSTACK)
#pragma linkage(V_REL , OS64_NOSTACK)
#pragma linkage(V_LOOKUP , OS64_NOSTACK)
#pragma linkage(V_RDWR , OS64_NOSTACK)
#pragma linkage(V_READDIR , OS64_NOSTACK)
#pragma linkage(V_READLINK, OS64_NOSTACK)
#pragma linkage(V_CREATE , OS64_NOSTACK)
#pragma linkage(V_MKDIR , OS64_NOSTACK)
#pragma linkage(V_SYMLINK , OS64_NOSTACK)
#pragma linkage(V_GETATTR , OS64_NOSTACK)
#pragma linkage(V_SETATTR , OS64_NOSTACK)
#pragma linkage(V_LINK , OS64_NOSTACK)
#pragma linkage(V_RMDIR , OS64_NOSTACK)
#pragma linkage(V_REMOVE , OS64_NOSTACK)
#pragma linkage(V_RENAME , OS64_NOSTACK)
#pragma linkage(V_FSTATFS , OS64_NOSTACK)
#pragma linkage(V_LOCKCTL , OS64_NOSTACK)
#pragma linkage(V_EXPORT , OS64_NOSTACK)
#pragma linkage(V_ACCESS , OS64_NOSTACK)
#pragma linkage(W_PIOCTL , OS64_NOSTACK)
#pragma linkage(V_PATHCONF, OS64_NOSTACK)
#pragma linkage(V_OPEN , OS64_NOSTACK) /*@DUA*/
#pragma linkage(V_CLOSE , OS64_NOSTACK) /*@DUA*/
#pragma linkage(V_IOCTL , OS64_NOSTACK) /*@DWA*/
#else /* XPLINK */
#pragma linkage(V_REG , OS_UPSTACK)
#pragma linkage(V_RPN , OS_UPSTACK)
#pragma linkage(V_GET , OS_UPSTACK)
#pragma linkage(V_REL , OS_UPSTACK)
#pragma linkage(V_LOOKUP , OS_UPSTACK)
#pragma linkage(V_RDWR , OS_UPSTACK)
#pragma linkage(V_READDIR , OS_UPSTACK)
#pragma linkage(V_READLINK, OS_UPSTACK)
#pragma linkage(V_CREATE , OS_UPSTACK)
#pragma linkage(V_MKDIR , OS_UPSTACK)
#pragma linkage(V_SYMLINK , OS_UPSTACK)
#pragma linkage(V_GETATTR , OS_UPSTACK)
#pragma linkage(V_SETATTR , OS_UPSTACK)
#pragma linkage(V_LINK , OS_UPSTACK)
#pragma linkage(V_RMDIR , OS_UPSTACK)
#pragma linkage(V_REMOVE , OS_UPSTACK)
#pragma linkage(V_RENAME , OS_UPSTACK)
#pragma linkage(V_FSTATFS , OS_UPSTACK)
#pragma linkage(V_LOCKCTL , OS_UPSTACK)
#pragma linkage(V_EXPORT , OS_UPSTACK)
#pragma linkage(V_ACCESS , OS_UPSTACK)
#pragma linkage(W_PIOCTL , OS_UPSTACK)
#pragma linkage(V_PATHCONF, OS_UPSTACK)
#pragma linkage(V_OPEN , OS_UPSTACK) /*@DUA*/
#pragma linkage(V_CLOSE , OS_UPSTACK) /*@DUA*/
#pragma linkage(V_IOCTL , OS_UPSTACK) /*@DWA*/
#endif /*@P7A*/
#endif /*@P7A*/
/*-------------------------------------------------------------------*/
/* Macros to allow the calls by either the v_ or bpx1 names */
/*-------------------------------------------------------------------*/
#ifndef _BPXRTL_VFSI /*@P7A*/
#define bpx1vrg v_reg
#define bpx1vrp v_rpn
#define bpx1vgt v_get
#define bpx1vrl v_rel
#define bpx1vlk v_lookup
#define bpx1vrw v_rdwr
#define bpx1vrd v_readdir
#define bpx1vra v_readlink
#define bpx1vcr v_create
#define bpx1vmd v_mkdir
#define bpx1vsy v_symlink
#define bpx1vga v_getattr
#define bpx1vsa v_setattr
#define bpx1vln v_link
#define bpx1vre v_rmdir
#define bpx1vrm v_remove
#define bpx1vrn v_rename
#define bpx1vsf v_fstatfs
#define bpx1vlo v_lockctl
#define bpx1vex v_export /*@DCA*/
#define bpx1vac v_access /*@DDA*/
#define bpx1pio w_pioctl /*@P2A*/
#define bpx1vpc v_pathconf /*@P2A*/
#define bpx1vop v_open /*@DUA*/
#define bpx1vcl v_close /*@DUA*/
#define bpx1vio v_ioctl /*@DWA*/
#endif /*@P7A*/
#endif /* End of VFSI Structures */