Oberon || Library || Module Index || Search Engine || Definition || Module
TYPE FileDescriptorSet = RECORD (Objects.ObjectRec) END; VAR emptyset: FileDescriptorSet; PROCEDURE CreateSet(VAR fdset: FileDescriptorSet); PROCEDURE Incl(VAR fdset: FileDescriptorSet; fd: SysTypes.File); PROCEDURE Excl(VAR fdset: FileDescriptorSet; fd: SysTypes.File); PROCEDURE In(fdset: FileDescriptorSet; fd: SysTypes.File) : BOOLEAN; PROCEDURE SelectWithTimeLimit( VAR readfds, writefds, exceptfds: FileDescriptorSet; timeout: SysTime.TimeVal; VAR ready: INTEGER; errors: RelatedEvents.Object; retry: BOOLEAN; VAR interrupted: BOOLEAN) : BOOLEAN; PROCEDURE Select(VAR readfds, writefds, exceptfds: FileDescriptorSet; VAR ready: INTEGER; errors: RelatedEvents.Object; retry: BOOLEAN; VAR interrupted: BOOLEAN) : BOOLEAN; PROCEDURE Poll(VAR readfds, writefds, exceptfds: FileDescriptorSet; VAR ready: INTEGER; errors: RelatedEvents.Object) : BOOLEAN; PROCEDURE InputAvailable(fd: SysTypes.File; errors: RelatedEvents.Object) : BOOLEAN;
SysSelect allows to examine sets of file descriptors whether they are ready for reading or writing or if exceptional conditions are pending. Further, the process can be blocked until one of the given file descriptors becomes ready for the intended operation.
File descriptor sets are completely covered by SysSelect because the size of file descriptor sets is not known in advance (and may even vary at runtime). CreateSet creates a new set and initializes it to the empty set. Incl and Excl allow to include and exclude individual members. In checks fd to be a member of fdset.
SelectWithTimeLimit returns either if the time limit expires (ready = 0) or if at least one of the file descriptors gets ready (in this case ready equals the number of ready file descriptors). Poll works like SelectWithTimeLimit with a time limit of 0.
Select blocks until one of the file descriptors gets ready (no time limit). InputAvailable returns TRUE if a subsequent SysIO.Read does not block.
The longtime variants of the system call may be interrupted. Usually (if retry = FALSE), this causes the appropriate error event to be raised (error code SysErrors.intr) and the system call to be aborted. However, if retry is TRUE, the system call will be repeated until no interrupt occurs. interrupt indicates in both cases whether interrupts occurred or not.
Oberon || Library || Module Index || Search Engine || Definition || Module