The thread-safe GCI is provided in gcits.hf.
(GciSession) GciTsNbLogin(
const char *StoneNameNrs,
const char *HostUserId,
const char *HostPassword,
BoolType hostPwIsEncrypted,
const char *GemServiceNrs,
const char *gemstoneUsername,
const char *gemstonePassword,
unsigned int loginFlags,
int haltOnErrNum,
int *loginPollSocket /* output */
);
Starts a GciTsLogin in a separate thread. You must call GciTsLoginFinished to determine if login is complete. While the login is in progress, any GciTs call other than GciTsLoginFinished will return an error.
While the login is executing, the file descriptor returned in *loginPollSocket can be polled, when read-ready the login is complete.
You can now specify the symbol version for an FFI callout, to prevent accidentally calling the wrong version of the routine.
CCallout >> version: aString
The argument aString will be used as third argument to dlvsym()
Previously, the FFI errno was in session state, and could be accessed incorrectly if the GsProcess was preempted at the wrong time. Now, the FFI errno is part of the GsProcess state. This does not affect customer code. (#48524)
The following methods have been added:
CByteArray >> utf16From: zeroBasedStart to: zeroBasedEnd
Return a new instance of Utf16 containing the specified bytes of the receiver.
CByteArray >> utf8From: zeroBasedStart to: zeroBasedEnd
Return a new instance of Utf8 containing the specified bytes of the receiver.
CByteArray class >> withAll: anObject nullTerminate: aBoolean
anObject may be a String, ByteArray, Utf8, Utf16 or CByteArray. Returns a new instance of the receiver containing a copy of the bytes of the argument. If aBoolean is true, the resulting CByteArray contains the bytes of the argument plus a terminator byte (or Utf16 codepoint) with value zero. If argument is a Utf16, the result has code points in CPU byte order.
Note that ByteArray usually stores integers in big-endian order, not CPU native byte order.
In earlier releases, the error handling block of an on:do: could not handle an error in a user action, and then return from the error handling block. This case resulted in infinite recursion signaling an UncontinuableError.(#49040)
An error from a user action now signals the new error 2758, ERR_EXC_RETURN_DISALLOWED: A return from on:do: would cross frame of C primitive, user action, or FFI call. This is handled correctly by the on:do:.
To allow debugging of the original error, a new Gem runtime parameter, GemDebuggerActive, allows you to retrieve a stack trace for the original error. When GemDebuggerActive is set to true, the on:do: does not handle error 2758, and control returns to the command line. At this point, in topaz, you can fetch the stack using commands such as where.
In an execution that was started from a GciNbPerform* or GciNbExecute* call, if the code invokes a client useraction, the gem would freeze until a further call such as GciNbEnd. (#48658)
User actions are now disallowed during non-blocking GCI execution. User actions have always been disallowed when using the thread safe GCI, GciTs.
The flag GCI_PERFORM_NON_BLOCKING was renamed to GCI_PERFORM_noClientUseraction.
Red Hat Linux ES 8.1: gcc/g++ 8.3.1
Red Hat Linux ES 7.x: gcc/g++ 4.8.5
Ubuntu 20.04 LTS: gcc/g++ 9.3.0
g++ -fmessage-length=0 -fcheck-new -O3 -ggdb -m64 -pipe
-D_REENTRANT -D_GNU_SOURCE -pthread -fPIC -fno-strict-aliasing
-fno-exceptions -I$GEMSTONE/include -x c++ -c userCode.c
-o userCode.o
The following warn flags are recommended for compilation:
-Wformat -Wtrigraphs -Wcomment -Wtrigraphs
-Wno-aggregate-return -Wswitch -Wshadow -Wunused-value
-Wunused-variable -Wunused-label -Wno-unused-function
-Wchar-subscripts -Wmissing-braces -Wmissing-declarations
-Wmultichar -Wparentheses -Wsign-compare -Wsign-promo
-Wwrite-strings -Wreturn-type -Wno-format-truncation
-Wuninitialized
CC -xO4 -m64 -xarch=generic -Kpic -mt -D_REENTRANT
-D_POSIX_PTHREAD_SEMANTICS -I$GEMSTONE/include
-features=no%except -c userCode.c -o userCode.o
xlC_r -O3 -qstrict -qalias=noansi -q64 -+ -qpic
-qthreaded -qarch=pwr6 -qtune=balanced -D_LARGEFILE64_SOURCE
-DFLG_AIX_VERSION=version -D_REENTRANT -D_THREAD_SAFE
-qminimaltoc -qlist=offset -qmaxmem=-1 -qsuppress=1500-010:1500
-029:1540-1103:1540-2907:1540-0804:1540-1281:1540-1090:1540-2988
-qnoeh -I$GEMSTONE/include -c userCode.c -o userCode.o
Depending on your version of AIX, you need to include -DFLG_AIX_VERSION=71 or -DFLG_AIX_VERSION=72.
Also note that there is no space in the -qsuppress arguments that are continued on the following line.
g++ -fmessage-length=0 -O3 -ggdb -m64 -pipe -fPIC
-fno-strict-aliasing -D_LARGEFILE64_SOURCE -D_XOPEN_SOURCE
-D_REENTRANT -D_GNU_SOURCE -I$GEMSTONE/include -x c++
-c userCode.c -o userCode.o
The following warn flags are recommended for compilation:
-Wno-format -Wtrigraphs -Wcomment -Wsystem-headers -Wtrigraphs
-Wno-aggregate-return -Wswitch -Wshadow -Wunused-value
-Wunused-variable -Wunused-label -Wno-unused-function
-Wchar-subscripts -Wno-conversion -Wmissing-braces -Wmultichar
-Wparentheses -Wsign-compare -Wsign-promo -Wwrite-strings
-Wreturn-type -Wno-nullability-completeness
-Wno-expansion-to-defined
cl /W3 /Zi /MD /O2 /Oy- -DNDEBUG /TP /nologo /D_LP64 /D_AMD64_
/D_CONSOLE /D_DLL /DWIN32_LEAN_AND_MEAN
/D_CRT_SECURE_NO_WARNINGS /EHsc
/DNATIVE /I 'VisualStudioInstallPath\atlmfc\include'
/I 'VisualStudioInstallPath\VC\include'
/I 'C:\Program Files (x86)\Microsoft
SDKs\Windows\v7.0A\Include'
/I '%GEMSTONE%\include' -c userCode.c -FouserCode.obj
link /LIBPATH:"VisualStudioInstallPath\VC\lib\amd64"
/LIBPATH:"C:\Program Files (x86)\Microsoft
SDKs\Windows\v7.0A\Lib\x64" -RELEASE
/OPT:REF /INCREMENTAL:NO /MAP /nologo /MANIFEST
/MANIFESTFILE:userAppl.exe.manifest
/MANIFESTUAC:"level='asInvoker'" userCode.obj
%GEMSTONE%\lib\gcirpc.lib ws2_32.lib netapi32.lib advapi32.lib
comdlg32.lib user32.lib gdi32.lib kernel32.lib winspool.lib
Secur32.lib /out:userAppl.exe