_____________________________________________________________________________

  AppEngine_SocketOp						 SWI &4D945
_____________________________________________________________________________

							   AppEngine_SocketOp
								 (SWI &4D945)

	Provides TCP/IP-related socket operations

On entry
	R0 = reason code
	other registers are reason code dependent

On exit
	R0 preserved
	other registers are reason code dependent

Interrupts
	Interrupt status is undefined
	Fast interrupts are enabled

Processor mode
	Processor is in SVC mode

Re-entrancy
	Not defined

Use
	This call provides operations to control file descriptors, which are
	requried to use the Socket_Select SWI.

	A file descriptor is a block of 32 bytes (256 bits) which indicates
	which sockets should be checked for activity.

	The action of the SWI depends on the reason code passed in R0:

		R0	Action
		0	clears a file descriptor
		1	copies one file descriptor to another
		2	sets a bit within a file descriptor
		3	clears a bit within a file descriptor
		4	tests whether a bit within a file descriptor is set

	Note: The Acorn C Socket library provides equivalents of this SWI in
	headerfile macros.

	Also: This SWI may be extended in the future to cover non-fd
	operations.

Related SWIs
	Socket_Select (SWI &41211, 5a-433)

Related vectors
	None
_____________________________________________________________________________

							 AppEngine_SocketOp 0
								 (SWI &4D945)

	Clears a file descriptor

On entry
	R0 = 0
	R1 = pointer to block of 32 bytes to become a file descriptor

On exit
	R0, R1 preserved

Use
	This call is used to clear the specified block of 32 bytes so that it
	may be used as a file descriptor block.
_____________________________________________________________________________

							 AppEngine_SocketOp 1
								 (SWI &4D945)

	Copies one file descriptor to another

On entry
	R0 = 1
	R1 = pointer to destination file descriptor
	R2 = pointer to source file descriptor

On exit
	R0, R1, R2 preserved

Use
	This call is used to copy one file descriptor block to another (or
	memory to be used as a new file descriptor).
_____________________________________________________________________________

							 AppEngine_SocketOp 2
								 (SWI &4D945)

	Sets a bit within a file descriptor

On entry
	R0 = 2
	R1 = bit to set (0-255)
	R2 = pointer to file descriptor

On exit
	R0, R1, R2 preserved

Use
	This call is used to set a bit within a file descriptor indicating
	that the respective socket is active.
_____________________________________________________________________________

							 AppEngine_SocketOp 3
								 (SWI &4D945)

	Clears a bit within a file descriptor

On entry
	R0 = 3
	R1 = bit to set (0-255)
	R2 = pointer to file descriptor

On exit
	R0, R1, R2 preserved

Use
	This call is used to clear a bit within a file descriptor indicating
	that the respective socket is not active.
_____________________________________________________________________________

							 AppEngine_SocketOp 4
								 (SWI &4D945)

	Tests whether a bit within a file descriptor is set

On entry
	R0 = 4
	R1 = bit to test (0-255)
	R2 = pointer to file descriptor

On exit
	R0, R2 preserved
	R1 = -1 if the bit was set, or 0 if it was not set

Use
	This call is used to test if a bit within a file descriptor is set,
	indicating whether the respective socket is active.
