/* Automatically generated header! Do not edit! */

#ifndef _PPCPRAGMA_SOCKET_H
#define _PPCPRAGMA_SOCKET_H
#ifdef __GNUC__
#ifndef _PPCINLINE__SOCKET_H
#include <powerup/ppcinline/socket.h>
#endif
#else

#ifndef POWERUP_PPCLIB_INTERFACE_H
#include <powerup/ppclib/interface.h>
#endif

#ifndef POWERUP_GCCLIB_PROTOS_H
#include <powerup/gcclib/powerup_protos.h>
#endif

#ifndef NO_PPCINLINE_STDARG
#define NO_PPCINLINE_STDARG
#endif/* SAS C PPC inlines */

#ifndef SOCKET_BASE_NAME
#define SOCKET_BASE_NAME SocketBase
#endif /* !SOCKET_BASE_NAME */

#define	CloseSocket(d)	_CloseSocket(SOCKET_BASE_NAME, d)

static __inline LONG
_CloseSocket(void *SocketBase, LONG d)
{
struct Caos	MyCaos;
	MyCaos.M68kCacheMode	=	IF_CACHEFLUSHALL;
//	MyCaos.M68kStart	=	NULL;
//	MyCaos.M68kSize		=	0;
	MyCaos.PPCCacheMode	=	IF_CACHEFLUSHALL;
//	MyCaos.PPCStart		=	NULL;
//	MyCaos.PPCSize		=	0;
	MyCaos.d0		=(ULONG) d;
	MyCaos.caos_Un.Offset	=	(-120);
	MyCaos.a6		=(ULONG) SocketBase;	
	return((LONG)PPCCallOS(&MyCaos));
}

#define	Dup2Socket(fd1, fd2)	_Dup2Socket(SOCKET_BASE_NAME, fd1, fd2)

static __inline LONG
_Dup2Socket(void *SocketBase, LONG fd1, LONG fd2)
{
struct Caos	MyCaos;
	MyCaos.M68kCacheMode	=	IF_CACHEFLUSHALL;
//	MyCaos.M68kStart	=	NULL;
//	MyCaos.M68kSize		=	0;
	MyCaos.PPCCacheMode	=	IF_CACHEFLUSHALL;
//	MyCaos.PPCStart		=	NULL;
//	MyCaos.PPCSize		=	0;
	MyCaos.d0		=(ULONG) fd1;
	MyCaos.d1		=(ULONG) fd2;
	MyCaos.caos_Un.Offset	=	(-264);
	MyCaos.a6		=(ULONG) SocketBase;	
	return((LONG)PPCCallOS(&MyCaos));
}

#define	Errno()	_Errno(SOCKET_BASE_NAME)

static __inline LONG
_Errno(void *SocketBase)
{
struct Caos	MyCaos;
	MyCaos.M68kCacheMode	=	IF_CACHEFLUSHALL;
//	MyCaos.M68kStart	=	NULL;
//	MyCaos.M68kSize		=	0;
	MyCaos.PPCCacheMode	=	IF_CACHEFLUSHALL;
//	MyCaos.PPCStart		=	NULL;
//	MyCaos.PPCSize		=	0;
	MyCaos.caos_Un.Offset	=	(-162);
	MyCaos.a6		=(ULONG) SocketBase;	
	return((LONG)PPCCallOS(&MyCaos));
}

#define	GetSocketEvents(eventmaskp)	_GetSocketEvents(SOCKET_BASE_NAME, eventmaskp)

static __inline LONG
_GetSocketEvents(void *SocketBase, ULONG *eventmaskp)
{
struct Caos	MyCaos;
	MyCaos.M68kCacheMode	=	IF_CACHEFLUSHALL;
//	MyCaos.M68kStart	=	NULL;
//	MyCaos.M68kSize		=	0;
	MyCaos.PPCCacheMode	=	IF_CACHEFLUSHALL;
//	MyCaos.PPCStart		=	NULL;
//	MyCaos.PPCSize		=	0;
	MyCaos.a0		=(ULONG) eventmaskp;
	MyCaos.caos_Un.Offset	=	(-300);
	MyCaos.a6		=(ULONG) SocketBase;	
	return((LONG)PPCCallOS(&MyCaos));
}

#define	Inet_LnaOf(in)	_Inet_LnaOf(SOCKET_BASE_NAME, in)

static __inline ULONG
_Inet_LnaOf(void *SocketBase, LONG in)
{
struct Caos	MyCaos;
	MyCaos.M68kCacheMode	=	IF_CACHEFLUSHALL;
//	MyCaos.M68kStart	=	NULL;
//	MyCaos.M68kSize		=	0;
	MyCaos.PPCCacheMode	=	IF_CACHEFLUSHALL;
//	MyCaos.PPCStart		=	NULL;
//	MyCaos.PPCSize		=	0;
	MyCaos.d0		=(ULONG) in;
	MyCaos.caos_Un.Offset	=	(-186);
	MyCaos.a6		=(ULONG) SocketBase;	
	return((ULONG)PPCCallOS(&MyCaos));
}

#define	Inet_MakeAddr(net, host)	_Inet_MakeAddr(SOCKET_BASE_NAME, net, host)

static __inline ULONG
_Inet_MakeAddr(void *SocketBase, ULONG net, ULONG host)
{
struct Caos	MyCaos;
	MyCaos.M68kCacheMode	=	IF_CACHEFLUSHALL;
//	MyCaos.M68kStart	=	NULL;
//	MyCaos.M68kSize		=	0;
	MyCaos.PPCCacheMode	=	IF_CACHEFLUSHALL;
//	MyCaos.PPCStart		=	NULL;
//	MyCaos.PPCSize		=	0;
	MyCaos.d0		=(ULONG) net;
	MyCaos.d1		=(ULONG) host;
	MyCaos.caos_Un.Offset	=	(-198);
	MyCaos.a6		=(ULONG) SocketBase;	
	return((ULONG)PPCCallOS(&MyCaos));
}

#define	Inet_NetOf(in)	_Inet_NetOf(SOCKET_BASE_NAME, in)

static __inline ULONG
_Inet_NetOf(void *SocketBase, LONG in)
{
struct Caos	MyCaos;
	MyCaos.M68kCacheMode	=	IF_CACHEFLUSHALL;
//	MyCaos.M68kStart	=	NULL;
//	MyCaos.M68kSize		=	0;
	MyCaos.PPCCacheMode	=	IF_CACHEFLUSHALL;
//	MyCaos.PPCStart		=	NULL;
//	MyCaos.PPCSize		=	0;
	MyCaos.d0		=(ULONG) in;
	MyCaos.caos_Un.Offset	=	(-192);
	MyCaos.a6		=(ULONG) SocketBase;	
	return((ULONG)PPCCallOS(&MyCaos));
}

#define	Inet_NtoA(in)	_Inet_NtoA(SOCKET_BASE_NAME, in)

static __inline char *
_Inet_NtoA(void *SocketBase, ULONG in)
{
struct Caos	MyCaos;
	MyCaos.M68kCacheMode	=	IF_CACHEFLUSHALL;
//	MyCaos.M68kStart	=	NULL;
//	MyCaos.M68kSize		=	0;
	MyCaos.PPCCacheMode	=	IF_CACHEFLUSHALL;
//	MyCaos.PPCStart		=	NULL;
//	MyCaos.PPCSize		=	0;
	MyCaos.d0		=(ULONG) in;
	MyCaos.caos_Un.Offset	=	(-174);
	MyCaos.a6		=(ULONG) SocketBase;	
	return((char *)PPCCallOS(&MyCaos));
}

#define	IoctlSocket(d, request, argp)	_IoctlSocket(SOCKET_BASE_NAME, d, request, argp)

static __inline LONG
_IoctlSocket(void *SocketBase, LONG d, ULONG request, char *argp)
{
struct Caos	MyCaos;
	MyCaos.M68kCacheMode	=	IF_CACHEFLUSHALL;
//	MyCaos.M68kStart	=	NULL;
//	MyCaos.M68kSize		=	0;
	MyCaos.PPCCacheMode	=	IF_CACHEFLUSHALL;
//	MyCaos.PPCStart		=	NULL;
//	MyCaos.PPCSize		=	0;
	MyCaos.d0		=(ULONG) d;
	MyCaos.d1		=(ULONG) request;
	MyCaos.a0		=(ULONG) argp;
	MyCaos.caos_Un.Offset	=	(-114);
	MyCaos.a6		=(ULONG) SocketBase;	
	return((LONG)PPCCallOS(&MyCaos));
}

#define	ObtainSocket(id, domain, type, protocol)	_ObtainSocket(SOCKET_BASE_NAME, id, domain, type, protocol)

static __inline LONG
_ObtainSocket(void *SocketBase, LONG id, LONG domain, LONG type, LONG protocol)
{
struct Caos	MyCaos;
	MyCaos.M68kCacheMode	=	IF_CACHEFLUSHALL;
//	MyCaos.M68kStart	=	NULL;
//	MyCaos.M68kSize		=	0;
	MyCaos.PPCCacheMode	=	IF_CACHEFLUSHALL;
//	MyCaos.PPCStart		=	NULL;
//	MyCaos.PPCSize		=	0;
	MyCaos.d0		=(ULONG) id;
	MyCaos.d1		=(ULONG) domain;
	MyCaos.d2		=(ULONG) type;
	MyCaos.d3		=(ULONG) protocol;
	MyCaos.caos_Un.Offset	=	(-144);
	MyCaos.a6		=(ULONG) SocketBase;	
	return((LONG)PPCCallOS(&MyCaos));
}

#define	ReleaseCopyOfSocket(fd, id)	_ReleaseCopyOfSocket(SOCKET_BASE_NAME, fd, id)

static __inline LONG
_ReleaseCopyOfSocket(void *SocketBase, LONG fd, LONG id)
{
struct Caos	MyCaos;
	MyCaos.M68kCacheMode	=	IF_CACHEFLUSHALL;
//	MyCaos.M68kStart	=	NULL;
//	MyCaos.M68kSize		=	0;
	MyCaos.PPCCacheMode	=	IF_CACHEFLUSHALL;
//	MyCaos.PPCStart		=	NULL;
//	MyCaos.PPCSize		=	0;
	MyCaos.d0		=(ULONG) fd;
	MyCaos.d1		=(ULONG) id;
	MyCaos.caos_Un.Offset	=	(-156);
	MyCaos.a6		=(ULONG) SocketBase;	
	return((LONG)PPCCallOS(&MyCaos));
}

#define	ReleaseSocket(fd, id)	_ReleaseSocket(SOCKET_BASE_NAME, fd, id)

static __inline LONG
_ReleaseSocket(void *SocketBase, LONG fd, LONG id)
{
struct Caos	MyCaos;
	MyCaos.M68kCacheMode	=	IF_CACHEFLUSHALL;
//	MyCaos.M68kStart	=	NULL;
//	MyCaos.M68kSize		=	0;
	MyCaos.PPCCacheMode	=	IF_CACHEFLUSHALL;
//	MyCaos.PPCStart		=	NULL;
//	MyCaos.PPCSize		=	0;
	MyCaos.d0		=(ULONG) fd;
	MyCaos.d1		=(ULONG) id;
	MyCaos.caos_Un.Offset	=	(-150);
	MyCaos.a6		=(ULONG) SocketBase;	
	return((LONG)PPCCallOS(&MyCaos));
}

#define	SetErrnoPtr(errno_p, size)	_SetErrnoPtr(SOCKET_BASE_NAME, errno_p, size)

static __inline LONG
_SetErrnoPtr(void *SocketBase, void *errno_p, LONG size)
{
struct Caos	MyCaos;
	MyCaos.M68kCacheMode	=	IF_CACHEFLUSHALL;
//	MyCaos.M68kStart	=	NULL;
//	MyCaos.M68kSize		=	0;
	MyCaos.PPCCacheMode	=	IF_CACHEFLUSHALL;
//	MyCaos.PPCStart		=	NULL;
//	MyCaos.PPCSize		=	0;
	MyCaos.a0		=(ULONG) errno_p;
	MyCaos.d0		=(ULONG) size;
	MyCaos.caos_Un.Offset	=	(-168);
	MyCaos.a6		=(ULONG) SocketBase;	
	return((LONG)PPCCallOS(&MyCaos));
}

#define	SetSocketSignals(SIGINTR, SIGIO, SIGURG)	_SetSocketSignals(SOCKET_BASE_NAME, SIGINTR, SIGIO, SIGURG)

static __inline void
_SetSocketSignals(void *SocketBase, ULONG SIGINTR, ULONG SIGIO, ULONG SIGURG)
{
struct Caos	MyCaos;
	MyCaos.M68kCacheMode	=	IF_CACHEFLUSHALL;
//	MyCaos.M68kStart	=	NULL;
//	MyCaos.M68kSize		=	0;
	MyCaos.PPCCacheMode	=	IF_CACHEFLUSHALL;
//	MyCaos.PPCStart		=	NULL;
//	MyCaos.PPCSize		=	0;
	MyCaos.d0		=(ULONG) SIGINTR;
	MyCaos.d1		=(ULONG) SIGIO;
	MyCaos.d2		=(ULONG) SIGURG;
	MyCaos.caos_Un.Offset	=	(-132);
	MyCaos.a6		=(ULONG) SocketBase;	
	PPCCallOS(&MyCaos);
}

#define	SocketBaseTagList(taglist)	_SocketBaseTagList(SOCKET_BASE_NAME, taglist)

static __inline LONG
_SocketBaseTagList(void *SocketBase, struct TagItem *taglist)
{
struct Caos	MyCaos;
	MyCaos.M68kCacheMode	=	IF_CACHEFLUSHALL;
//	MyCaos.M68kStart	=	NULL;
//	MyCaos.M68kSize		=	0;
	MyCaos.PPCCacheMode	=	IF_CACHEFLUSHALL;
//	MyCaos.PPCStart		=	NULL;
//	MyCaos.PPCSize		=	0;
	MyCaos.a0		=(ULONG) taglist;
	MyCaos.caos_Un.Offset	=	(-294);
	MyCaos.a6		=(ULONG) SocketBase;	
	return((LONG)PPCCallOS(&MyCaos));
}

#ifndef NO_PPCINLINE_STDARG
#define SocketBaseTags(tags...) \
	({ULONG _tags[] = { tags }; SocketBaseTagList((struct TagItem *)_tags);})
#endif /* !NO_PPCINLINE_STDARG */

#define	WaitSelect(nfds, readfds, writefds, execptfds, timeout, maskp)	_WaitSelect(SOCKET_BASE_NAME, nfds, readfds, writefds, execptfds, timeout, maskp)

static __inline LONG
_WaitSelect(void *SocketBase, LONG nfds, fd_set *readfds, fd_set *writefds, fd_set *execptfds, struct timeval *timeout, ULONG *maskp)
{
struct Caos	MyCaos;
	MyCaos.M68kCacheMode	=	IF_CACHEFLUSHALL;
//	MyCaos.M68kStart	=	NULL;
//	MyCaos.M68kSize		=	0;
	MyCaos.PPCCacheMode	=	IF_CACHEFLUSHALL;
//	MyCaos.PPCStart		=	NULL;
//	MyCaos.PPCSize		=	0;
	MyCaos.d0		=(ULONG) nfds;
	MyCaos.a0		=(ULONG) readfds;
	MyCaos.a1		=(ULONG) writefds;
	MyCaos.a2		=(ULONG) execptfds;
	MyCaos.a3		=(ULONG) timeout;
	MyCaos.d1		=(ULONG) maskp;
	MyCaos.caos_Un.Offset	=	(-126);
	MyCaos.a6		=(ULONG) SocketBase;	
	return((LONG)PPCCallOS(&MyCaos));
}

#define	accept(s, addr, addrlen)	_accept(SOCKET_BASE_NAME, s, addr, addrlen)

static __inline LONG
_accept(void *SocketBase, LONG s, struct sockaddr *addr, LONG *addrlen)
{
struct Caos	MyCaos;
	MyCaos.M68kCacheMode	=	IF_CACHEFLUSHALL;
//	MyCaos.M68kStart	=	NULL;
//	MyCaos.M68kSize		=	0;
	MyCaos.PPCCacheMode	=	IF_CACHEFLUSHALL;
//	MyCaos.PPCStart		=	NULL;
//	MyCaos.PPCSize		=	0;
	MyCaos.d0		=(ULONG) s;
	MyCaos.a0		=(ULONG) addr;
	MyCaos.a1		=(ULONG) addrlen;
	MyCaos.caos_Un.Offset	=	(-48);
	MyCaos.a6		=(ULONG) SocketBase;	
	return((LONG)PPCCallOS(&MyCaos));
}

#define	bind(s, name, namelen)	_bind(SOCKET_BASE_NAME, s, name, namelen)

static __inline LONG
_bind(void *SocketBase, LONG s, const struct sockaddr *name, LONG namelen)
{
struct Caos	MyCaos;
	MyCaos.M68kCacheMode	=	IF_CACHEFLUSHALL;
//	MyCaos.M68kStart	=	NULL;
//	MyCaos.M68kSize		=	0;
	MyCaos.PPCCacheMode	=	IF_CACHEFLUSHALL;
//	MyCaos.PPCStart		=	NULL;
//	MyCaos.PPCSize		=	0;
	MyCaos.d0		=(ULONG) s;
	MyCaos.a0		=(ULONG) name;
	MyCaos.d1		=(ULONG) namelen;
	MyCaos.caos_Un.Offset	=	(-36);
	MyCaos.a6		=(ULONG) SocketBase;	
	return((LONG)PPCCallOS(&MyCaos));
}

#define	connect(s, name, namelen)	_connect(SOCKET_BASE_NAME, s, name, namelen)

static __inline LONG
_connect(void *SocketBase, LONG s, const struct sockaddr *name, LONG namelen)
{
struct Caos	MyCaos;
	MyCaos.M68kCacheMode	=	IF_CACHEFLUSHALL;
//	MyCaos.M68kStart	=	NULL;
//	MyCaos.M68kSize		=	0;
	MyCaos.PPCCacheMode	=	IF_CACHEFLUSHALL;
//	MyCaos.PPCStart		=	NULL;
//	MyCaos.PPCSize		=	0;
	MyCaos.d0		=(ULONG) s;
	MyCaos.a0		=(ULONG) name;
	MyCaos.d1		=(ULONG) namelen;
	MyCaos.caos_Un.Offset	=	(-54);
	MyCaos.a6		=(ULONG) SocketBase;	
	return((LONG)PPCCallOS(&MyCaos));
}

#define	getdtablesize()	_getdtablesize(SOCKET_BASE_NAME)

static __inline LONG
_getdtablesize(void *SocketBase)
{
struct Caos	MyCaos;
	MyCaos.M68kCacheMode	=	IF_CACHEFLUSHALL;
//	MyCaos.M68kStart	=	NULL;
//	MyCaos.M68kSize		=	0;
	MyCaos.PPCCacheMode	=	IF_CACHEFLUSHALL;
//	MyCaos.PPCStart		=	NULL;
//	MyCaos.PPCSize		=	0;
	MyCaos.caos_Un.Offset	=	(-138);
	MyCaos.a6		=(ULONG) SocketBase;	
	return((LONG)PPCCallOS(&MyCaos));
}

#define	gethostbyaddr(addr, len, type)	_gethostbyaddr(SOCKET_BASE_NAME, addr, len, type)

static __inline struct hostent  *
_gethostbyaddr(void *SocketBase, const UBYTE *addr, LONG len, LONG type)
{
struct Caos	MyCaos;
	MyCaos.M68kCacheMode	=	IF_CACHEFLUSHALL;
//	MyCaos.M68kStart	=	NULL;
//	MyCaos.M68kSize		=	0;
	MyCaos.PPCCacheMode	=	IF_CACHEFLUSHALL;
//	MyCaos.PPCStart		=	NULL;
//	MyCaos.PPCSize		=	0;
	MyCaos.a0		=(ULONG) addr;
	MyCaos.d0		=(ULONG) len;
	MyCaos.d1		=(ULONG) type;
	MyCaos.caos_Un.Offset	=	(-216);
	MyCaos.a6		=(ULONG) SocketBase;	
	return((struct hostent  *)PPCCallOS(&MyCaos));
}

#define	gethostbyname(name)	_gethostbyname(SOCKET_BASE_NAME, (unsigned char *)name)

static __inline struct hostent  *
_gethostbyname(void *SocketBase, const UBYTE *name)
{
struct Caos	MyCaos;
	MyCaos.M68kCacheMode	=	IF_CACHEFLUSHALL;
//	MyCaos.M68kStart	=	NULL;
//	MyCaos.M68kSize		=	0;
	MyCaos.PPCCacheMode	=	IF_CACHEFLUSHALL;
//	MyCaos.PPCStart		=	NULL;
//	MyCaos.PPCSize		=	0;
	MyCaos.a0		=(ULONG) name;
	MyCaos.caos_Un.Offset	=	(-210);
	MyCaos.a6		=(ULONG) SocketBase;	
	return((struct hostent  *)PPCCallOS(&MyCaos));
}

#define	gethostid()	_gethostid(SOCKET_BASE_NAME)

static __inline ULONG
_gethostid(void *SocketBase)
{
struct Caos	MyCaos;
	MyCaos.M68kCacheMode	=	IF_CACHEFLUSHALL;
//	MyCaos.M68kStart	=	NULL;
//	MyCaos.M68kSize		=	0;
	MyCaos.PPCCacheMode	=	IF_CACHEFLUSHALL;
//	MyCaos.PPCStart		=	NULL;
//	MyCaos.PPCSize		=	0;
	MyCaos.caos_Un.Offset	=	(-288);
	MyCaos.a6		=(ULONG) SocketBase;	
	return((ULONG)PPCCallOS(&MyCaos));
}

#define	gethostname(hostname, size)	_gethostname(SOCKET_BASE_NAME, hostname, size)

static __inline LONG
_gethostname(void *SocketBase, STRPTR hostname, LONG size)
{
struct Caos	MyCaos;
	MyCaos.M68kCacheMode	=	IF_CACHEFLUSHALL;
//	MyCaos.M68kStart	=	NULL;
//	MyCaos.M68kSize		=	0;
	MyCaos.PPCCacheMode	=	IF_CACHEFLUSHALL;
//	MyCaos.PPCStart		=	NULL;
//	MyCaos.PPCSize		=	0;
	MyCaos.a0		=(ULONG) hostname;
	MyCaos.d0		=(ULONG) size;
	MyCaos.caos_Un.Offset	=	(-282);
	MyCaos.a6		=(ULONG) SocketBase;	
	return((LONG)PPCCallOS(&MyCaos));
}

#define	getnetbyaddr(net, type)	_getnetbyaddr(SOCKET_BASE_NAME, net, type)

static __inline struct netent   *
_getnetbyaddr(void *SocketBase, LONG net, LONG type)
{
struct Caos	MyCaos;
	MyCaos.M68kCacheMode	=	IF_CACHEFLUSHALL;
//	MyCaos.M68kStart	=	NULL;
//	MyCaos.M68kSize		=	0;
	MyCaos.PPCCacheMode	=	IF_CACHEFLUSHALL;
//	MyCaos.PPCStart		=	NULL;
//	MyCaos.PPCSize		=	0;
	MyCaos.d0		=(ULONG) net;
	MyCaos.d1		=(ULONG) type;
	MyCaos.caos_Un.Offset	=	(-228);
	MyCaos.a6		=(ULONG) SocketBase;	
	return((struct netent   *)PPCCallOS(&MyCaos));
}

#define	getnetbyname(name)	_getnetbyname(SOCKET_BASE_NAME, name)

static __inline struct netent   *
_getnetbyname(void *SocketBase, const UBYTE *name)
{
struct Caos	MyCaos;
	MyCaos.M68kCacheMode	=	IF_CACHEFLUSHALL;
//	MyCaos.M68kStart	=	NULL;
//	MyCaos.M68kSize		=	0;
	MyCaos.PPCCacheMode	=	IF_CACHEFLUSHALL;
//	MyCaos.PPCStart		=	NULL;
//	MyCaos.PPCSize		=	0;
	MyCaos.a0		=(ULONG) name;
	MyCaos.caos_Un.Offset	=	(-222);
	MyCaos.a6		=(ULONG) SocketBase;	
	return((struct netent   *)PPCCallOS(&MyCaos));
}

#define	getpeername(s, hostname, namelen)	_getpeername(SOCKET_BASE_NAME, s, hostname, namelen)

static __inline LONG
_getpeername(void *SocketBase, LONG s, struct sockaddr *hostname, LONG *namelen)
{
struct Caos	MyCaos;
	MyCaos.M68kCacheMode	=	IF_CACHEFLUSHALL;
//	MyCaos.M68kStart	=	NULL;
//	MyCaos.M68kSize		=	0;
	MyCaos.PPCCacheMode	=	IF_CACHEFLUSHALL;
//	MyCaos.PPCStart		=	NULL;
//	MyCaos.PPCSize		=	0;
	MyCaos.d0		=(ULONG) s;
	MyCaos.a0		=(ULONG) hostname;
	MyCaos.a1		=(ULONG) namelen;
	MyCaos.caos_Un.Offset	=	(-108);
	MyCaos.a6		=(ULONG) SocketBase;	
	return((LONG)PPCCallOS(&MyCaos));
}

#define	getprotobyname(name)	_getprotobyname(SOCKET_BASE_NAME, name)

static __inline struct protoent *
_getprotobyname(void *SocketBase, const UBYTE *name)
{
struct Caos	MyCaos;
	MyCaos.M68kCacheMode	=	IF_CACHEFLUSHALL;
//	MyCaos.M68kStart	=	NULL;
//	MyCaos.M68kSize		=	0;
	MyCaos.PPCCacheMode	=	IF_CACHEFLUSHALL;
//	MyCaos.PPCStart		=	NULL;
//	MyCaos.PPCSize		=	0;
	MyCaos.a0		=(ULONG) name;
	MyCaos.caos_Un.Offset	=	(-246);
	MyCaos.a6		=(ULONG) SocketBase;	
	return((struct protoent *)PPCCallOS(&MyCaos));
}

#define	getprotobynumber(proto)	_getprotobynumber(SOCKET_BASE_NAME, proto)

static __inline struct protoent *
_getprotobynumber(void *SocketBase, LONG proto)
{
struct Caos	MyCaos;
	MyCaos.M68kCacheMode	=	IF_CACHEFLUSHALL;
//	MyCaos.M68kStart	=	NULL;
//	MyCaos.M68kSize		=	0;
	MyCaos.PPCCacheMode	=	IF_CACHEFLUSHALL;
//	MyCaos.PPCStart		=	NULL;
//	MyCaos.PPCSize		=	0;
	MyCaos.d0		=(ULONG) proto;
	MyCaos.caos_Un.Offset	=	(-252);
	MyCaos.a6		=(ULONG) SocketBase;	
	return((struct protoent *)PPCCallOS(&MyCaos));
}

#define	getservbyname(name, proto)	_getservbyname(SOCKET_BASE_NAME, name, proto)

static __inline struct servent  *
_getservbyname(void *SocketBase, const UBYTE *name, const UBYTE *proto)
{
struct Caos	MyCaos;
	MyCaos.M68kCacheMode	=	IF_CACHEFLUSHALL;
//	MyCaos.M68kStart	=	NULL;
//	MyCaos.M68kSize		=	0;
	MyCaos.PPCCacheMode	=	IF_CACHEFLUSHALL;
//	MyCaos.PPCStart		=	NULL;
//	MyCaos.PPCSize		=	0;
	MyCaos.a0		=(ULONG) name;
	MyCaos.a1		=(ULONG) proto;
	MyCaos.caos_Un.Offset	=	(-234);
	MyCaos.a6		=(ULONG) SocketBase;	
	return((struct servent  *)PPCCallOS(&MyCaos));
}

#define	getservbyport(port, proto)	_getservbyport(SOCKET_BASE_NAME, port, proto)

static __inline struct servent  *
_getservbyport(void *SocketBase, LONG port, const UBYTE *proto)
{
struct Caos	MyCaos;
	MyCaos.M68kCacheMode	=	IF_CACHEFLUSHALL;
//	MyCaos.M68kStart	=	NULL;
//	MyCaos.M68kSize		=	0;
	MyCaos.PPCCacheMode	=	IF_CACHEFLUSHALL;
//	MyCaos.PPCStart		=	NULL;
//	MyCaos.PPCSize		=	0;
	MyCaos.d0		=(ULONG) port;
	MyCaos.a0		=(ULONG) proto;
	MyCaos.caos_Un.Offset	=	(-240);
	MyCaos.a6		=(ULONG) SocketBase;	
	return((struct servent  *)PPCCallOS(&MyCaos));
}

#define	getsockname(s, hostname, namelen)	_getsockname(SOCKET_BASE_NAME, s, hostname, namelen)

static __inline LONG
_getsockname(void *SocketBase, LONG s, struct sockaddr *hostname, LONG *namelen)
{
struct Caos	MyCaos;
	MyCaos.M68kCacheMode	=	IF_CACHEFLUSHALL;
//	MyCaos.M68kStart	=	NULL;
//	MyCaos.M68kSize		=	0;
	MyCaos.PPCCacheMode	=	IF_CACHEFLUSHALL;
//	MyCaos.PPCStart		=	NULL;
//	MyCaos.PPCSize		=	0;
	MyCaos.d0		=(ULONG) s;
	MyCaos.a0		=(ULONG) hostname;
	MyCaos.a1		=(ULONG) namelen;
	MyCaos.caos_Un.Offset	=	(-102);
	MyCaos.a6		=(ULONG) SocketBase;	
	return((LONG)PPCCallOS(&MyCaos));
}

#define	getsockopt(s, level, optname, optval, optlen)	_getsockopt(SOCKET_BASE_NAME, s, level, optname, optval, optlen)

static __inline LONG
_getsockopt(void *SocketBase, LONG s, LONG level, LONG optname, void *optval, LONG *optlen)
{
struct Caos	MyCaos;
	MyCaos.M68kCacheMode	=	IF_CACHEFLUSHALL;
//	MyCaos.M68kStart	=	NULL;
//	MyCaos.M68kSize		=	0;
	MyCaos.PPCCacheMode	=	IF_CACHEFLUSHALL;
//	MyCaos.PPCStart		=	NULL;
//	MyCaos.PPCSize		=	0;
	MyCaos.d0		=(ULONG) s;
	MyCaos.d1		=(ULONG) level;
	MyCaos.d2		=(ULONG) optname;
	MyCaos.a0		=(ULONG) optval;
	MyCaos.a1		=(ULONG) optlen;
	MyCaos.caos_Un.Offset	=	(-96);
	MyCaos.a6		=(ULONG) SocketBase;	
	return((LONG)PPCCallOS(&MyCaos));
}

#define	inet_addr(cp)	_inet_addr(SOCKET_BASE_NAME, (unsigned char *)cp)

static __inline ULONG
_inet_addr(void *SocketBase, const UBYTE *cp)
{
struct Caos	MyCaos;
	MyCaos.M68kCacheMode	=	IF_CACHEFLUSHALL;
//	MyCaos.M68kStart	=	NULL;
//	MyCaos.M68kSize		=	0;
	MyCaos.PPCCacheMode	=	IF_CACHEFLUSHALL;
//	MyCaos.PPCStart		=	NULL;
//	MyCaos.PPCSize		=	0;
	MyCaos.a0		=(ULONG) cp;
	MyCaos.caos_Un.Offset	=	(-180);
	MyCaos.a6		=(ULONG) SocketBase;	
	return((ULONG)PPCCallOS(&MyCaos));
}

#define	inet_network(cp)	_inet_network(SOCKET_BASE_NAME, cp)

static __inline ULONG
_inet_network(void *SocketBase, const UBYTE *cp)
{
struct Caos	MyCaos;
	MyCaos.M68kCacheMode	=	IF_CACHEFLUSHALL;
//	MyCaos.M68kStart	=	NULL;
//	MyCaos.M68kSize		=	0;
	MyCaos.PPCCacheMode	=	IF_CACHEFLUSHALL;
//	MyCaos.PPCStart		=	NULL;
//	MyCaos.PPCSize		=	0;
	MyCaos.a0		=(ULONG) cp;
	MyCaos.caos_Un.Offset	=	(-204);
	MyCaos.a6		=(ULONG) SocketBase;	
	return((ULONG)PPCCallOS(&MyCaos));
}

#define	listen(s, backlog)	_listen(SOCKET_BASE_NAME, s, backlog)

static __inline LONG
_listen(void *SocketBase, LONG s, LONG backlog)
{
struct Caos	MyCaos;
	MyCaos.M68kCacheMode	=	IF_CACHEFLUSHALL;
//	MyCaos.M68kStart	=	NULL;
//	MyCaos.M68kSize		=	0;
	MyCaos.PPCCacheMode	=	IF_CACHEFLUSHALL;
//	MyCaos.PPCStart		=	NULL;
//	MyCaos.PPCSize		=	0;
	MyCaos.d0		=(ULONG) s;
	MyCaos.d1		=(ULONG) backlog;
	MyCaos.caos_Un.Offset	=	(-42);
	MyCaos.a6		=(ULONG) SocketBase;	
	return((LONG)PPCCallOS(&MyCaos));
}

#define	recv(s, buf, len, flags)	_recv(SOCKET_BASE_NAME, s, buf, len, flags)

static __inline LONG
_recv(void *SocketBase, LONG s, UBYTE *buf, LONG len, LONG flags)
{
struct Caos	MyCaos;
	MyCaos.M68kCacheMode	=	IF_CACHEFLUSHALL;
//	MyCaos.M68kStart	=	NULL;
//	MyCaos.M68kSize		=	0;
	MyCaos.PPCCacheMode	=	IF_CACHEFLUSHALL;
//	MyCaos.PPCStart		=	NULL;
//	MyCaos.PPCSize		=	0;
	MyCaos.d0		=(ULONG) s;
	MyCaos.a0		=(ULONG) buf;
	MyCaos.d1		=(ULONG) len;
	MyCaos.d2		=(ULONG) flags;
	MyCaos.caos_Un.Offset	=	(-78);
	MyCaos.a6		=(ULONG) SocketBase;	
	return((LONG)PPCCallOS(&MyCaos));
}

#define	recvfrom(s, buf, len, flags, from, fromlen)	_recvfrom(SOCKET_BASE_NAME, s, buf, len, flags, from, fromlen)

static __inline LONG
_recvfrom(void *SocketBase, LONG s, UBYTE *buf, LONG len, LONG flags, struct sockaddr *from, LONG *fromlen)
{
struct Caos	MyCaos;
	MyCaos.M68kCacheMode	=	IF_CACHEFLUSHALL;
//	MyCaos.M68kStart	=	NULL;
//	MyCaos.M68kSize		=	0;
	MyCaos.PPCCacheMode	=	IF_CACHEFLUSHALL;
//	MyCaos.PPCStart		=	NULL;
//	MyCaos.PPCSize		=	0;
	MyCaos.d0		=(ULONG) s;
	MyCaos.a0		=(ULONG) buf;
	MyCaos.d1		=(ULONG) len;
	MyCaos.d2		=(ULONG) flags;
	MyCaos.a1		=(ULONG) from;
	MyCaos.a2		=(ULONG) fromlen;
	MyCaos.caos_Un.Offset	=	(-72);
	MyCaos.a6		=(ULONG) SocketBase;	
	return((LONG)PPCCallOS(&MyCaos));
}

#define	recvmsg(s, msg, flags)	_recvmsg(SOCKET_BASE_NAME, s, msg, flags)

static __inline LONG
_recvmsg(void *SocketBase, LONG s, struct msghdr *msg, LONG flags)
{
struct Caos	MyCaos;
	MyCaos.M68kCacheMode	=	IF_CACHEFLUSHALL;
//	MyCaos.M68kStart	=	NULL;
//	MyCaos.M68kSize		=	0;
	MyCaos.PPCCacheMode	=	IF_CACHEFLUSHALL;
//	MyCaos.PPCStart		=	NULL;
//	MyCaos.PPCSize		=	0;
	MyCaos.d0		=(ULONG) s;
	MyCaos.a0		=(ULONG) msg;
	MyCaos.d1		=(ULONG) flags;
	MyCaos.caos_Un.Offset	=	(-276);
	MyCaos.a6		=(ULONG) SocketBase;	
	return((LONG)PPCCallOS(&MyCaos));
}

#define	send(s, msg, len, flags)	_send(SOCKET_BASE_NAME, s, msg, len, flags)

static __inline LONG
_send(void *SocketBase, LONG s, const UBYTE *msg, LONG len, LONG flags)
{
struct Caos	MyCaos;
	MyCaos.M68kCacheMode	=	IF_CACHEFLUSHALL;
//	MyCaos.M68kStart	=	NULL;
//	MyCaos.M68kSize		=	0;
	MyCaos.PPCCacheMode	=	IF_CACHEFLUSHALL;
//	MyCaos.PPCStart		=	NULL;
//	MyCaos.PPCSize		=	0;
	MyCaos.d0		=(ULONG) s;
	MyCaos.a0		=(ULONG) msg;
	MyCaos.d1		=(ULONG) len;
	MyCaos.d2		=(ULONG) flags;
	MyCaos.caos_Un.Offset	=	(-66);
	MyCaos.a6		=(ULONG) SocketBase;	
	return((LONG)PPCCallOS(&MyCaos));
}

#define	sendmsg(s, msg, flags)	_sendmsg(SOCKET_BASE_NAME, s, msg, flags)

static __inline LONG
_sendmsg(void *SocketBase, LONG s, struct msghdr *msg, LONG flags)
{
struct Caos	MyCaos;
	MyCaos.M68kCacheMode	=	IF_CACHEFLUSHALL;
//	MyCaos.M68kStart	=	NULL;
//	MyCaos.M68kSize		=	0;
	MyCaos.PPCCacheMode	=	IF_CACHEFLUSHALL;
//	MyCaos.PPCStart		=	NULL;
//	MyCaos.PPCSize		=	0;
	MyCaos.d0		=(ULONG) s;
	MyCaos.a0		=(ULONG) msg;
	MyCaos.d1		=(ULONG) flags;
	MyCaos.caos_Un.Offset	=	(-270);
	MyCaos.a6		=(ULONG) SocketBase;	
	return((LONG)PPCCallOS(&MyCaos));
}

#define	sendto(s, msg, len, flags, to, tolen)	_sendto(SOCKET_BASE_NAME, s, msg, len, flags, to, tolen)

static __inline LONG
_sendto(void *SocketBase, LONG s, const UBYTE *msg, LONG len, LONG flags, const struct sockaddr *to, LONG tolen)
{
struct Caos	MyCaos;
	MyCaos.M68kCacheMode	=	IF_CACHEFLUSHALL;
//	MyCaos.M68kStart	=	NULL;
//	MyCaos.M68kSize		=	0;
	MyCaos.PPCCacheMode	=	IF_CACHEFLUSHALL;
//	MyCaos.PPCStart		=	NULL;
//	MyCaos.PPCSize		=	0;
	MyCaos.d0		=(ULONG) s;
	MyCaos.a0		=(ULONG) msg;
	MyCaos.d1		=(ULONG) len;
	MyCaos.d2		=(ULONG) flags;
	MyCaos.a1		=(ULONG) to;
	MyCaos.d3		=(ULONG) tolen;
	MyCaos.caos_Un.Offset	=	(-60);
	MyCaos.a6		=(ULONG) SocketBase;	
	return((LONG)PPCCallOS(&MyCaos));
}

#define	setsockopt(s, level, optname, optval, optlen)	_setsockopt(SOCKET_BASE_NAME, s, level, optname, optval, optlen)

static __inline LONG
_setsockopt(void *SocketBase, LONG s, LONG level, LONG optname, const void *optval, LONG optlen)
{
struct Caos	MyCaos;
	MyCaos.M68kCacheMode	=	IF_CACHEFLUSHALL;
//	MyCaos.M68kStart	=	NULL;
//	MyCaos.M68kSize		=	0;
	MyCaos.PPCCacheMode	=	IF_CACHEFLUSHALL;
//	MyCaos.PPCStart		=	NULL;
//	MyCaos.PPCSize		=	0;
	MyCaos.d0		=(ULONG) s;
	MyCaos.d1		=(ULONG) level;
	MyCaos.d2		=(ULONG) optname;
	MyCaos.a0		=(ULONG) optval;
	MyCaos.d3		=(ULONG) optlen;
	MyCaos.caos_Un.Offset	=	(-90);
	MyCaos.a6		=(ULONG) SocketBase;	
	return((LONG)PPCCallOS(&MyCaos));
}

#define	shutdown(s, how)	_shutdown(SOCKET_BASE_NAME, s, how)

static __inline LONG
_shutdown(void *SocketBase, LONG s, LONG how)
{
struct Caos	MyCaos;
	MyCaos.M68kCacheMode	=	IF_CACHEFLUSHALL;
//	MyCaos.M68kStart	=	NULL;
//	MyCaos.M68kSize		=	0;
	MyCaos.PPCCacheMode	=	IF_CACHEFLUSHALL;
//	MyCaos.PPCStart		=	NULL;
//	MyCaos.PPCSize		=	0;
	MyCaos.d0		=(ULONG) s;
	MyCaos.d1		=(ULONG) how;
	MyCaos.caos_Un.Offset	=	(-84);
	MyCaos.a6		=(ULONG) SocketBase;	
	return((LONG)PPCCallOS(&MyCaos));
}

#define	socket(domain, type, protocol)	_socket(SOCKET_BASE_NAME, domain, type, protocol)

static __inline LONG
_socket(void *SocketBase, LONG domain, LONG type, LONG protocol)
{
struct Caos	MyCaos;
	MyCaos.M68kCacheMode	=	IF_CACHEFLUSHALL;
//	MyCaos.M68kStart	=	NULL;
//	MyCaos.M68kSize		=	0;
	MyCaos.PPCCacheMode	=	IF_CACHEFLUSHALL;
//	MyCaos.PPCStart		=	NULL;
//	MyCaos.PPCSize		=	0;
	MyCaos.d0		=(ULONG) domain;
	MyCaos.d1		=(ULONG) type;
	MyCaos.d2		=(ULONG) protocol;
	MyCaos.caos_Un.Offset	=	(-30);
	MyCaos.a6		=(ULONG) SocketBase;	
	return((LONG)PPCCallOS(&MyCaos));
}

#define	vsyslog(level, format, ap)	_vsyslog(SOCKET_BASE_NAME, level, format, ap)

static __inline void
_vsyslog(void *SocketBase, ULONG level, const char *format, LONG *ap)
{
struct Caos	MyCaos;
	MyCaos.M68kCacheMode	=	IF_CACHEFLUSHALL;
//	MyCaos.M68kStart	=	NULL;
//	MyCaos.M68kSize		=	0;
	MyCaos.PPCCacheMode	=	IF_CACHEFLUSHALL;
//	MyCaos.PPCStart		=	NULL;
//	MyCaos.PPCSize		=	0;
	MyCaos.d0		=(ULONG) level;
	MyCaos.a0		=(ULONG) format;
	MyCaos.a1		=(ULONG) ap;
	MyCaos.caos_Un.Offset	=	(-258);
	MyCaos.a6		=(ULONG) SocketBase;	
	PPCCallOS(&MyCaos);
}

#endif /* SASC Pragmas */
#endif /* !_PPCPRAGMA_SOCKET_H */
