SWI interface to BSD sockets
The Acorn and FreeNet TCP/IP stacks provide the same interface to the programmer, namely a BSD sockets interface via SWI calls. This is detailed in this help file.
There is a one to one mapping between these SWI calls and the normal BSD socket calls. The arguments are passed in order starting with register 0 and working up, with the return value being passed back in R0.
The only difference is that errors are signaled by returning a RISC OS error in the normal way (with V set and R0 pointing to an error block) instead of by returning a value of -1. The error number in the error block will be a normal Unix error code however, and the C library veneers convert these errors back into a -1 return code with errno set.
The mapping between BSD calls and SWI calls is given in this table.
The errors returned by the Socket SWIs are listed here.
Various symbolic constants are used as arguments to Socket SWIs.
A description of the Internet Event is given here.
This documentation was written by Tom Hughes <tom@compton.demon.co.uk>
and was converted to StrongHelp format by David Croft <david@infotrek.demon.co.uk>.
It is searchable by SWI name or C function using Zap or StrongEd.
|
|
|