Offline C Runtime Library Reference

Google is a great search engine. When I search for “ftime linux”, the first search hit will be the man page for ftime which is exactly what I wanted. But sometimes I just want the whole manual in PDF format so that I can simply read about functions and scroll through it while I’m trying to decide how I want to implement a particular feature. Hence, having the particular OS’s (Operating System’s) C Runtime Library in a PDF is really great (no knocks on Google).

So, here are a bunch of downloadable C Runtime Libraries in PDF format:

OS Landing Page Direct link to PDF
AIX PDF format documentation for XL C/C++ for AIX, V16.1 PDF direct link for XL C/C++ Language Reference
Linux The GNU C Library PDF direct link for GNU C Library Reference
IBM i (OS/400) PDF file for ILE C/C++ Runtime Library Functions PDF direct link for ILE C/C++ Runtime Library Functions
Windows MSDN C Run-Time Library Reference PDF direct link for C Runtime Library Reference
z/OS z/OS XL C/C++ Runtime Library Reference PDF direct link for z/OS XL C/C++ Runtime Library Reference

For some strange reason, for AIX, IBM produces the a “Language Reference” but not a “Runtime Library Reference” but for IBM i (OS/400) and z/OS they have a proper “C/C++ Runtime Library Reference”. The same is true for the Linux. It is a “Language Reference” but not a “Runtime Library Reference”.

There you go. Enjoy your offline “C/C++ Runtime Library Reference” PDFs.

Note: If anyone has the real/correct link for either AIX or Linux’s “C/C++ Runtime Library Reference”, please send it to me and I will update the posting. Also, if you have a link to HP-UX, Solaris and/or macOS’s “C Runtime Library Reference”, let me know and I’ll post it.

Regards,
Roger Lacroix
Capitalware Inc.

C, Education, IBM i (OS/400), Linux, Programming, Unix, Windows, z/OS Comments Off on Offline C Runtime Library Reference

More RSS Sidebar MQ Content on my Blog

You may have noticed for a couple of weeks that the “IBM MQ” content sidebar was not showing anything. That is because IBM again changed the link. IBM doesn’t publish the information and they love to change it every so often, so for me it is like a game of whack-a-mole.

Someone sent me the RSS feed link for both IBM MQ and WebSphere MQ. I didn’t know that IBM had 2 different ones. So, I posted both RSS sidebars on my blog.

I also decided to add the IBM Developer Messaging Blog RSS feed, Colin Paice Blog RSS feed, Leif Davidsen Blog RSS feed and Lyns Random Thoughts Blog RSS feed.

Hence, enjoy the MQ content.

Regards,
Roger Lacroix
Capitalware Inc.

Capitalware, HPE NonStop, IBM i (OS/400), IBM MQ, Linux, Unix, Windows, z/OS Comments Off on More RSS Sidebar MQ Content on my Blog

Weird Problem related to a Channel Security Exit

I posted the following weird channel security exit problem on the MQSeries ListServer.

I received a lot of emails (both public and private) offering help to the problem. Thanks. It was not an SELinux issue nor was it a corrupt shared library issue. It was an issue related to permissions for a mount point.

Here is the description to the problem followed by the solution:

I’ve got a really weird problem, that the internet seems to say that it is a permission issue with “/tmp” but I’m at a loss.

– Brand new: Red Hat Enterprise Linux Server release 7.6 (Maipo)
– Fresh install of MQ v9.1.0.1 64-bit

Installed MQAUSX into /var/mqm/exits64/ and yes it is a working version that works perfectly on other Linux distributions.

Here is the MQ error message:

08/02/19 12:46:45 - Process(51014.254) User(roger) Program(amqrmppa)
                    Host(someserver) Installation(Installation1)
                    VRMF(9.1.0.1) QMgr(MQA1)
                    Time(2019-02-08T11:46:45.514Z)
                    ArithInsert1(536895861)
                    CommentInsert1(/var/mqm/exits64/mqausx)
                    CommentInsert2(/var/mqm/exits64/mqausx: failed to map segment from shared object: Operation not permitted)
                    CommentInsert3(64)

AMQ6175E: The system could not dynamically load the shared library
'/var/mqm/exits64/mqausx'. The system returned error message
'/var/mqm/exits64/mqausx: failed to map segment from shared object: Operation
not permitted'.

EXPLANATION:
This message applies to UNIX systems. The shared library '/var/mqm/exits64/mqausx' 
failed to load correctly due to a problem with the library.

ACTION:
Check the file access permissions and that the file has not been corrupted.

“mqausx” is a standard Unix/Linux shared library (It is running on tons of Linux servers without issue). Even the “ldd” command gives a weird result:

$ ldd /var/mqm/exits64/mqausx
ldd: warning: you do not have execution permission for `/var/mqm/exits64/mqausx'
        not a dynamic executable

The permissions are set as follows:

chown mqm:mqm mqausx
chmod 750 mqausx

I even tried 777 for permissions. i.e.

-rwxrwxrwx  1 mqm  mqm  247087 Feb  7 15:11 mqausx

It still failed. Its a shared library, what is or how is a shared library “dynamic executable”?

Here is the solution that Josh suggested that worked:

First, issue the following command against your shared library:

$ df /var/mqm/exits64
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/aaa/bbb           5107712   3967288   1140424  78% /var/mqm

Use whatever is under “Mounted on” (i.e. /var/mqm – you may have something else like /var ) in the following command:

$ mount | grep /var/mqm

In my customer’s particular case, their mount point was on /var and the results of the command was:

/dev/aaa/bbb on /var type xfs (rw,nosuid,nodev,noexec,relatime,attr2,inode64,logbsize=256k,sunit=512,swidth=512,noquota)

The source of the issue was that the mount point had “noexec”permission. Hence, once that option was removed then everything went back to normal.

I hope this helps someone else in the future.

Regards,
Roger Lacroix
Capitalware Inc.

IBM MQ, Linux, MQ Auditor, MQ Authenticate User Security Exit, MQ Channel Connection Inspector, MQ Channel Encryption, MQ Channel Throttler, MQ Enterprise Security Suite, MQ Message Encryption, MQ Message Replication, MQ Standard Security Exit, Unix Comments Off on Weird Problem related to a Channel Security Exit

Best Practices for an IBM MQ Channel’s SHARECNV Parameter

I was chatting with Josh the other day and he asked me if I knew that IBM now does not recommend uses the default value of 10 for a channel’s SHARECNV (shared conversation) value. He said that the MQ Knowledge Center recommends for distributed queue managers a value of 1 for a channel’s SHARECNV.

Of course, I said WTF and where did you read that. He emailed me the link and sure enough, that is what it says.

The default settings for client and server connection channels changed in Version 7.0 to use shared conversations. Performance enhancements for distributed severs were then introduced in Version 8.0. To benefit from the new features that were introduced alongside shared conversations, without the performance impact on the distributed server, set SHARECNV to 1 on your Version 8.0 or later server connection channels.

And further down it says:

However, for distributed servers, processing messages on channels that use the default configuration of 10 shared conversations is on average 15% slower than on channels that do not use shared conversations.

A 15% performance hit for using the default value for SHARCNV on distributed queue managers!!! OMG!

From a guy who writes MQ exits, I have always hated the SHARECNV parameter when it has a value greater than 1 because in my opinion, IBM did a horrible job in their implementation of it as it relates to a channel security exit.

When SHARECNV parameter is set to 1, a channel security exit is invoked with the following ExitReason values:

  • MQXR_INIT
  • MQXR_INIT_SEC
  • MQXR_SEC_MSG <- optional
  • MQXR_SEC_PARMS
  • MQXR_TERM
  • When SHARECNV parameter is set to a value greater than 1, i.e. 10, a channel security exit is invoked with the following ExitReason values:

  • MQXR_INIT
  • MQXR_INIT_SEC
  • MQXR_SEC_MSG <- optional
  • MQXR_SEC_PARMS – for session # 1
  • MQXR_SEC_PARMS – for session # 2
  • MQXR_SEC_PARMS – for session # 3
  • MQXR_SEC_PARMS – for session # 4
  • MQXR_SEC_PARMS – for session # 5
  • MQXR_SEC_PARMS – for session # 6
  • MQXR_SEC_PARMS – for session # 7
  • MQXR_SEC_PARMS – for session # 8
  • MQXR_SEC_PARMS – for session # 9
  • MQXR_SEC_PARMS – for session # 10
  • MQXR_TERM
  • Everything looks EXACTLY the same for the 1st session but for session #2 to session #10, the calling sequence is totally different.

    Secondly, did you happen to notice that when all but the last session ends, the channel security exit is NOT made aware of this fact!!! The channel security exit is only invoked with MQXR_TERM when the last session, whichever number that is, terminates (never for the other sessions ending). I have no idea who dreamt this up, but man it is a bad design.

    I am so happy that Josh told me about this little tidbit. Now I get to tell my customers that IBM’s best practices for a channel’s SHARECNV parameter on distributed platforms, is to set it to 1 rather than use the default value of 10.

    It would be interesting to know the performance for z/OS queue managers whose channel’s SHARECNV is set to 10 vs 1.

    Regards,
    Roger Lacroix
    Capitalware Inc.

    HPE NonStop, IBM i (OS/400), IBM MQ, IBM MQ Appliance, Linux, Unix, Windows Comments Off on Best Practices for an IBM MQ Channel’s SHARECNV Parameter

    RIP: MQ Technical Conference

    Capitalware Inc. is a small software company specializing in IBM MQ. Capitalware used to be a vendor at IBM’s Transaction and Messaging Technical Conferences (T&M Conference). IBM merged several conferences including the T&M Conference into Impact 2007. I went as a vendor to Impact 2007 but found that most attendees were not involved in MQ. So, I decided that it would be the last conference I would attend as a vendor. I starting bugging IBM PartnerWorld, marketing and education people to bring back IBM’s T&M conference. This went on for 6 years with IBM people always saying “that is not the direction we are going in”.

    So, in earlier 2013, after many years of frustration, I decided to stick my neck out and create MQ Technical Conference (MQTC). I wanted a technical conference to be focused on IBM MQ (plus IBM products that use MQ) and thought 3 days was a good length. Since, my wife and I have 5 kids, I decided the conference should be at a family-friendly hotel/resort. I had already been to many conferences at Kalahari Resorts in Sandusky, Ohio, so decided it was a good location for MQTC. When I signed the contract with Kalahari Resorts, I had to personally guarantee to pay them $24,000 USD (for food and facilities) regardless if anyone showed up or not (plus penalties for minimum room guarantee). I was pretty nervous about it and hoped attendees would show up.

    It is a lot of work to create a conference, coordinate with vendors, food, audio/video, scheduling of sessions, etc. but I always enjoyed the conference and I believe most attendees found it valuable.

    Last year, Ray Daniel of IBM came to MQTC v2.0.1.8 as part of IBM sponsorship team. He so enjoyed the conference that he decided IBM needed to create its own conference modeled after MQTC. He created a 3-day technical conference called Integration Technical Conference (ITC). Like MQTC, it will have 5 session rooms, like MQTC, it will be heavy into IBM MQ and like MQTC, it will be at a family-friendly venue. The big difference, between ITC and MQTC is that ITC will be FREE to attend. Last year, MQTC v2.0.1.8 costs more than $65,000 USD and I cannot possibly offer a free conference.

    Therefore, I have decided to suspend MQTC as IBM now offers a conference for MQ users which is free.

    I do hope that Ray Daniel continues the tradition of having the cheesecake bar and ice-cream social at ITC. 🙂

    I would like to thank:

  • All of the attendees who came to the 6 MQTC conferences
  • All of the various speakers from a wide variety of industries who spoke at the 6 MQTC conferences
  • All the sponsors who supported the 6 MQTC conferences.
  • Thank you.

    Finally, I would like to especially thank T.Rob Wyatt for his support and help with MQTC.

    Regards,
    Roger Lacroix
    Capitalware Inc.

    P.S. I would like to hear feedback from ITC attendees on core and non-code MQ sessions.

    Capitalware, Education, IBM MQ, MQ Technical Conference 10 Comments

    How to Compile and Link MQ Programs on Linux

    Someone on StackOverflow asked “How to compile a C program without knowing the include files”.

    JasonE gave a really good answer, so I thought I would repeat it here:

  • To compile and link 64-bit MQ applications on Linux, follow the instructions here
  • To compile and link 32-bit MQ applications on Linux, follow the instructions here
  • In summary:

  • -I is for the product includes, which are (For Linux) usually in /opt/mqm/inc
  • -L is the path to the libraries in your example which are (For Linux) usually in /opt/mqm/lib (for 32 bit applications) and /opt/mqm/lib64 (for 64 bit applications)
  • -l (lower case L) is for the required library/libraries
  • and the actual library you need is either:

  • mqm – server bound C applications (ie -lmqm, which links with libmqm.so)
  • mqic – client bound C applications (ie -lmqic, which links with libmqic.so)
  • and a suffix of _r if you are building as a threaded application (ie you are linking with -lpthread as well, ie providing -lmqm_r or -lmqic_r which in effect links with libmqm_r.so or libmqic.so)

    cmqc.h is the name of the main header file, and there are other cmq*.h headers you can optionally include as well.

    Regards,
    Roger Lacroix
    Capitalware Inc.

    C, C++, IBM MQ, Linux, Programming Comments Off on How to Compile and Link MQ Programs on Linux

    Knock knock

    IBM: Knock knock
    User: Who’s there?
    IBM: MQ
    User: MQ who?
    IBM: IBM MQ Client for macOS

    In case you didn’t hear, IBM has released “IBM MQ macOS toolkit for developers” a couple of days ago.

    I downloaded and installed it. I simply uncompressed it into my home directory. I played around with a bunch of commands (dspmqver, amqsputc, amqgetc, etc.) and everything worked as expected for an MQ client install.

    I do C and Java development on a whole variety of platforms: AIX, HP-UX, Linux, IBM i (OS/400), Solaris, Windows and z/OS. I’ve only ever done Java development on macOS, so I thought I would have some fun and compile & link some C samples on macOS.

    I did some internet searches and people said that you can use a Linux makefile with some tweaks on macOS. So, I copied the amqsput0.c and amsget0.c from a Linux server and also copied over a makefile I have on a Linux server to my macOS. After a couple of tweaks, I got it to compile and link those 2 MQ sample files.

    Here is the makefile I used:

    #
    # makefile for MQ applications on macOS
    #
    CC = clang
    CFLAGS = -std=c99 -pedantic -Wall
    
    MQINSTALLPATH = $(HOME)/IBM-MQ-Client-Mac-x64-9.1.1.0
    MQINC = -I$(MQINSTALLPATH)/inc
    MQLIBPATH64 = -L$(MQINSTALLPATH)/lib64
    MQLIB = -lmqic_r
    
    all: amqsgetc amqsputc
    
    amqsget0.o: amqsget0.c
    	$(CC) $(CFLAGS) $(MQINC) -c amqsget0.c
    
    amqsgetc: amqsget0.o
    	$(CC) amqsget0.o -o amqsget0 $(MQLIBPATH64) $(MQLIB)
    
    amqsput0.o: amqsput0.c
    	$(CC) $(CFLAGS) $(MQINC) -c amqsput0.c
    
    amqsputc: amqsput0.o
    	$(CC) amqsput0.o -o amqsput0 $(MQLIBPATH64) $(MQLIB)
    
    clean:
    	rm -f *.o amqsgetc amqsputc

    When I tried to run either of the 2 programs, I got the following error:

    dyld: Library not loaded: @rpath/libmqic_r.dylib

    After a few internet searches, I discovered that I needed to set DYLD_LIBRARY_PATH environment variable. It is like LD_LIBRARY_PATH on Linux.

    export DYLD_LIBRARY_PATH=$HOME/IBM-MQ-Client-Mac-x64-9.1.1.0/lib64

    When I did that, then everything worked as expected.

    Now for those that are paying attention, the first question should be, how did the amqsputc and amqsgetc that were included in the {MQ_INSTALL_DIR}/samp/bin/ directory work? It is because the IBM developer who compiled & linked those MQ samples explicitly set the “rpath” linker setting. Since they control where the dynamic libraries are in relation to the MQ samples, they simply set rpath as “../../lib64/”.

    If you want to do the same then your makefile will look like:

    #
    # makefile for MQ applications on macOS
    #
    CC = clang
    CFLAGS = -std=c99 -pedantic -Wall
    
    MQINSTALLPATH = $(HOME)/IBM-MQ-Client-Mac-x64-9.1.1.0
    MQINC = -I$(MQINSTALLPATH)/inc
    MQLIBPATH64 = -L$(MQINSTALLPATH)/lib64
    MQLIB = -lmqic_r
    
    RTL64 = -Wl,-rpath,$(MQINSTALLPATH)/lib64
    
    all: amqsgetc amqsputc
    
    amqsget0.o: amqsget0.c
    	$(CC) $(CFLAGS) $(MQINC) -c amqsget0.c
    
    amqsgetc: amqsget0.o
    	$(CC) amqsget0.o -o amqsget0 $(MQLIBPATH64) $(MQLIB) $(RTL64)
    
    amqsput0.o: amqsput0.c
    	$(CC) $(CFLAGS) $(MQINC) -c amqsput0.c
    
    amqsputc: amqsput0.o
    	$(CC) amqsput0.o -o amqsput0 $(MQLIBPATH64) $(MQLIB) $(RTL64)
    
    clean:
    	rm -f *.o amqsgetc amqsputc

    I don’t recommend you do this unless you have tight control over where the MQ Client installation will be located. I think it is easier to simply set the DYLD_LIBRARY_PATH environment variable.

    Regards,
    Roger Lacroix
    Capitalware Inc.

    C, IBM MQ, macOS (Mac OS X), Programming Comments Off on Knock knock

    SQLite v3.27.1 Released

    D. Richard Hipp has just released SQLite v3.27.1.
    https://www.sqlite.org/news.html

    SQLite is a software library that implements a self-contained, serverless, zero-configuration, transactional SQL database engine. SQLite is the most widely deployed SQL database engine in the world. The source code for SQLite is in the public domain.

    Regards,
    Roger Lacroix
    Capitalware Inc.

    C, Database, IBM i (OS/400), Linux, macOS (Mac OS X), Open Source, Programming, Unix, Windows, z/OS Comments Off on SQLite v3.27.1 Released

    IBM MQ V9.1.2 Announced

    IBM has announced IBM MQ V9.1.2:
    http://www.ibm.com/common/ssi/ShowDoc.wss?docURL=/common/ssi/rep_ca/1/877/ENUSZP19-0031/index.html

      Highlights:

    • MQ V9.1.2 base automatically balances a pool of connected applications across a set of available queue managers.
    • MQ V9.1.2 base provides enhanced REST Messaging performance with connection pools.
    • MQ Advanced V9.1.2 includes the capabilities in MQ V9.1.2 base and new REST API calls for MQ Managed File Transfer (MQ MFT) administration.
    • MQ Appliance V9.1.2 firmware includes the capabilities in MQ V9.1.2, and also the capability to stream logs off the MQ Appliance. Version 9.1.2 firmware is available for the following appliances:
      • MQ Appliance M2000
      • MQ Appliance M2001
      • MQ Appliance M2002

    Planned availability for IBM MQ V9.1.2 is March 21, 2019 for Electronic software delivery.

    IBM MQ (aka WebSphere MQ) homepage
    https://www.ibm.com/products/mq

    Regards,
    Roger Lacroix
    Capitalware Inc.

    Fix Packs for MQ, IBM MQ, IBM MQ Appliance, Linux, Unix, Windows, z/OS Comments Off on IBM MQ V9.1.2 Announced

    IBM MQ macOS toolkit for developers

    IBM releases IBM MQ macOS toolkit for developers. I’m shocked and wildly surprised that IBM did this.
    https://developer.ibm.com/messaging/2019/02/05/ibm-mq-macos-toolkit-for-developers/

    This toolkit provides the ability to develop and interact directly with MQ from your Mac, for developers using the language interfaces; such as C, C++, COBOL, GoLang, and Node.js; which are built on the platform-native C library (libmqm) . This extends the capability we already provide for Java developers on Mac, with the IBM MQ com.ibm.mq.allclient.jar.

    I downloaded and installed it. You are getting the IBM MQ Client components for macOS. For some strange reason, MQ Explorer is still not available for macOS (that’s the only downside).

    Hopefully, sometime in the future, IBM will port the MQ server components to macOS.

    Regards,
    Roger Lacroix
    Capitalware Inc.

    C, C++, IBM MQ, Java, JMS, macOS (Mac OS X), Programming Comments Off on IBM MQ macOS toolkit for developers