⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 int_osf2.c

📁 sock protocol ,it is useful!
💻 C
字号:
/* * Copyright (c) 1997, 1998, 1999 *      Inferno Nettverk A/S, Norway.  All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. The above copyright notice, this list of conditions and the following *    disclaimer must appear in all copies of the software, derivative works *    or modified versions, and any portions thereof, aswell as in all *    supporting documentation. * 2. All advertising materials mentioning features or use of this software *    must display the following acknowledgement: *      This product includes software developed by *      Inferno Nettverk A/S, Norway. * 3. The name of the author may not be used to endorse or promote products *    derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * Inferno Nettverk A/S requests users of this software to return to * *  Software Distribution Coordinator  or  sdc@inet.no *  Inferno Nettverk A/S *  Oslo Research Park *  Gaustadal閑n 21 *  N-0349 Oslo *  Norway * * any improvements or extensions that they make and grant Inferno Nettverk A/S * the rights to redistribute these changes. * */#include "common.h"#if HAVE_EXTRA_OSF_SYMBOLS#if SOCKSLIBRARY_DYNAMIC#include "interposition.h"static const char rcsid[] ="$Id: int_osf2.c,v 1.6 1999/12/11 16:36:09 karls Exp $";#undef accept#undef getpeername#undef getsockname#undef recvfrom#undef recvmsg#undef sendmsg	/* nfoo versions (with sockaddr len) of the system calls. */intsys_naccept(s, addr, addrlen)	int s;	struct sockaddr *addr;	socklen_t *addrlen;{	int rc;	int (*function)(int s, struct sockaddr *addr, socklen_t *addrlen);	SYSCALL_START(s);	function = symbolfunction(SYMBOL_NACCEPT);	rc = function(s, addr, addrlen);	SYSCALL_END(s);	return rc;}intsys_ngetpeername(s, name, namelen)	int s;	struct sockaddr *name;	socklen_t *namelen;{	int rc;	int (*function)(int s, const struct sockaddr *name, socklen_t *namelen);	SYSCALL_START(s);	function = symbolfunction(SYMBOL_NGETPEERNAME);	rc = function(s, name, namelen);	SYSCALL_END(s);	return rc;}intsys_ngetsockname(s, name, namelen)	int s;	struct sockaddr *name;	socklen_t *namelen;{	int rc;	int (*function)(int s, const struct sockaddr *name, socklen_t *namelen);	SYSCALL_START(s);	function = symbolfunction(SYMBOL_NGETSOCKNAME);	rc = function(s, name, namelen);	SYSCALL_END(s);	return rc;}intsys_nrecvfrom(s, buf, len, flags, from, fromlen)	int s;	void *buf;	size_t len;	int flags;	struct sockaddr *from;	size_t *fromlen;{	int rc;	int (*function)(int s, void *buf, size_t len, int flags,					    struct sockaddr *from, socklen_t *fromlen);	SYSCALL_START(s);	function = symbolfunction(SYMBOL_NRECVFROM);	rc = function(s, buf, len, flags, from, fromlen);	SYSCALL_END(s);	return rc;}ssize_tsys_nrecvmsg(s, msg, flags)	int s;	struct msghdr *msg;	int flags;{	ssize_t rc;	int (*function)(int s, struct msghdr *msg, int flags);	SYSCALL_START(s);	function = symbolfunction(SYMBOL_NRECVMSG);	rc = function(s, msg, flags);	SYSCALL_END(s);	return rc;}ssize_tsys_nsendmsg(s, msg, flags)	int s;	const struct msghdr *msg;	int flags;{	ssize_t rc;	int (*function)(int s, const struct msghdr *msg, int flags);	SYSCALL_START(s);	function = symbolfunction(SYMBOL_NSENDMSG);	rc = function(s, msg, flags);	SYSCALL_END(s);	return rc;}	/*	 * the interpositioned functions.	 */intnaccept(s, addr, addrlen)	int s;	struct sockaddr *addr;	socklen_t *addrlen;{	if (ISSYSCALL(s))		return sys_naccept(s, addr, addrlen);	return Raccept(s, addr, addrlen);}intngetpeername(s, name, namelen)	int s;	struct sockaddr *name;	socklen_t *namelen;{	if (ISSYSCALL(s))		return sys_ngetpeername(s, name, namelen);	return Rgetpeername(s, name, namelen);}intngetsockname(s, name, namelen)	int s;	struct sockaddr *name;	socklen_t *namelen;{	if (ISSYSCALL(s))		return sys_ngetpeername(s, name, namelen);	return Rgetsockname(s, name, namelen);}ssize_tnrecvfrom(s, buf, len, flags, from, fromlen)	int s;	void *buf;	size_t len;	int flags;	struct sockaddr *from;	size_t *fromlen;{	if (ISSYSCALL(s))		return sys_nrecvfrom(s, buf, len, flags, from, fromlen);	return Rrecvfrom(s, buf, len, flags, from, fromlen);}ssize_tnrecvmsg(s, msg, flags)	int s;	struct msghdr *msg;	int flags;{	if (ISSYSCALL(s))		return sys_nrecvmsg(s, msg, flags);	return Rrecvmsg(s, msg, flags);}ssize_tnsendmsg(s, msg, flags)	int s;	const struct msghdr *msg;	int flags;{	if (ISSYSCALL(s))		return sys_nsendmsg(s, msg, flags);	return Rsendmsg(s, msg, flags);}#endif /* SOCKSLIBRARY_DYNAMIC */#endif /* HAVE_EXTRA_OSF_SYMBOLS */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -