From c5740c0dd0d2d53e49a2f99f9bd0d96da168b392 Mon Sep 17 00:00:00 2001
From: Andrew Johnson IOC applications built for Cygwin with shared libraries need to have PATH
+configured to include all of the bin directories for support modules listed in
+the RELEASE file. For applications run from the Windows cmd.exe shell the
+Makefile in the application's iocBoot/ioc directory can be set to build a file
+dllPath.bat which performs the appropriate changes to PATH, but this file uses
+syntax which is unique to the cmd.exe shell. Cygwin applications can now add a
+target relPaths.sh to this Makefile, which will generate a file appropriate for
+sourcing in the Bash shell instead. The makeBaseApp.pl templates now include this file in the list of targets to
+be built in the iocBoot/ioc/Makefile for Cygwin architectures. The two CA routines ca_array_get_callback() and ca_array_put_callback() were
diff --git a/src/makeBaseApp/Makefile b/src/makeBaseApp/Makefile
index c7f89f8e1..7b728394d 100644
--- a/src/makeBaseApp/Makefile
+++ b/src/makeBaseApp/Makefile
@@ -53,6 +53,8 @@ TEMPLATES += top/exampleBoot/nfsCommands@RTEMS
TEMPLATES += top/exampleBoot/ioc/Makefile@Common
TEMPLATES += top/exampleBoot/ioc/Makefile@vxWorks
TEMPLATES += top/exampleBoot/ioc/Makefile@win32
+TEMPLATES += top/exampleBoot/ioc/Makefile@windows
+TEMPLATES += top/exampleBoot/ioc/Makefile@cygwin
TEMPLATES += top/exampleBoot/ioc/st.cmd@Common
TEMPLATES += top/exampleBoot/ioc/st.cmd@vxWorks
TEMPLATES += top/exampleBoot/ioc/st.cmd@RTEMS
@@ -82,6 +84,8 @@ TEMPLATES += top/iocBoot/nfsCommands@RTEMS
TEMPLATES += top/iocBoot/ioc/Makefile@Common
TEMPLATES += top/iocBoot/ioc/Makefile@vxWorks
TEMPLATES += top/iocBoot/ioc/Makefile@win32
+TEMPLATES += top/iocBoot/ioc/Makefile@windows
+TEMPLATES += top/iocBoot/ioc/Makefile@cygwin
TEMPLATES += top/iocBoot/ioc/st.cmd@Common
TEMPLATES += top/iocBoot/ioc/st.cmd@Cross
TEMPLATES += top/iocBoot/ioc/st.cmd@vxWorks
diff --git a/src/makeBaseApp/top/exampleBoot/ioc/Makefile@cygwin b/src/makeBaseApp/top/exampleBoot/ioc/Makefile@cygwin
new file mode 100644
index 000000000..77c3215d7
--- /dev/null
+++ b/src/makeBaseApp/top/exampleBoot/ioc/Makefile@cygwin
@@ -0,0 +1,5 @@
+TOP = ../..
+include $(TOP)/configure/CONFIG
+ARCH = _ARCH_
+TARGETS = envPaths relPaths.sh
+include $(TOP)/configure/RULES.ioc
diff --git a/src/makeBaseApp/top/exampleBoot/ioc/Makefile@windows b/src/makeBaseApp/top/exampleBoot/ioc/Makefile@windows
new file mode 100644
index 000000000..59b32d734
--- /dev/null
+++ b/src/makeBaseApp/top/exampleBoot/ioc/Makefile@windows
@@ -0,0 +1,5 @@
+TOP = ../..
+include $(TOP)/configure/CONFIG
+ARCH = _ARCH_
+TARGETS = envPaths dllPath.bat
+include $(TOP)/configure/RULES.ioc
diff --git a/src/makeBaseApp/top/iocBoot/ioc/Makefile@cygwin b/src/makeBaseApp/top/iocBoot/ioc/Makefile@cygwin
new file mode 100644
index 000000000..77c3215d7
--- /dev/null
+++ b/src/makeBaseApp/top/iocBoot/ioc/Makefile@cygwin
@@ -0,0 +1,5 @@
+TOP = ../..
+include $(TOP)/configure/CONFIG
+ARCH = _ARCH_
+TARGETS = envPaths relPaths.sh
+include $(TOP)/configure/RULES.ioc
diff --git a/src/makeBaseApp/top/iocBoot/ioc/Makefile@windows b/src/makeBaseApp/top/iocBoot/ioc/Makefile@windows
new file mode 100644
index 000000000..59b32d734
--- /dev/null
+++ b/src/makeBaseApp/top/iocBoot/ioc/Makefile@windows
@@ -0,0 +1,5 @@
+TOP = ../..
+include $(TOP)/configure/CONFIG
+ARCH = _ARCH_
+TARGETS = envPaths dllPath.bat
+include $(TOP)/configure/RULES.ioc
diff --git a/src/tools/convertRelease.pl b/src/tools/convertRelease.pl
index 5b0890425..abf63c3ec 100644
--- a/src/tools/convertRelease.pl
+++ b/src/tools/convertRelease.pl
@@ -82,6 +82,7 @@ expandRelease(\%macros, \@apps);
for ($outfile) {
m/releaseTops/ and do { &releaseTops; last; };
m/dllPath\.bat/ and do { &dllPath; last; };
+ m/relPaths\.sh/ and do { &relPaths; last; };
m/cdCommands/ and do { &cdCommands; last; };
m/envPaths/ and do { &envPaths; last; };
m/checkRelease/ and do { &checkRelease; last; };
@@ -96,7 +97,8 @@ sub HELP_MESSAGE {
Usage: convertRelease.pl [-a arch] [-T top] [-t ioctop] outfile
where outfile is one of:
releaseTops - lists the module names defined in RELEASE*s
- dllPath.bat - path changes for cmd.exe to find WIN32 DLLs
+ dllPath.bat - path changes for cmd.exe to find Windows DLLs
+ relPaths.sh - path changes for bash to add RELEASE bin dir's
cdCommands - generate cd path strings for vxWorks IOCs
envPaths - generate epicsEnvSet commands for other IOCs
checkRelease - checks consistency with support modules
@@ -113,13 +115,21 @@ sub releaseTops {
}
#
-# Generate Path files so Windows can find our DLLs
+# Generate Path files so Windows/Cygwin can find our DLLs
#
sub dllPath {
unlink $outfile;
open(OUT, ">$outfile") or die "$! creating $outfile";
print OUT "\@ECHO OFF\n";
- print OUT "PATH %PATH%;", join(';', binDirs()), "\n";
+ print OUT "PATH \%PATH\%;", join(';', binDirs()), "\n";
+ close OUT;
+}
+
+sub relPaths {
+ unlink $outfile;
+ open(OUT, ">$outfile") or die "$! creating $outfile";
+ print OUT "export PATH=\$PATH:",
+ join(':', map {m/\s/ ? "\"$_\"" : $_ } binDirs()), "\n";
close OUT;
}
From 49a9d649460c8f6ebdbf319ff9adfab260713550 Mon Sep 17 00:00:00 2001
From: Ralph Lange Launchpad bug
+1388313 reported by Bruce Hill and Chris Ford. IOC applications built for Cygwin with shared libraries need to have PATH
diff --git a/src/libCom/misc/epicsString.c b/src/libCom/misc/epicsString.c
index f5c61944d..4ee9fed35 100644
--- a/src/libCom/misc/epicsString.c
+++ b/src/libCom/misc/epicsString.c
@@ -43,6 +43,9 @@ int epicsStrnRawFromEscaped(char *to, size_t outsize, const char *from,
char c;
int nto = 0, nfrom = 0;
+ if (outsize == 0)
+ return 0;
+
while ((c = *pfrom++) && nto < outsize && nfrom < inlen) {
nfrom++;
if (c == '\\') {
@@ -100,7 +103,9 @@ int epicsStrnRawFromEscaped(char *to, size_t outsize, const char *from,
*pto++ = c; nto++;
}
}
- *pto = '\0'; /* NOTE that nto does not have to be incremented */
+ if (nto == outsize)
+ pto--;
+ *pto = '\0';
return nto;
}
diff --git a/src/libCom/test/epicsStringTest.c b/src/libCom/test/epicsStringTest.c
index 72944f7c6..27ac53678 100644
--- a/src/libCom/test/epicsStringTest.c
+++ b/src/libCom/test/epicsStringTest.c
@@ -48,9 +48,11 @@ MAIN(epicsStringTest)
const char * const a = "a";
const char * const abcd = "abcd";
const char * const abcde = "abcde";
+ char result[8];
char *s;
+ int status;
- testPlan(281);
+ testPlan(299);
testChars();
@@ -85,5 +87,41 @@ MAIN(epicsStringTest)
testOk1(epicsStrHash(abcd, 0) == epicsMemHash(abcde, 4, 0));
testOk1(epicsStrHash(abcd, 0) != epicsMemHash("abcd\0", 5, 0));
+ memset(result, 'x', sizeof(result));
+ status = epicsStrnEscapedFromRaw(result, 4, ABCD, 3);
+ testOk(status == 3, "epicsStrnEscapedFromRaw returned %d (exp. 3)", status);
+ testOk(result[4] == 'x', "epicsStrnEscapedFromRaw no buffer overrun");
+ testOk(result[3] == 0, "epicsStrnEscapedFromRaw 0-terminated");
+
+ memset(result, 'x', sizeof(result));
+ status = epicsStrnEscapedFromRaw(result, 4, ABCD, 4);
+ testOk(status == 4, "epicsStrnEscapedFromRaw returned %d (exp. 4)", status);
+ testOk(result[4] == 'x', "epicsStrnEscapedFromRaw no buffer overrun");
+ testOk(result[3] == 0, "epicsStrnEscapedFromRaw 0-terminated");
+
+ memset(result, 'x', sizeof(result));
+ status = epicsStrnEscapedFromRaw(result, 4, ABCDE, 5);
+ testOk(status == 5, "epicsStrnEscapedFromRaw returned %d (exp. 5)", status);
+ testOk(result[4] == 'x', "epicsStrnEscapedFromRaw no buffer overrun");
+ testOk(result[3] == 0, "epicsStrnEscapedFromRaw 0-terminated");
+
+ memset(result, 'x', sizeof(result));
+ status = epicsStrnRawFromEscaped(result, 4, ABCD, 3);
+ testOk(status == 3, "epicsStrnRawFromEscaped returned %d (exp. 3)", status);
+ testOk(result[4] == 'x', "epicsStrnRawFromEscaped no buffer overrun");
+ testOk(result[3] == 0, "epicsStrnRawFromEscaped 0-terminated");
+
+ memset(result, 'x', sizeof(result));
+ status = epicsStrnRawFromEscaped(result, 4, ABCD, 4);
+ testOk(status == 4, "epicsStrnRawFromEscaped returned %d (exp. 4)", status);
+ testOk(result[4] == 'x', "epicsStrnRawFromEscaped no buffer overrun");
+ testOk(result[3] == 0, "epicsStrnRawFromEscaped 0-terminated");
+
+ memset(result, 'x', sizeof(result));
+ status = epicsStrnRawFromEscaped(result, 4, ABCDE, 5);
+ testOk(status == 4, "epicsStrnRawFromEscaped returned %d (exp. 4)", status);
+ testOk(result[4] == 'x', "epicsStrnRawFromEscaped no buffer overrun");
+ testOk(result[3] == 0, "epicsStrnRawFromEscaped 0-terminated");
+
return testDone();
}
From 0d0ac88242ecf1c7fca182acb8c1b6b66aa6b6d2 Mon Sep 17 00:00:00 2001
From: "J. Lewis Muir" Channel Access is implemented using internet protocols (IP). IP addresses
+ Channel Access is implemented using Internet protocols (IP). IP addresses
are divided into host and network portions. The boundary between each portion
is determined by the IP netmask. Portions of the IP address corresponding to
zeros in the netmask specify the hosts address within an IP subnet. Portions of
@@ -380,7 +380,7 @@ limited to one IP subnet. Addresses with the host address portion set to all
zeros or all ones are special. Modern IP kernel implementations reserve
destination addresses with the host portion set to all ones for the purpose of
addressing broadcasts to a particular subnet. In theory we can issue a
-broadcast frame on any broadcast capable LAN within the interconnected internet
+broadcast frame on any broadcast capable LAN within the interconnected Internet
by specifying the proper subnet address combined with a host portion set to all
ones. In practice these "directed broadcasts" are frequently limited by the
default router configuration. The proper directed broadcast address required to
@@ -586,7 +586,7 @@ restarted or because the IP kernel's internal TCP circuit inactivity keep alive
timer has expired after a typically long duration (as is appropriate for IP
based systems that need to avoid thrashing during periods of excessive load).
The net result is less search and TCP circuit setup and shutdown activity
-suring periods of excessive load.Better Cygwin IOC Application Support
+
+Reject NULL callback functions in ca_array_*_callback
Fix buffer overflow in epicsStrnRawFromEscaped()
+
+Better Cygwin IOC Application Support
IP Network Administration Background Information
-
While the CA client library does not translate inbetween the local time and +
While the CA client library does not translate between the local time and the time zone independent internal storage of EPICS time stamps, many EPICS client side applications call core EPICS libraries which provide these services. To set the correct time zone users must compute the number of @@ -949,12 +949,12 @@ and Windows systems.
The above libraries are located in "<EPICS -base>/lib/<architechture>".
+base>/lib/<architecture>".If you do not use the EPICS build environemnt (layered make files) then it +
If you do not use the EPICS build environment (layered make files) then it may be helpful to run one of the EPICS make files and watch the compile/link lines. This may be the simplest way to capture the latest system and compiler specific options required by your build environment. I have included some @@ -1549,7 +1549,7 @@ command line is used.
excas [options]
This is an example CA server that is sometimes used for testing purposes. An -example server can be created with the makeBaseApp perl script, as descibed in +example server can be created with the makeBaseApp Perl script, as described in the application Developer's Guide.