BPX4POL (poll) example
The following code issues a poll. For the callable service,
see poll (BPX1POL, BPX4POL) — Monitor activity on file descriptors and message queues. For the data structure,
see BPXYPOLL — Map poll syscall parameters. AMODE
31 callers use BPX1POL (poll) example.
LA R15,BUFFERA
USING POLLFD,R15
STG R15,BUFA ->BPXYPOLL structure
* MVC POLLHFD(4),file_descriptor_number2
MVI POLLEVENTS,0
MVI POLLEVENTS+1,POLLERDNORM
A R15,=A(POLLFD#LENGTH)
* MVC POLLHFD(4),file_descriptor_number1
MVI POLLEVENTS,0
MVI POLLEVENTS+1,POLLEWRNORM
SPACE ,
CALL BPX4POL, Create a pipe +
(BUFA, Input: address of BPXYPOLL +
=A(2), Input: number of BPXYPOLL structs +
=A(0), Input: -1, 0, milliseconds +
RETVAL, Return value: 0 or -1 +
RETCODE, Return code +
RSNCODE), Reason code +
MF=(E,PLIST) ----------------------------------