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


BPX1VCR, BPX4VCR (v_create)

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

The following code creates a new and empty regular file named fnewprots in a previously looked-up directory whose vnode token is in DIRVNODETOK with user read-execute, group write, other read-execute permissions. For the callable service, see v_create (BPX1VCR, BPX4VCR) — Create a file. For the data structures, BPXYOSS — Map operating system specific information and Mapping macros in z/OS UNIX System Services Programming: Assembler Callable Services Reference.
         MVC   BUFFERA(9),=CL9'fnewprots'
         MVC   BUFLENA,=F'9'
         MVC   OSSSTOR,OSS           Initialize BPXYOSS area
         MVC   ATTRSTOR,ATTR         Initialize BPXYATTR area
         XC    S_MODE,S_MODE         Clear mode
         MVI   S_TYPE,FT_REGFILE     Set regular file type
         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
         DROP  R5
         SPACE ,
         CALL  BPX1VCR,              Create a file                     +
               (DIRVNODETOK,         Input: Directory vnode token      +
               OSSSTOR,              Input/output: BPXYOSS             +
               BUFLENA,              Input: New file name length       +
               BUFFERA,              Input: New file name              +
               =A(ATTR#LENGTH),      Input: BPXYATTR length            +
               ATTRSTOR,             Input/output: BPXYATTR            +
               VNODETOK,             Output: New file Vnode token      +
               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