Commit Graph
270 Commits
Author SHA1 Message Date
zimoch 595bb8fb62 fix spelling errors 2026-01-06 09:51:04 +01:00
zimoch 58debe99ed remove needless pointer casts 2026-01-06 09:51:03 +01:00
Ralph Langeandzimoch 46d80bf50e libCom/posix: don't memlock() if opted out of FIFO scheduling 2025-11-28 11:51:42 +01:00
Ralph Langeandzimoch 54c69ad5fa libCom/posix: add env var to opt out of FIFO scheduling
- add EPICS_ALLOW_POSIX_THREAD_PRIORITY_SCHEDULING
  (default: YES)
- start EPICS threads with default policy
  when set to NO
2025-11-28 11:51:42 +01:00
Michael Davidsaverandzimoch d7286cd956 posix: epicsThreadShowAll include OSD priority range and mlockall state 2025-11-28 11:51:41 +01:00
zimoch 1918aebf97 Merge branch '7.0' 2025-10-10 10:33:50 +02:00
Jeremy LorelliandAndrew Johnson bd8c35d8e7 Implement epicsMessageQueueSend/epicsMessageQueueReceive to resolve link error
These were defined as macros in osdMessageQueue.h, but declared as
prototypes in epcisMessageQueue.h public header. We need to implement
them as C functions for these to actually be usable.
2025-10-08 09:53:33 -05:00
Michael Davidsaver 7444936a22 colorize more errors/warnings 2025-09-20 09:42:01 -05:00
Michael Davidsaver 2e26ec09a6 posix: initialize pthread_attr for non-epics threads 2025-09-03 07:36:36 -07:00
Michael DavidsaverandAndrew Johnson 5ae9cc6536 gethostbyname -> getaddrinfo
Prefer reentrant DNS API
2025-07-30 10:16:23 -05:00
zimoch 0f29b34f68 Merge branch '7.0' into PSI-7.0 2025-07-14 10:49:20 +02:00
Hinko KocevarandAndrew Johnson 5813dcd639 attempt to fix a linter error for step 49 of "Path" 2025-06-20 16:01:44 -05:00
Hinko KocevarandAndrew Johnson b8e70783d8 trying to fix vs2012 and vs2010 builds 2025-06-20 16:01:44 -05:00
Hinko KocevarandAndrew Johnson b9b2da26fd detect and handle backslash as part of multi-line string 2025-06-20 16:01:44 -05:00
Érico NogueiraandAndrew Johnson 21368dc7b4 Don't include linux/ header in osdSockUnsentCount.
Per the manpage in the file's comment, SIOCOUTQ is equivalent to the
TIOCOUTQ ioctl, whose value can be obtained by including <sys/ioctl.h>,
which allows us to avoid including any system-specific headers. This is
desirable so that, on a musl system, it won't be necessary to install
kernel headers in order to build epics-base.

Since it's first been checked into Git, the Linux kernel has defined
SIOCOUTQ to be TIOCOUTQ [1].

From the three main libc options on Linux: glibc and uclibc use the
kernel headers, so both ioctls are available; and musl defines only
TIOCOUTQ in their own headers.

[1] https://github.com/torvalds/linux/commit/1da177e4c3f41524e886b7f1b8a0c1fc7321cac2
2025-06-04 09:55:04 -05:00
zimoch 09f96d056a Merge branch '7.0' into PSI-7.0 2025-03-21 15:15:57 +01:00
zimoch 1732c9440a fix for mingw warning about order of header files 2025-03-21 13:49:05 +01:00
Jeremy LorelliandAndrew Johnson 6ea6ae633b Define NOCRYPT, NOSOUND and NOKANJI before including windows.h 2025-03-19 11:19:45 -05:00
JJL772andAndrew Johnson fc5d3c9a5c Disable extraneous WIN32 declarations when including windows.h in epicsAtomicOSD.h 2025-03-19 11:19:45 -05:00
Michael DavidsaverandAndrew Johnson 48ebe2c64e Avoid initMainThread() except on vxworks
Move isOkToBlock tracking to osdThread.
Targets except vxworks can store this flag in epicsThreadOSD.
Continue to use TLS w/ vxWorks.

Note that setting of isOkToBlock for "main" thread becomes lazy.
2025-03-19 10:53:42 -05:00
zimoch 55791ef470 Merge branch 7.0.9 into PSI-7.0 2025-03-03 17:19:23 +01:00
Michael Davidsaver e4ad4becde rationalize osdMutex
Avoids split allocation.
Eliminates special case free-list.

win32: eliminate pre-XP
rtems-score: eliminate non-fast
2024-12-29 16:35:26 -08:00
Jeremy LorelliandMichael Davidsaver 721e9cc3a7 Add ABORT_ON_ASSERT flag to CONFIG_SITE
This flag causes EPICS to call abort() on assertion failures rather than
suspend the executing thread. With the epicsThreadSuspendSelf() behavior,
an IOC can end up in a difficult to detect error state where one or more
threads has essentially crashed due to an assertion failure.

This also matches the C behavior of assert(3)
2024-12-29 16:34:10 -08:00
zimoch b53505d339 Merge branch '7.0' into PSI-7.0 2024-12-05 16:58:15 +01:00
Chris JohnsandAndrew Johnson 594e5ee9db rtems: Set the name of EPICS threads so RTEMS commands report the name
Use the NP POSIX call pthread_setname_np to set the POSIX thread name.
2024-10-31 16:21:49 -05:00
Chris JohnsandAndrew Johnson 83cbf8a4c7 freebsd: Add support for x86 and amd64 builds
Use the OS compiler, ie cc and c++.
2024-10-31 16:16:45 -05:00
Michael DavidsaverandAndrew Johnson 152d306ad8 avoid UB with self pthread_join() 2024-10-02 09:22:00 -05:00
Michael DavidsaverandAndrew Johnson 012139638d posix: epicsThreadCreateOpt() avoid leak of joinable on EPERM
On a system where RT priorities have been probed.
When creating a joinable thread, but still fails
with EPERM, the first epicsThreadOSD was leaked.
2024-10-02 09:22:00 -05:00
zimoch 4af01ed26a Merge branch '7.0' into PSI-7.0 2024-09-06 14:55:12 +02:00
Freddie AkeroydandAndrew Johnson dd154180bf Avoid isnan/isinf redefine in c++ on VS2013 and above 2024-09-04 09:48:03 -05:00
Freddie AkeroydandAndrew Johnson 574fe116fc protect isnan/isinf define on c++ 2024-09-04 09:48:03 -05:00
zimoch d67036fcc0 Merge branch 'aliases' into PSI-7.0 2024-08-26 16:37:57 +02:00
Michael DavidsaverandAndrew Johnson 057eb87101 readline: only keep history for interactive session 2024-08-21 09:36:39 -05:00
zimoch 87d492bffd Merge branch '7.0' into PSI-7.0 2024-04-30 14:40:00 +02:00
Freddie AkeroydandAndrew Johnson 5dfc6caf3c Accept should return SOCKET rather than int 2024-03-06 09:48:26 -06:00
Freddie AkeroydandAndrew Johnson 4720b61c1f Move call to setThreadName()
The call to setThreadName() is moved to avoid a race condition that
can happen with very short lived processes. If the process terminates
very quickly e.g. is a google test runner or the msi.exe command
called from a Makefile during a build, then very occasionally a
crash can occur during process termination if setThreadName() when called
from the newly created thread. This looks to be becauae the DLL it is
trying to call gets unloaded between it getting a handle to the DLL
and making the call. Moving the setThreadName() call to the creating
thread avoids this problem. The issue was only ever seen with statically
linked epics executables, I am unsure if the way a DLL based epics
program unloads might avoid this, or just make it less likely but
still possible. As mentioned above, the issue will only ever occur
to threads that are created during process termination and so would
not affect running IOCs
2024-02-21 09:59:36 -06:00
Michael Davidsaver 07cbf00187 posix: warn on epicsSocketCreate() without osiSockAttach() 2023-12-22 10:26:28 -08:00
Michael Davidsaver a7a56912eb default/epicsMessageQueue: initialize threadNode 2023-12-22 10:26:28 -08:00
Michael Davidsaver fe4a32e425 default/epicsMessageQueue: avoid volatile flag
Only one place where eventSent was accessed
without locking.  Move this load earlier.
2023-12-22 10:26:28 -08:00
Michael Davidsaverandzimoch db2482117d rationalize osdMutex
Avoids split allocation.
Eliminates special case free-list.

win32: eliminate pre-XP
rtems-score: eliminate non-fast
2023-12-04 11:04:51 +01:00
Michael Davidsaverandzimoch cb6442da71 epicsThreadShow() zombies
Flag when the thread has returned, but the tracking
struct is still around.  eg. in need of joining.
2023-12-01 15:01:10 +01:00
Érico Nogueiraandzimoch 49b9573f3a libCom: detect support for backtrace() with __has_include.
This is necessary in order to build epics-base with musl libc, for
example, and any other C libraries which don't include this
functionality. In order to not regress builds with older compilers, we
still support the uclibc check. Furthermore, it has been checked that
uclibc-ng (the maintained version of uclibc) doesn't install the
<execinfo.h> header when the functionality is disabled [1] [2].

To avoid repetition, we don't define HAS_EXECINFO to 0 when it is not
available.

[1] https://cgit.uclibc-ng.org/cgi/cgit/uclibc-ng.git/tree/Makefile.in?id=cdb07d2cd52af39feb425e6d36c02b30916b9f0a#n224
[2] https://cgit.uclibc-ng.org/cgi/cgit/uclibc-ng.git/tree/Makefile.in?id=cdb07d2cd52af39feb425e6d36c02b30916b9f0a#n277
2023-12-01 15:01:01 +01:00
zimoch 1d3a2defa2 Merge 7.0 commit 'ca9c95' into PSI-7.0 2023-12-01 14:21:07 +01:00
Michael Davidsaver 45b3bce515 epicsThreadShow() zombies
Flag when the thread has returned, but the tracking
struct is still around.  eg. in need of joining.
2023-09-22 08:19:25 -07:00
Érico NogueiraandMichael Davidsaver 7c4a21eab4 libCom: detect support for backtrace() with __has_include.
This is necessary in order to build epics-base with musl libc, for
example, and any other C libraries which don't include this
functionality. In order to not regress builds with older compilers, we
still support the uclibc check. Furthermore, it has been checked that
uclibc-ng (the maintained version of uclibc) doesn't install the
<execinfo.h> header when the functionality is disabled [1] [2].

To avoid repetition, we don't define HAS_EXECINFO to 0 when it is not
available.

[1] https://cgit.uclibc-ng.org/cgi/cgit/uclibc-ng.git/tree/Makefile.in?id=cdb07d2cd52af39feb425e6d36c02b30916b9f0a#n224
[2] https://cgit.uclibc-ng.org/cgi/cgit/uclibc-ng.git/tree/Makefile.in?id=cdb07d2cd52af39feb425e6d36c02b30916b9f0a#n277
2023-09-21 08:18:49 -07:00
Michael Davidsaver 1595ed8860 quieting clang-tidy, non-functional changes
Changes to syntax which should not effect generated code
2023-08-28 14:17:00 +02:00
zimoch 73f80cced9 Merge branch '7.0' into PSI-7.0 2023-08-21 14:14:16 +02:00
Ralph LangeandMichael Davidsaver 6636b4b9e7 libCom: check calloc() failure in RTEMS-posix/osdMessageQueue.c 2023-07-22 08:35:59 -07:00
Ralph LangeandMichael Davidsaver b51d1de283 libCom: fix possible memory leak in RTEMS-posix/osdMessageQueue.c
found by static code analysis (cppcheck @ sonarqube)
2023-07-22 08:35:59 -07:00
zimoch 5b058d7d27 Merge branch '7.0' into PSI-7.0 2023-06-22 16:36:32 +02:00