installed

This commit is contained in:
Jeff Hill
1996-11-02 01:36:25 +00:00
parent 3263a885a3
commit 5201df3dbc
9 changed files with 544 additions and 86 deletions
+15
View File
@@ -3,11 +3,18 @@
* Solaris specifif socket include
*/
#ifndef osiSockH
#define osiSockH
#ifdef __cplusplus
extern "C" {
#endif
#include <errno.h>
#include <sys/types.h>
#include <sys/param.h> /* for MAXHOSTNAMELEN */
#include <sys/time.h>
#include <sys/socket.h>
#include <sys/ioctl.h>
#include <sys/filio.h>
@@ -15,14 +22,22 @@ extern "C" {
#include <netinet/in.h>
#include <netinet/tcp.h>
#include <arpa/inet.h>
#include <netdb.h>
void ipAddrToA(const struct sockaddr_in *pInetAddr,
char *pBuf, const unsigned bufSize);
#ifdef __cplusplus
}
#endif
typedef int SOCKET;
#define INVALID_SOCKET (-1)
#define SOCKERRNO errno
#define socket_close(S) close(S)
#define socket_ioctl(A,B,C) ioctl(A,B,C)
#define FD_IN_FDSET(FD) ((FD)<FD_SETSIZE)
#endif /*osiSockH*/
+66 -43
View File
@@ -1,15 +1,18 @@
/*
* sun4 specific socket include
* sunos 4 specific socket include
*/
#ifndef SUNOS4
#errro this is a SUNOS4 specific socket include
#endif
#ifndef osiSockH
#define osiSockH
#ifdef __cplusplus
extern "C" {
#endif
#include <errno.h>
#include <sys/types.h>
#include <sys/time.h>
#include <sys/socket.h>
#include <sys/ioctl.h>
#include <netinet/in.h>
@@ -20,61 +23,81 @@ int close (int fd);
int gettimeofday (struct timeval *tp, struct timezone *tzp);
int gethostname (char *name, int namelen);
void ipAddrToA (const struct sockaddr_in *pInetAddr,
char *pBuf, const unsigned bufSize);
/*
* sun's CC defines at least a few of these under sunos4
*/
#if defined(__SUNPRO_CC)
#if defined(__SUNPRO_CC) || defined(__SUNPRO_C)
# include <arpa/inet.h>
#else
# include <netdb.h>
#else /* !defined(__SUNPRO_CC) && !defined(__SUNPRO_C) */
int listen (int socket, int backlog);
int accept (int socket, struct sockaddr *addr, int *addrlen);
int shutdown (int socket, int how);
int getpeername (int socket, struct sockaddr *name, int *namelen);
int connect (int socket, struct sockaddr *name, int namelen);
int setsockopt (int socket, int level, int optname,
char *optval, int optlen);
void bzero (char *b, int length);
int sendto (int socket, const char *buf, int len,
int flags, struct sockaddr *to, int tolen);
int select (int width, fd_set *readfds, fd_set *writefds,
fd_set *exceptfds, struct timeval *timeout);
int listen (int socket, int backlog);
int accept (int socket, struct sockaddr *addr, int *addrlen);
int shutdown (int socket, int how);
int getpeername (int socket, struct sockaddr *name, int *namelen);
int connect (int socket, struct sockaddr *name, int namelen);
int setsockopt (int socket, int level, int optname,
char *optval, int optlen);
void bzero (char *b, int length);
int sendto (int socket, const char *buf, int len,
int flags, struct sockaddr *to, int tolen);
int select (int width, fd_set *readfds, fd_set *writefds,
fd_set *exceptfds, struct timeval *timeout);
int bind (int socket, struct sockaddr *name, int namelen);
int send (int socket, const char *buf, int len, int flags);
int recv (int socket, char *buf, int len, int flags);
int getsockopt (int socket, int level, int optname,
char *optval, int *optlen);
int socket (int domain, int type, int protocol);
int recvfrom (int socket, char *buf, int len,
int flags, struct sockaddr *from, int *fromlen);
int getsockname (int socket, struct sockaddr *name, int *namelen);
int bind (int socket, struct sockaddr *name, int namelen);
int send (int socket, const char *buf, int len, int flags);
int recv (int socket, char *buf, int len, int flags);
int getsockopt (int socket, int level, int optname,
char *optval, int *optlen);
int socket (int domain, int type, int protocol);
int recvfrom (int socket, char *buf, int len,
int flags, struct sockaddr *from, int *fromlen);
int getsockname (int socket, struct sockaddr *name, int *namelen);
/*
* from /usr/include/arpa/inet.h
* (which under sunos4 does not include arguments for C++)
* (__SUNPRO_CC supplies this file but g++ does not supply
* an ansi protottype)
*/
unsigned long inet_addr (char *);
char * inet_ntoa (struct in_addr in);
/*
* from /usr/include/arpa/inet.h
* (which under sunos4 does not include arguments for C++)
* (__SUNPRO_CC supplies this file but g++ does not supply an ansi protottype)
*/
unsigned long inet_addr (char *);
char * inet_ntoa (struct in_addr in);
/*
* from /usr/include/netdb.h
* (which under sunos4 does not include arguments for C++)
* (__SUNPRO_CC supplies this file but g++ does not)
*/
struct hostent *gethostbyaddr(char *addr, int len, int type);
#endif /* !defined(__SUNPRO_CC) */
/*
* from /usr/include/netdb.h
* (which under sunos4 does not include arguments for C++)
* (__SUNPRO_CC supplies an updated version of this file but g++ does not)
*/
struct hostent {
char *h_name; /* official name of host */
char **h_aliases; /* alias list */
int h_addrtype; /* host address type */
int h_length; /* length of address */
char **h_addr_list; /* list of addresses from name server */
# define h_addr h_addr_list[0] /* address, for backward compatiblity */
};
struct hostent *gethostbyaddr(char *addr, int len, int type);
#endif /* !defined(__SUNPRO_CC) && !defined(__SUNPRO_C) */
#ifdef __cplusplus
}
#endif
typedef int SOCKET;
#define INVALID_SOCKET (-1)
#define SOCKERRNO errno
#define socket_close(S) close(S)
#define socket_ioctl(A,B,C) ioctl(A,B,C)
#ifndef MAXHOSTNAMELEN
#define MAXHOSTNAMELEN 64
#endif
#define FD_IN_FDSET(FD) ((FD)<FD_SETSIZE)
#endif /*osiSockH*/
+114
View File
@@ -0,0 +1,114 @@
/*
* vms specific socket include
*/
#ifndef osiSockH
#define osiSockH
#ifdef __cplusplus
extern "C" {
#endif
#include <sys/types.h>
#if !defined(UCX)
# include <tcp/errno.h>
# include <sys/time.h>
# include <sys/ioctl.h>
#else
# include <errno.h>
#endif
#include <sys/socket.h>
#include <netinet/in.h>
#include <netinet/tcp.h>
#include <netdb.h>
int ioctl (int fd, int req, ...);
int close (int fd);
int gettimeofday (struct timeval *tp, struct timezone *tzp);
int gethostname (char *name, int namelen);
/*
* MULTINET defines none of these
*/
int listen (int socket, int backlog);
int accept (int socket, struct sockaddr *addr, int *addrlen);
int shutdown (int socket, int how);
int getpeername (int socket, struct sockaddr *name, int *namelen);
int connect (int socket, struct sockaddr *name, int namelen);
int setsockopt (int socket, int level, int optname,
char *optval, int optlen);
void bzero (char *b, int length);
int sendto (int socket, const char *buf, int len,
int flags, struct sockaddr *to, int tolen);
int select (int width, fd_set *readfds, fd_set *writefds,
fd_set *exceptfds, struct timeval *timeout);
int bind (int socket, struct sockaddr *name, int namelen);
int send (int socket, const char *buf, int len, int flags);
int recv (int socket, char *buf, int len, int flags);
int getsockopt (int socket, int level, int optname,
char *optval, int *optlen);
int socket (int domain, int type, int protocol);
int recvfrom (int socket, char *buf, int len,
int flags, struct sockaddr *from, int *fromlen);
int getsockname (int socket, struct sockaddr *name, int *namelen);
unsigned long inet_addr (char *);
char * inet_ntoa (struct in_addr in);
struct hostent {
char *h_name; /* official name of host */
char **h_aliases; /* alias list */
int h_addrtype; /* host address type */
int h_length; /* length of address */
char **h_addr_list; /* list of addresses from name server */
#define h_addr h_addr_list[0] /* address, for backward compatiblity */
};
struct hostent *gethostbyaddr(char *addr, int len, int type);
void ipAddrToA (const struct sockaddr_in *pInetAddr,
char *pBuf, const unsigned bufSize);
#ifdef __cplusplus
}
#endif
typedef int SOCKET;
#define INVALID_SOCKET (-1)
#define socket_close(S) close(S)
#define socket_ioctl(A,B,C) ioctl(A,B,C)
#ifdef WINTCP
extern int uerrno;
# define SOCKERRNO uerrno
#else
# ifdef UCX
# define SOCKERRNO errno
# else
# define SOCKERRNO socket_errno
# endif
#endif
#if defined(WINTCP) /* Wallangong */
/* (the VAXC runtime lib has its own close */
# define socket_close(S) netclose(S)
# define socket_ioctl(A,B,C) ioctl(A,B,C)
#endif
#if defined(UCX) /* GeG 09-DEC-1992 */
# define socket_close(S) close(S)
# define socket_ioctl(A,B,C) ioctl(A,B,C)
#endif
# define POST_IO_EV
# define LOCK
# define UNLOCK
# define LOCKEVENTS
# define UNLOCKEVENTS
# define EVENTLOCKTEST (post_msg_active)
#endif
#define MAXHOSTNAMELEN 75
#define FD_IN_FDSET(FD) ((FD)<FD_SETSIZE)
#endif /*osiSockH*/
+126
View File
@@ -0,0 +1,126 @@
//
// osiMutex - OS independent mutex
// (vxWorks version)
//
//
// NOTES:
// 1) epicsPrintf() is used in this file because we cant stand
// the logMsg() 8 arg API amd we dont want the messages from different
// tasks to co-mingle
//
#include <semLib.h>
#include <epicsAssert.h>
#include <epicsPrint.h>
#define DEBUG_OSIMUTEX
#ifdef DEBUG_OSIMUTEX
#include <stdio.h>
#endif
#ifdef DEBUG_OSIMUTEX
#define osiLock() osiLockI (__FILE__, __LINE__)
#define osiUnlock() osiUnlockI (__FILE__, __LINE__)
#endif
class osiMutex {
public:
osiMutex()
{
mutex = NULL;
}
//
// constructor that returns status
// (since g++ does not have exceptions)
//
int init ()
{
this->mutex = semMCreate(SEM_Q_PRIORITY|SEM_INVERSION_SAFE);
if (this->mutex==NULL)
{
return -1;
}
# ifdef DEBUG_OSIMUTEX
epicsPrintf("created mutex at %lx\n",
(unsigned long) this->mutex);
# endif
return 0;
}
~osiMutex()
{
STATUS s;
s = semDelete (this->mutex);
assert (s==OK);
# ifdef DEBUG_OSIMUTEX
epicsPrintf("destroyed mutex at %lx\n",
(unsigned long) this->mutex);
# endif
}
#ifdef DEBUG_OSIMUTEX
void osiLockI(const char *pFN, unsigned ln)
#else
void osiLock()
#endif
{
STATUS s;
if (!this->mutex) {
# ifdef DEBUG_OSIMUTEX
epicsPrintf(
"osiMutex: lock request before init was ignored from %s at %u\n",
pFN, ln);
# else
epicsPrintf(
"osiMutex: lock request before init was ignored\n");
# endif
return;
}
assert(this->mutex);
s = semTake (this->mutex, WAIT_FOREVER);
assert (s==OK);
# ifdef DEBUG_OSIMUTEX
epicsPrintf("L%lx in %s at %u\n",
(unsigned long) this->mutex,
pFN, ln);
# endif
}
#ifdef DEBUG_OSIMUTEX
void osiUnlockI(const char *pFN, unsigned ln)
#else
void osiUnlock()
#endif
{
STATUS s;
if (!this->mutex) {
# ifdef DEBUG_OSIMUTEX
epicsPrintf(
"osiMutex: unlock request before init was ignored from %s at %u\n",
pFN, ln);
# else
epicsPrintf(
"osiMutex: unlock request before init was ignored\n");
# endif
return;
}
s = semGive (this->mutex);
assert (s==OK);
# ifdef DEBUG_OSIMUTEX
epicsPrintf("U%lx in %s at %d\n",
(unsigned long) this->mutex,
pFN, ln);
# endif
}
void show(unsigned level) const
{
semShow(this->mutex, (int) level);
}
private:
SEM_ID mutex;
};
+14
View File
@@ -2,11 +2,17 @@
* vxWorks specific socket include
*/
#ifndef osiSockH
#define osiSockH
#ifdef __cplusplus
extern "C" {
#endif
#include <errno.h>
#include <sys/types.h>
#include <sys/times.h>
#include <sys/socket.h>
#include <sockLib.h>
#include <sys/ioctl.h>
@@ -14,13 +20,21 @@ extern "C" {
#include <netinet/tcp.h>
#include <arpa/inet.h>
void ipAddrToA (const struct sockaddr_in *pInetAddr,
char *pBuf, const unsigned bufSize);
#ifdef __cplusplus
}
#endif
typedef int SOCKET;
#define INVALID_SOCKET (-1)
#define SOCKERRNO errno
#define socket_close(S) close(S)
#define socket_ioctl(A,B,C) ioctl(A,B,(int)C)
#define FD_IN_FDSET(FD) ((FD)<FD_SETSIZE)
#endif /*osiSockH*/
+114
View File
@@ -0,0 +1,114 @@
/*
* vms specific socket include
*/
#ifndef osiSockH
#define osiSockH
#ifdef __cplusplus
extern "C" {
#endif
#include <sys/types.h>
#if !defined(UCX)
# include <tcp/errno.h>
# include <sys/time.h>
# include <sys/ioctl.h>
#else
# include <errno.h>
#endif
#include <sys/socket.h>
#include <netinet/in.h>
#include <netinet/tcp.h>
#include <netdb.h>
int ioctl (int fd, int req, ...);
int close (int fd);
int gettimeofday (struct timeval *tp, struct timezone *tzp);
int gethostname (char *name, int namelen);
/*
* MULTINET defines none of these
*/
int listen (int socket, int backlog);
int accept (int socket, struct sockaddr *addr, int *addrlen);
int shutdown (int socket, int how);
int getpeername (int socket, struct sockaddr *name, int *namelen);
int connect (int socket, struct sockaddr *name, int namelen);
int setsockopt (int socket, int level, int optname,
char *optval, int optlen);
void bzero (char *b, int length);
int sendto (int socket, const char *buf, int len,
int flags, struct sockaddr *to, int tolen);
int select (int width, fd_set *readfds, fd_set *writefds,
fd_set *exceptfds, struct timeval *timeout);
int bind (int socket, struct sockaddr *name, int namelen);
int send (int socket, const char *buf, int len, int flags);
int recv (int socket, char *buf, int len, int flags);
int getsockopt (int socket, int level, int optname,
char *optval, int *optlen);
int socket (int domain, int type, int protocol);
int recvfrom (int socket, char *buf, int len,
int flags, struct sockaddr *from, int *fromlen);
int getsockname (int socket, struct sockaddr *name, int *namelen);
unsigned long inet_addr (char *);
char * inet_ntoa (struct in_addr in);
struct hostent {
char *h_name; /* official name of host */
char **h_aliases; /* alias list */
int h_addrtype; /* host address type */
int h_length; /* length of address */
char **h_addr_list; /* list of addresses from name server */
#define h_addr h_addr_list[0] /* address, for backward compatiblity */
};
struct hostent *gethostbyaddr(char *addr, int len, int type);
void ipAddrToA (const struct sockaddr_in *pInetAddr,
char *pBuf, const unsigned bufSize);
#ifdef __cplusplus
}
#endif
typedef int SOCKET;
#define INVALID_SOCKET (-1)
#define socket_close(S) close(S)
#define socket_ioctl(A,B,C) ioctl(A,B,C)
#ifdef WINTCP
extern int uerrno;
# define SOCKERRNO uerrno
#else
# ifdef UCX
# define SOCKERRNO errno
# else
# define SOCKERRNO socket_errno
# endif
#endif
#if defined(WINTCP) /* Wallangong */
/* (the VAXC runtime lib has its own close */
# define socket_close(S) netclose(S)
# define socket_ioctl(A,B,C) ioctl(A,B,C)
#endif
#if defined(UCX) /* GeG 09-DEC-1992 */
# define socket_close(S) close(S)
# define socket_ioctl(A,B,C) ioctl(A,B,C)
#endif
# define POST_IO_EV
# define LOCK
# define UNLOCK
# define LOCKEVENTS
# define UNLOCKEVENTS
# define EVENTLOCKTEST (post_msg_active)
#endif
#define MAXHOSTNAMELEN 75
#define FD_IN_FDSET(FD) ((FD)<FD_SETSIZE)
#endif /*osiSockH*/
+15
View File
@@ -3,11 +3,18 @@
* Solaris specifif socket include
*/
#ifndef osiSockH
#define osiSockH
#ifdef __cplusplus
extern "C" {
#endif
#include <errno.h>
#include <sys/types.h>
#include <sys/param.h> /* for MAXHOSTNAMELEN */
#include <sys/time.h>
#include <sys/socket.h>
#include <sys/ioctl.h>
#include <sys/filio.h>
@@ -15,14 +22,22 @@ extern "C" {
#include <netinet/in.h>
#include <netinet/tcp.h>
#include <arpa/inet.h>
#include <netdb.h>
void ipAddrToA(const struct sockaddr_in *pInetAddr,
char *pBuf, const unsigned bufSize);
#ifdef __cplusplus
}
#endif
typedef int SOCKET;
#define INVALID_SOCKET (-1)
#define SOCKERRNO errno
#define socket_close(S) close(S)
#define socket_ioctl(A,B,C) ioctl(A,B,C)
#define FD_IN_FDSET(FD) ((FD)<FD_SETSIZE)
#endif /*osiSockH*/
+66 -43
View File
@@ -1,15 +1,18 @@
/*
* sun4 specific socket include
* sunos 4 specific socket include
*/
#ifndef SUNOS4
#errro this is a SUNOS4 specific socket include
#endif
#ifndef osiSockH
#define osiSockH
#ifdef __cplusplus
extern "C" {
#endif
#include <errno.h>
#include <sys/types.h>
#include <sys/time.h>
#include <sys/socket.h>
#include <sys/ioctl.h>
#include <netinet/in.h>
@@ -20,61 +23,81 @@ int close (int fd);
int gettimeofday (struct timeval *tp, struct timezone *tzp);
int gethostname (char *name, int namelen);
void ipAddrToA (const struct sockaddr_in *pInetAddr,
char *pBuf, const unsigned bufSize);
/*
* sun's CC defines at least a few of these under sunos4
*/
#if defined(__SUNPRO_CC)
#if defined(__SUNPRO_CC) || defined(__SUNPRO_C)
# include <arpa/inet.h>
#else
# include <netdb.h>
#else /* !defined(__SUNPRO_CC) && !defined(__SUNPRO_C) */
int listen (int socket, int backlog);
int accept (int socket, struct sockaddr *addr, int *addrlen);
int shutdown (int socket, int how);
int getpeername (int socket, struct sockaddr *name, int *namelen);
int connect (int socket, struct sockaddr *name, int namelen);
int setsockopt (int socket, int level, int optname,
char *optval, int optlen);
void bzero (char *b, int length);
int sendto (int socket, const char *buf, int len,
int flags, struct sockaddr *to, int tolen);
int select (int width, fd_set *readfds, fd_set *writefds,
fd_set *exceptfds, struct timeval *timeout);
int listen (int socket, int backlog);
int accept (int socket, struct sockaddr *addr, int *addrlen);
int shutdown (int socket, int how);
int getpeername (int socket, struct sockaddr *name, int *namelen);
int connect (int socket, struct sockaddr *name, int namelen);
int setsockopt (int socket, int level, int optname,
char *optval, int optlen);
void bzero (char *b, int length);
int sendto (int socket, const char *buf, int len,
int flags, struct sockaddr *to, int tolen);
int select (int width, fd_set *readfds, fd_set *writefds,
fd_set *exceptfds, struct timeval *timeout);
int bind (int socket, struct sockaddr *name, int namelen);
int send (int socket, const char *buf, int len, int flags);
int recv (int socket, char *buf, int len, int flags);
int getsockopt (int socket, int level, int optname,
char *optval, int *optlen);
int socket (int domain, int type, int protocol);
int recvfrom (int socket, char *buf, int len,
int flags, struct sockaddr *from, int *fromlen);
int getsockname (int socket, struct sockaddr *name, int *namelen);
int bind (int socket, struct sockaddr *name, int namelen);
int send (int socket, const char *buf, int len, int flags);
int recv (int socket, char *buf, int len, int flags);
int getsockopt (int socket, int level, int optname,
char *optval, int *optlen);
int socket (int domain, int type, int protocol);
int recvfrom (int socket, char *buf, int len,
int flags, struct sockaddr *from, int *fromlen);
int getsockname (int socket, struct sockaddr *name, int *namelen);
/*
* from /usr/include/arpa/inet.h
* (which under sunos4 does not include arguments for C++)
* (__SUNPRO_CC supplies this file but g++ does not supply
* an ansi protottype)
*/
unsigned long inet_addr (char *);
char * inet_ntoa (struct in_addr in);
/*
* from /usr/include/arpa/inet.h
* (which under sunos4 does not include arguments for C++)
* (__SUNPRO_CC supplies this file but g++ does not supply an ansi protottype)
*/
unsigned long inet_addr (char *);
char * inet_ntoa (struct in_addr in);
/*
* from /usr/include/netdb.h
* (which under sunos4 does not include arguments for C++)
* (__SUNPRO_CC supplies this file but g++ does not)
*/
struct hostent *gethostbyaddr(char *addr, int len, int type);
#endif /* !defined(__SUNPRO_CC) */
/*
* from /usr/include/netdb.h
* (which under sunos4 does not include arguments for C++)
* (__SUNPRO_CC supplies an updated version of this file but g++ does not)
*/
struct hostent {
char *h_name; /* official name of host */
char **h_aliases; /* alias list */
int h_addrtype; /* host address type */
int h_length; /* length of address */
char **h_addr_list; /* list of addresses from name server */
# define h_addr h_addr_list[0] /* address, for backward compatiblity */
};
struct hostent *gethostbyaddr(char *addr, int len, int type);
#endif /* !defined(__SUNPRO_CC) && !defined(__SUNPRO_C) */
#ifdef __cplusplus
}
#endif
typedef int SOCKET;
#define INVALID_SOCKET (-1)
#define SOCKERRNO errno
#define socket_close(S) close(S)
#define socket_ioctl(A,B,C) ioctl(A,B,C)
#ifndef MAXHOSTNAMELEN
#define MAXHOSTNAMELEN 64
#endif
#define FD_IN_FDSET(FD) ((FD)<FD_SETSIZE)
#endif /*osiSockH*/
+14
View File
@@ -2,11 +2,17 @@
* vxWorks specific socket include
*/
#ifndef osiSockH
#define osiSockH
#ifdef __cplusplus
extern "C" {
#endif
#include <errno.h>
#include <sys/types.h>
#include <sys/times.h>
#include <sys/socket.h>
#include <sockLib.h>
#include <sys/ioctl.h>
@@ -14,13 +20,21 @@ extern "C" {
#include <netinet/tcp.h>
#include <arpa/inet.h>
void ipAddrToA (const struct sockaddr_in *pInetAddr,
char *pBuf, const unsigned bufSize);
#ifdef __cplusplus
}
#endif
typedef int SOCKET;
#define INVALID_SOCKET (-1)
#define SOCKERRNO errno
#define socket_close(S) close(S)
#define socket_ioctl(A,B,C) ioctl(A,B,(int)C)
#define FD_IN_FDSET(FD) ((FD)<FD_SETSIZE)
#endif /*osiSockH*/