z/OS UNIX System Services File System Interface Reference
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


BPX1VSA, BPX4VSA (v_setattr)

z/OS UNIX System Services File System Interface Reference
SA23-2285-00

The following code sets attributes for a previously looked-up file whose vnode token is in VNODETOK. The owning user and group IDs are changed, the file change time is set to the current time and the user read-execute, group write, other read-execute permissions are set. For the callable service, see v_setattr (BPX1VSA, BPX4VSA) — Set the attributes of a file. For the data structures, see BPXYATTR — Map file attributes for v_ system calls, BPXYOSS — Map operating system specific information, and Mapping macros in z/OS UNIX System Services Programming: Assembler Callable Services Reference.
         MVC   OSSSTOR,OSS           Initialize BPXYOSS area
         MVC   ATTRSTOR,ATTR         Initialize BPXYATTR area
         XC    S_MODE,S_MODE         Clear mode
         MVI   S_MODE2,S_IRUSR       Read-execute/write/read-execute
         MVI   S_MODE3,S_IXUSR+S_IWGRP+S_IROTH+S_IXOTH
         LA    R5,ATTRSTOR           Address and
         USING ATTR,R5               map BPXYATTR area
         MVC   ATTRMODE,S_MODE       Move mode data to attribute       +
                                     structure
         MVC   ATTRUID,=F'7'         Specify new UID
         MVC   ATTRGID,=F'77'        Specify new GID
         OI    ATTRSETFLAGS1,ATTRMODECHG+ATTROWNERCHG                  +
                                     Flag UID and GID changes
         OI    ATTRSETFLAGS2,ATTRCTIMECHG+ATTRCTIMETOD                 +
                                     Set change time to current time
         DROP  R5
         SPACE ,
         CALL  BPX1VSA,              Set file attributes               +
               (VNODETOK,            Input: File vnode token           +
               OSSSTOR,              Input/output: BPXYOSS             +
               =A(ATTR#LENGTH),      Input: BPXYATTR length            +
               ATTRSTOR,             Input/output: BPXYATTR            +
               RETVAL,               Return value: 0 or -1             +
               RETCODE,              Return code                       +
               RSNCODE),             Reason code                       +
               VL,MF=(E,PLIST)       ----------------------------------

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014