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


osi_sched — Schedule async I/O completion

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

Function

The osi_sched service schedules the completion of an asynchronous request.

Requirements

Operation Environment
Authorization: Problem or Supervisor state, any key
Dispatchable unit mode: Task or SRB
Cross memory mode: Any
AMODE: 31-bit
ASC mode: Any
Interrupt status: Enabled for interrupts
Locks: Unlocked
Control parameters: All parameters must be addressable by the caller and in the primary address space.

Format

     osi_sched(Saved_Osi_AsyTok,
               Return_value,
               Return_code,
               Reason_code);

Parameters

Saved_Osi_AsyTok
Supplied parameter
Type:
Token
Length:
8 bytes

The name of the field that contains the osi_asytok value that was saved by the PFS during Part 1 of the asynchronous vnode operation that is now completing.

Return_value
Supplied and returned parameter
Type:
Integer
Length:
Fullword

The name of a fullword in which the PFS passes the results of Part 1 of the asynchronous operation, and the LFS returns the results of the scheduling.

On input to osi_sched, one of the following return values is returned:
0 or greater
The request is successful.

The LFS invokes the PFS for Part 2 of the asynchronous operation.

If the user has requested a preprocessing exit call, this value is passed to the exit before Part 2 is invoked.

On receive-type operations, the PFS should pass the actual length of the data that is to be received, if it can do so at this point. This allows a preprocessing exit to allocate smaller buffers than the size that was originally specified at the beginning of the operation. If this value cannot be passed to osi_sched, a Return_value of 0 should be used, and the exit will allocate buffers to accommodate the amount that was originally requested. See asyncio (BPX1AIO, BPX4AIO) — Asynchronous I/O for sockets in z/OS UNIX System Services Programming: Assembler Callable Services Reference for more details about these operations.

-1
The request has failed.

The LFS does not invoke the PFS for Part 2 of the asynchronous operation.

The Return_value, Return_code, and Reason_code are passed back to the user as the results of the operation.

If the PFS has resources to free that cannot be freed by the caller of osi_sched, or if for any other reason Part 2 needs to be called, it should set Return_value to 0 and report the failure of the user's operation as output from Part 2.

On output from osi_sched, one of the following return values is returned:
0
The scheduling was successful.

The LFS invokes the PFS for Part 2 of the asynchronous operation based on the input Return_value.

If Part 2 cannot be run because of process termination, the PFS gets a vn_cancel instead.

-1
The Saved_Osi_AsyTok value was not recognized.

The LFS always accepts valid calls to osi_sched. Even when the user's process is terminating and Part 2 cannot be run, cleanup for the request is deferred to vn_cancel.

If the saved LFS token is bad, it is not clear what the PFS should do about it. This could be a logic error in the PFS. If the value that was passed was once an LFS token, and this is not a late or redundant call, then it is unlikely that this can happen, because the LFS does not clean up its request while there is still any valid chance that osi_sched will be called.

Return_code
Supplied and returned parameter
Type:
Integer
Length:
Fullword

The name of a fullword in which the PFS passes the return code from Part 1, and the LFS returns the return code from the scheduling.

The Return_code parameter is meaningful only if Return_value is -1.

Reason_code
Returned parameter
Type:
Integer
Length:
Fullword

The name of a fullword in which the PFS passes the reason code from Part 1 and the LFS returns the reason code from the scheduling. Reason_code further qualifies the Return_code value.

The Reason_code parameter is meaningful only if Return_value is -1.

For the reason codes, see z/OS UNIX System Services Messages and Codes.

Usage notes

  1. For more information about asynchronous operations, see Asynchronous I/O processing.
  2. osi_sched is called by the PFS when an asynchronous vnode operation is ready to complete. For instance, data has arrived for receive-type operations or buffers are available for write-type operations.
  3. Osi_asytok on entry to Part 1 of an asynchronous vnode operation contains the LFS's request token. This value must be saved by the PFS, and is used here to identify the operation that is completing.
  4. As a result of calling osi_sched, the LFS calls the PFS for Part 2 of the original operation again. Part 2 is run from an SRB in the user's address space.

Characteristics and restrictions

None.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014