Commit Graph

188 Commits

Author SHA1 Message Date
Michael Davidsaver
bf533ac195 win32 epicsSocketEnableAddressUseForDatagramFanout call spec
apparently epicsShareAPI is required on both declaration and definition.
2020-02-14 09:00:49 +00:00
Michael Davidsaver
819b0de65b epicsTimerTest testImpreciseTiming() 2020-02-14 09:00:17 +00:00
Karl Vestin
8075b3c316 Added a null check in epicsWin32ThreadEntry to prevent dereferencing a null pointer in case fetchWin32ThreadGlobal fails.
LP: #1863118
2020-02-13 16:16:56 +00:00
Gabriel Fedel
6feb1c788d Add extern C for all c headers
This allow that these files could be imported to c++ correctly
2020-02-13 14:21:54 +00:00
Aaron
6e0706a312 Set argBuff->sval to NULL if arg is NULL 2020-02-13 13:22:26 +00:00
Aaron
45bbe274e9 Error case for NULL arg causing segfault in iocshPersistentString 2020-02-13 13:22:19 +00:00
Michael Davidsaver
db6e7c7a22 use one osdSockAddrReuse impl for all targets
drop win32 specialization of osdSockAddrReuse
2020-02-12 10:52:51 +00:00
Michael Davidsaver
5064931aa6 try both to set both SO_REUSEPORT and SO_REUSEADDR
It seems that on Linux, SO_REUSEPORT shares with SO_REUSEPORT
and SO_REUSEADDR with SO_REUSEADDR, but not each other.

Setting both allows full sharing
2020-02-12 10:52:15 +00:00
Michael Davidsaver
d0c4cc0cec Darwin/iOS use posix osdSockAddrReuse.cpp
Redundant now that the posix version prefers SO_REUSEPORT
if defined.
2020-01-12 11:49:48 -08:00
Michael Davidsaver
65ef6e9d59 posix epicsSocketEnableAddressUseForDatagramFanout() prefer SO_REUSEPORT
prefer SO_REUSEPORT on targets which define it.

Linux defines both, and seems to treat
SO_REUSEPORT and SO_REUSEADDR as equivalent.
BSD derivatives need SO_REUSEPORT.
2020-01-12 11:49:26 -08:00
Michael Davidsaver
8dc131dc4c osiSockTest test epicsSocketEnableAddressUseForDatagramFanout() 2020-01-12 11:48:20 -08:00
Andrew Johnson
8f358f4dd8 VxWorks::osdThread: Rename createFunction => epicsThreadEntry
and make it visible (non-static) so it appears in back-traces.
2020-01-02 16:41:55 -06:00
Andrew Johnson
05e0381b19 Fix VxWorks epicsThreadMustJoin() problems
taskWait() actually returns OK on timeout, so drop the timeout warning
(the other implementations don't have one).
The taskWait() may return ERROR with S_objLib_OBJ_ID_ERROR if the target
thread has higher priority; this indicates a successful join, because
we already did a rendezvous using joinSem.
Delete joinSem *after* calling taskSpareFieldSet(), in case it matters.
2020-01-02 16:39:10 -06:00
Andrew Johnson
06728e0e0b Run epicsThreadTest::testJoining with different priorities
A problem in the VxWorks epicsThreadMustJoin() only occurs when
the joining thread runs at a higher priority than its supervisor.
2020-01-02 16:22:35 -06:00
Andrew Johnson
e7715ba7b4 Merge 3.15 branch into 7.0 2019-12-18 23:58:02 -06:00
Michael Davidsaver
189060c14f Merge branch '3.15' into 7.0
* 3.15:
  minor epicsTimerTest
  epicsTimerTest loosen test threshold
  debug epicsTimerTest
  posix/epicsMath.h
  Revert "libcom: fix colliding isnan/isinf between C99 and C++0x for gcc-4"
  Revert "libcom: properly declare isnan() in C++ code"
  travis-ci /etc/hosts workaround
  redo travis-ci with matrix
  epicsSockResolveTest add detail
  libcom: properly declare isnan() in C++ code
  libcom: fix colliding isnan/isinf between C99 and C++0x for gcc-4
  libcom: import some C99 math (isnan etc.) into global namespace

# Conflicts:
#	.travis.yml
#	ci/travis-prepare.sh
2019-12-16 15:39:48 -08:00
Michael Davidsaver
90ef40e62b iocshFindVariable() safety 2019-11-24 19:39:44 -08:00
Martin Konrad
218459f454 Remove epicsThrows() macro
Exception specifications are deprecated: http://isocpp.github.io/
CppCoreGuidelines/CppCoreGuidelines.html#e30-dont-use-exception-
specifications . They will be removed from the C++ standard with
C++20. Modern compilers are warning about them since years. Thus
it's unlikely that anyone is still using the epicsThrows() macro.
Even if that's the case the fix is trivial: Simply remove the macro.
2019-11-15 21:15:50 -08:00
Martin Konrad
13234afc40 Simplify definition of compiler-specific macros
Remove conditionals for older compiler versions that aren't
supported by EPICS Base anymore.
2019-11-15 21:14:27 -08:00
Andrew Johnson
f3d63da77b Remove two long-unused environment parameters 2019-11-15 13:16:35 -06:00
Michael Davidsaver
b43aafae70 VCS version instead of __DATE__
Use reproducable VCS version instead of date.
Of course, this falls back to a date if not
version controlled.
2019-11-13 10:18:12 -08:00
Michael Davidsaver
905ca4b7ac quiet some warnings 2019-11-13 10:17:43 -08:00
Michael Davidsaver
7acd7c6145 minor epicsTimerTest 2019-11-12 19:07:30 -08:00
Michael Davidsaver
bef9a08f6d asLib minor 2019-11-12 19:07:30 -08:00
Michael Davidsaver
3e7ad9a86f rtems_init cleanup
Remove unnecessary (as of RTEMS 4.9) prototypes
Remove unused *Fatal
constify string contant
2019-11-12 19:07:30 -08:00
Michael Davidsaver
76b9461ee8 logClient windows needs SOCK_E* 2019-11-12 19:07:30 -08:00
Andrew Johnson
220a27bdec Merge Dirk's dynamicVxWorksVmeFunctionBinding branch into 7.0 2019-10-28 15:11:54 -05:00
Andrew Johnson
171b3301a7 Fix ..// => ../ in Makefile-relative source paths 2019-10-28 15:00:15 -05:00
Andrew Johnson
e178fa85b6 Merge 7.0 back into 7.0
Insert tab B back into slot A ...
2019-10-28 13:30:58 -05:00
Michael Davidsaver
5e6226e595 osdSockUnsentCount.c check for existance of SIO_TCP_INFO 2019-10-28 10:06:05 -07:00
Andrew Johnson
3e7e26d8d7 Merge 3.15 branch into 7.0 2019-10-28 01:03:12 -05:00
Michael Davidsaver
fc04d12578 Merge remote-tracking branch 'zimoch/iocLogClientFixesTry2' into 7.0
* zimoch/iocLogClientFixesTry2: (22 commits)
  use EPICS_PRIVATE_API macro and fix bug with darwin/ios
  renamed epicsSocketCountUnsentBytes to epicsSocketUnsentCount and moved it to osi/os/
  fix bug from commit f85454. Apparently epicsExportSharedSymbols is needed even though epicsExport.h is included
  epicsSocketCountUnsentBytes returns -1 on failure
  bugfix: memmove'ed to much
  epicsSockCountUnsentBytes renamed to epicsSocketCountUnsentBytes
  moved logClientSendMessage and made it static
  fix wrong function name in comment
  sending 0 bytes helps to detect broken connections on some systems (but is undefined behavior on Linux, fails on vxWorks and is a documented no-op on Windows)
  cannot print sockets with %d in Windows, they are not small ints but maybe pointers.
  ask logClient socket how many bytes are still in the send queue and don't discard them in case the connection turns out broken.
  use dynamic debug flag for logClient
  increase error message buffer size for long (Windows) error messges
  improve logClientShow to show unsent bytes on level 2 (and fix level 1)
  removed unneeded include
  no need to delay startup only because log server is currently not available
  send pending log messages directly after connecting
  avoid needless memmove calls
  elimitate duplicate code in logClient
  do not discard unsent messages when log server has closed connection, instead try to send them after reconnect
  ...
2019-10-24 10:22:07 -07:00
Michael Davidsaver
f3204d8afa provide default for PATH_MAX 2019-10-20 18:35:55 -07:00
Michael Davidsaver
a34a84f19f libcom: win32 poison TLS value 2019-10-17 20:12:10 -07:00
Freddie Akeroyd
edc66418ac WIN32: Add symbol lookup 2019-10-17 20:10:23 -07:00
Freddie Akeroyd
c8006f2934 WIN32: Add stack trace printing on assert/error 2019-10-17 20:09:37 -07:00
Michael Davidsaver
32aeabfc61 msvc unittests disable dialog on error or assert() failure
Showing a dialog is really unhelpful in headless CI environments.

_CrtSetReportMode also set _CRT_WARN
Not clear what the default is.
2019-10-17 20:09:27 -07:00
Michael Davidsaver
e257e30cc9 Merge remote-tracking branch 'lp-Com/use-monotonic' into 7.0
* lp-Com/use-monotonic:
  VxWorks: Measure CPU time-base frequency if necessary
  replace most internal getCurrent() -> getMonotonic()
  dbScan periodic scan use monotonic time
  monotonic adapt to regular time APIs
2019-10-06 20:10:20 -07:00
Michael Davidsaver
c131d6852d Merge remote-tracking branch 'lp-Com/iocsherr' into 7.0
* lp-Com/iocsherr:
  doc
  deprecate iocshFindCommand()
  iocshTest start
  iocshCmd() imply "on error break"
  iocsh more error handling
  iocsh handle redirect and similar early errors
  iocsh trap arg. parsing errors
  iocsh further on error
  Fixed logic errors and added some prompts.
  use iocshSetError()
  iocsh allow setting of error code
  iocsh control error behavior
  iocsh catch exceptions

# Conflicts:
#	documentation/RELEASE_NOTES.html
2019-10-06 20:10:09 -07:00
Michael Davidsaver
02bec52f0a Merge remote-tracking branch 'lp-make/rpath-origin' into 7.0
* lp-make/rpath-origin:
  makeRPath allow multiple root directories
  redo softIoc to be more c++y
  rpath $ORIGIN doc
  older binutils compat
  travis-ci test rpath $ORIGIN
  epicsGetExecName WIN32, Darwin, solaris, freebsd
  epicsGetExecDir() paths relative to executable
  LINKER_USE_RPATH=ORIGIN

# Conflicts:
#	configure/os/CONFIG.Common.linuxCommon
2019-10-06 20:05:47 -07:00
Michael Davidsaver
8ff7658291 asLib: osiSockAttach() for asCheckClientIP
WIN32 needs osiSockAttach() prior to aToIPAddr()
which can now happen during ACF parsing.
2019-10-06 19:59:33 -07:00
Michael Davidsaver
e83818b25e workaround apparent MSVC mis-optimization
MSVC appears to misapply the identity
"A + -A == 0" which is not true for
non-finite floating point values.
2019-10-06 19:58:23 -07:00
4bb81654d6 use EPICS_PRIVATE_API macro and fix bug with darwin/ios 2019-10-04 14:32:07 +02:00
Michael Davidsaver
17aaf50136 WIN32 must clean TLS from correct thread
epicsParmCleanupWIN32() may be called from
threads other than the one being cleaned up.
2019-09-24 20:36:18 -07:00
Michael Davidsaver
b68f47927c WIN32 remove atexit cleanup of TLS
Force cleanup of resource for threads which may
still be running opens the possibility of strange
race conditions.  Like threads be erroneously
detected as non-epics.

Doing this cleanup at process exit serves no real
purpose.  This code might be valid to re-add
in a DLL exit handler.
2019-09-24 20:21:56 -07:00
Michael Davidsaver
f134abb84e epicsThread avoid possible data race on joined 2019-09-24 08:52:48 -07:00
Freddie Akeroyd
ee1eac3f4c iocshRegisterVariable() takes an array 2019-09-23 18:55:51 -07:00
46912d5516 renamed epicsSocketCountUnsentBytes to epicsSocketUnsentCount and moved it to osi/os/ 2019-09-23 11:10:32 +02:00
cf121f1c14 fix bug from commit f85454. Apparently epicsExportSharedSymbols is needed even though epicsExport.h is included 2019-09-23 10:54:17 +02:00
1718647121 epicsSocketCountUnsentBytes returns -1 on failure 2019-09-19 12:08:45 +02:00