-
-#if UNIXWARE >= 7
-
-static const struct xlat sock_version[] = {
- { __NETLIB_UW211_SVR4, "UW211_SVR4" },
- { __NETLIB_UW211_XPG4, "UW211_XPG4" },
- { __NETLIB_GEMINI_SVR4, "GEMINI_SVR4" },
- { __NETLIB_GEMINI_XPG4, "GEMINI_XPG4" },
- { __NETLIB_FP1_SVR4, "FP1_SVR4" },
- { __NETLIB_FP1_XPG4, "FP1_XPG4" },
- { 0, NULL },
-};
-
-
-int
-netlib_call(struct tcb *tcp, int (*func)())
-{
- if (entering(tcp)) {
- int i;
- printxval(sock_version, tcp->u_arg[0], "__NETLIB_???");
- tprintf(", ");
- --tcp->u_nargs;
- for (i = 0; i < tcp->u_nargs; i++)
- tcp->u_arg[i] = tcp->u_arg[i + 1];
- return func(tcp);
- }
-
- return func(tcp);
-}
-
-int
-sys_xsocket(struct tcb *tcp)
-{
- return netlib_call(tcp, sys_socket);
-}
-
-int
-sys_xsocketpair(struct tcb *tcp)
-{
- return netlib_call(tcp, sys_socketpair);
-}
-
-int
-sys_xbind(struct tcb *tcp)
-{
- return netlib_call(tcp, sys_bind);
-}
-
-int
-sys_xconnect(struct tcb *tcp)
-{
- return netlib_call(tcp, sys_connect);
-}
-
-int
-sys_xlisten(struct tcb *tcp)
-{
- return netlib_call(tcp, sys_listen);
-}
-
-int
-sys_xaccept(struct tcb *tcp)
-{
- return netlib_call(tcp, sys_accept);
-}
-
-int
-sys_xsendmsg(struct tcb *tcp)
-{
- return netlib_call(tcp, sys_sendmsg);
-}
-
-int
-sys_xrecvmsg(struct tcb *tcp)
-{
- return netlib_call(tcp, sys_recvmsg);
-}
-
-int
-sys_xgetsockaddr(struct tcb *tcp)
-{
- if (entering(tcp)) {
- printxval(sock_version, tcp->u_arg[0], "__NETLIB_???");
- tprintf(", ");
- if (tcp->u_arg[1] == 0) {
- tprintf("LOCALNAME, ");
- }
- else if (tcp->u_arg[1] == 1) {
- tprintf("REMOTENAME, ");
- }
- else {
- tprintf("%ld, ", tcp->u_arg[1]);
- }
- tprintf("%ld, ", tcp->u_arg[2]);
- }
- else {
- if (tcp->u_arg[3] == 0 || syserror(tcp)) {
- tprintf("%#lx", tcp->u_arg[3]);
- } else {
- printsock(tcp, tcp->u_arg[3], tcp->u_arg[4]);
- }
- tprintf(", ");
- printnum(tcp, tcp->u_arg[4], "%lu");
- }
-
- return 0;
-
-}
-
-int
-sys_xgetsockopt(struct tcb *tcp)
-{
- return netlib_call(tcp, sys_getsockopt);
-}
-
-int
-sys_xsetsockopt(struct tcb *tcp)
-{
- return netlib_call(tcp, sys_setsockopt);
-}
-
-int
-sys_xshutdown(struct tcb *tcp)
-{
- return netlib_call(tcp, sys_shutdown);
-}
-
-#endif /* UNIXWARE */