OpenSS7
SS7 for the
Common Man

© Copyright 1997-2004,OpenSS7 Corporation, All Rights Reserved.
Last modified:

Home Overview Status News Documentation Resources About
   
 Overview
 Status
 News
 Documentation
 Resources
 About

   
Home Index Prev Next More Download Info FAQ Mail   Home -> Resources -> Browse Source -> strss7/lib/libxnet/t_ioctl.c


File /code/strss7/lib/libxnet/t_ioctl.c



#ident "@(#) $RCSfile: t_ioctl.c,v $ $Name:  $($Revision: 0.8.2.1 $) $Date: 2003/05/27 11:21:51 $"

static char const ident[] = "$RCSfile: t_ioctl.c,v $ $Name:  $($Revision: 0.8.2.1 $) $Date: 2003/05/27 11:21:51 $";

#include <unistd.h>
#include <errno.h>
#include <sys/stropts.h>
#include <sys/ioctl.h>
#include <sys/xti.h>
#include "xti.h"

int t_ioctl(int fd, int cmd, void *arg)
{
	int ret;
	if (!(ret = ioctl(fd, cmd, arg)))
		return (0);
	if (ret < 0) {
		switch (errno) {
		case EBADF:
			t_errno = TBADF;
			break;
		default:
			t_errno = TSYSERR;
			break;
		}
		return (-1);
	}
	if (ret > 0) {
		if ((t_errno = ret & 0xff) == TSYSERR)
			errno = (ret >> 8) & 0xff;
		return (-1);
	}
	return (-1);
}

int t_strioctl(int fd, int cmd, void *arg, size_t arglen)
{
	struct strioctl ioc;
	ioc.ic_cmd = cmd;
	ioc.ic_timout = _T_TIMEOUT;
	ioc.ic_len = arglen;
	ioc.ic_dp = arg;
	return t_ioctl(fd, I_STR, &ioc);
}


Home Index Prev Next More Download Info FAQ Mail   Home -> Resources -> Browse Source -> strss7/lib/libxnet/t_ioctl.c

OpenSS7
SS7 for the
Common Man
Home Overview Status News Documentation Resources About

© Copyright 1997-2004,OpenSS7 Corporation, All Rights Reserved.
Last modified: