diff --git a/src/misc/Makefile b/src/misc/Makefile index 776bc89c7..f7cfa44e8 100644 --- a/src/misc/Makefile +++ b/src/misc/Makefile @@ -1,10 +1,9 @@ #************************************************************************* -# Copyright (c) 2002 The University of Chicago, as Operator of Argonne +# Copyright (c) 2009 UChicago Argonne LLC, as Operator of Argonne # National Laboratory. # Copyright (c) 2002 The Regents of the University of California, as # Operator of Los Alamos National Laboratory. -# EPICS BASE Versions 3.13.7 -# and higher are distributed subject to a Software License Agreement found +# EPICS BASE is distributed subject to a Software License Agreement found # in file LICENSE that is included with this distribution. #************************************************************************* @@ -13,6 +12,7 @@ include $(TOP)/configure/CONFIG DBD += base.dbd DBD += system.dbd +DBD += dlload.dbd INC += epicsRelease.h INC += iocInit.h @@ -23,8 +23,10 @@ LIB_SRCS += epicsRelease.c LIB_SRCS += iocInit.c LIB_SRCS += asSubRecordFunctions.c LIB_SRCS += miscIocRegister.c +LIB_SRCS += dlload.c LIB_SRCS += iocshRegisterCommon.c + LIBRARY_IOC = miscIoc miscIoc_RCS = miscIoc.rc diff --git a/src/misc/dlload.c b/src/misc/dlload.c new file mode 100644 index 000000000..5b0591d5f --- /dev/null +++ b/src/misc/dlload.c @@ -0,0 +1,25 @@ +/*************************************************************************\ +* Copyright (c) 2009 UChicago Argonne LLC, as Operator of Argonne +* National Laboratory. +* EPICS BASE is distributed subject to a Software License Agreement found +* in file LICENSE that is included with this distribution. +\*************************************************************************/ + +#include "epicsFindSymbol.h" +#include "iocsh.h" +#include "epicsExport.h" + +static const iocshArg dlloadArg0 = { "path/library.so", iocshArgString}; +static const iocshArg * const dlloadArgs[] = {&dlloadArg0}; +static const iocshFuncDef dlloadFuncDef = {"dlload", 1, dlloadArgs}; +static void dlloadCallFunc(const iocshArgBuf *args) +{ + if (!epicsLoadLibrary(args[0].sval)) { + printf("epicsLoadLibrary failed: %s\n", epicsLoadError()); + } +} + +static void dlloadRegistar(void) { + iocshRegister(&dlloadFuncDef, dlloadCallFunc); +} +epicsExportRegistrar(dlloadRegistar); diff --git a/src/misc/dlload.dbd b/src/misc/dlload.dbd new file mode 100644 index 000000000..740ebbbba --- /dev/null +++ b/src/misc/dlload.dbd @@ -0,0 +1,3 @@ +# Including this DBD file adds the 'dlload' command to the IOC shell. + +registrar(dlloadRegistar)