moved to misc/os
This commit is contained in:
@@ -1,3 +0,0 @@
|
||||
|
||||
The source files here are vxWorks dependent.
|
||||
|
||||
@@ -1,88 +0,0 @@
|
||||
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#ifndef vxWorks
|
||||
#error this is a vxWorks specific source code
|
||||
#endif
|
||||
|
||||
#include <hostLib.h>
|
||||
#include <inetLib.h>
|
||||
|
||||
#define epicsExportSharedSymbols
|
||||
#include "bsdSocketResource.h"
|
||||
|
||||
int bsdSockAttach()
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
void bsdSockRelease()
|
||||
{
|
||||
}
|
||||
|
||||
/*
|
||||
* ipAddrToHostName
|
||||
*/
|
||||
epicsShareFunc unsigned epicsShareAPI ipAddrToHostName
|
||||
(const struct in_addr *pAddr, char *pBuf, unsigned bufSize)
|
||||
{
|
||||
int status;
|
||||
int errnoCopy = errno;
|
||||
unsigned len;
|
||||
|
||||
if (bufSize<1) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (bufSize>MAXHOSTNAMELEN) {
|
||||
status = hostGetByAddr ((int)pAddr->s_addr, pBuf);
|
||||
if (status==OK) {
|
||||
pBuf[MAXHOSTNAMELEN] = '\0';
|
||||
len = strlen (pBuf);
|
||||
}
|
||||
else {
|
||||
len = 0;
|
||||
}
|
||||
}
|
||||
else {
|
||||
char name[MAXHOSTNAMELEN+1];
|
||||
status = hostGetByAddr (pAddr->s_addr, name);
|
||||
if (status==OK) {
|
||||
strncpy (pBuf, name, bufSize);
|
||||
pBuf[bufSize-1] = '\0';
|
||||
len = strlen (pBuf);
|
||||
}
|
||||
else {
|
||||
len = 0;
|
||||
}
|
||||
}
|
||||
|
||||
errno = errnoCopy;
|
||||
|
||||
return len;
|
||||
}
|
||||
|
||||
/*
|
||||
* hostToIPAddr ()
|
||||
*/
|
||||
epicsShareFunc int epicsShareAPI hostToIPAddr
|
||||
(const char *pHostName, struct in_addr *pIPA)
|
||||
{
|
||||
int addr;
|
||||
|
||||
addr = hostGetByName ((char *)pHostName);
|
||||
if (addr==ERROR) {
|
||||
/*
|
||||
* return indicating an error
|
||||
*/
|
||||
return -1;
|
||||
}
|
||||
|
||||
pIPA->s_addr = (unsigned long) addr;
|
||||
|
||||
/*
|
||||
* success
|
||||
*/
|
||||
return 0;
|
||||
}
|
||||
@@ -1,34 +0,0 @@
|
||||
|
||||
#include <tickLib.h>
|
||||
#include <sysLib.h>
|
||||
|
||||
#define epicsExportSharedSymbols
|
||||
#include "osiTime.h"
|
||||
|
||||
//
|
||||
// osiTime::synchronize()
|
||||
//
|
||||
void osiTime::synchronize()
|
||||
{
|
||||
}
|
||||
|
||||
//
|
||||
// osiTime::osdGetCurrent ()
|
||||
//
|
||||
osiTime osiTime::osdGetCurrent ()
|
||||
{
|
||||
ULONG ticks;
|
||||
ULONG sec;
|
||||
ULONG nsec;
|
||||
ULONG rate = sysClkRateGet();
|
||||
|
||||
//
|
||||
// currently assuming that this has been already adjusted
|
||||
// for the EPICS epoch
|
||||
//
|
||||
ticks = tickGet();
|
||||
sec = ticks / rate;
|
||||
nsec = (ticks % rate) * (nSecPerSec / rate);
|
||||
|
||||
return osiTime (sec, nsec);
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
|
||||
#include <taskLib.h>
|
||||
#include <sysLib.h>
|
||||
|
||||
#define epicsExportSharedSymbols
|
||||
#include "epicsAssert.h"
|
||||
#include "osiSleep.h"
|
||||
|
||||
epicsShareFunc void epicsShareAPI osiSleep (unsigned sec, unsigned uSec)
|
||||
{
|
||||
ULONG ticks;
|
||||
int status;
|
||||
|
||||
ticks = (uSec*sysClkRateGet())/1000000;
|
||||
ticks += sec*sysClkRateGet();
|
||||
|
||||
if (ticks==0) {
|
||||
ticks = 1;
|
||||
}
|
||||
|
||||
status = taskDelay (ticks);
|
||||
assert (status==OK);
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
|
||||
#define epicsExportSharedSymbols
|
||||
#include "sigPipeIgnore.h"
|
||||
|
||||
/*
|
||||
* NOOP
|
||||
*/
|
||||
epicsShareFunc void epicsShareAPI installSigPipeIgnore (void)
|
||||
{
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user