Preface ------- QNX4 is a great and exciting operating system (thanks Dan), and I am a user of QNX 4 since the first version was available to the market. I am using QNX 4 to solve my realtime programming tasks, it is unbeatable. On the other side there is LINUX, a very well OS for big database servers. During my proramming tasks with LINUX I have often missed some of the very usefull message-passing functions. Because of this I have written an emulator library in 1993 that provides some of these functions. Now I have rewritten the whole library, and if you are interested, feel free to use it. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this library, see the file COPYING. If not, write to the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. In other words, you are welcome to use, share and improve this program. You are forbidden to forbid anyone else to use, share and improve what you give them. Help stamp out software-hoarding! If you have any suggestions, feel free to contact me at q4l@akso.de. The library is still under development. I have made very intense tests, but I am sure, the are some bugs. Be aware: The library makes some interesting QNX4-functions available under LINUX, but it is still impossible to get the same speed or stability. The message passing under QNX is running on the level of the microkernel, this can't be made better. Do not expect the same speed or small code with LINUX. LINUX is great, but it's an elephant compared with QNX. Provided Functions ------------------ void _qnx_close_socket(void) int atoh(char *in) void delay(unsigned msec) int check_prunning(pid_t pid) int strnicmp(char *p1,char *p2,int n) char *strlwr(char *s) char *strupr(char *s); long filelength(int fd) void qnx_display_msg(char *text) char *qnx_fullpath(char *fullpath,char *path) int Reply(pid_t pid,void *out,unsigned outlen) int Replymx(pid_t pid,unsigned sparts,struct _mxfer_entry *smsg) pid_t Receive(pid_t pid,void *in,unsigned nbytes) pid_t Receivemx(pid_t pid,unsigned parts,struct _mxfer_entry *rmsg) pid_t Creceive(pid_t pid,void *in,unsigned nbytes) int Send(pid_t pid,void *out,void *in,unsigned outlen,unsigned inlen) int Sendmx(pid_t pid,unsigned sparts,unsigned rparts, struct _mxfer_entry *smsg,struct _mxfer_entry *rmsg) pid_t qnx_proxy_attach(pid_t pid,char *data,int nbytes,int priority) int qnx_proxy_detach(pid_t proxy) int qnx_name_locate(int nid,char *name,unsigned size,int *copies) int qnx_name_detach(int nid,int name_id) int qnx_name_attach(int nid,char *name) pid_t qnx_proxy_attach(pid_t pid,char *data,int nbytes,int priority) timer_t mktimer(int timer_type,int notify_type,struct itimercb *itimercb) int rmtimer(timer_t timerid) int reltimer(timer_t timerid,struct itimerspec *value,struct itimerspec *ovalue) pid_t Trigger(pid_t proxy) int _qnx_squery(int typ,void *dest) int _qnx_squery_next(void *dest) int setprio(pid_t pid,int value) char *itoa(int val,char *dest,int base) Installation ------------ Unpack the files into a directory. You will find a demon called qnxemul. This program must be run in the background as root. TCP/IP must be installed. The communication port is 7779. Make a directory named /usr/include/aks and copy the header files qnxemul.h and sendmx.h to /usr/include/aks. Usage ----- You must include aks/qnxemul.h into your programs and the object file qnxservice.o must be linked with your application. qnxservice provides the interface to the emulator-demon. Enter qnxservice -? to get help The following verbose levels are defined: 0 no output 1 output internal errors 2 output corrected communication errors 3 output garbage collection 4 output processing of timers, proxys and names 5 output message flow 6 output message flow setup 7 output internal buffer handling and internal timing 8 output socket I/O 9 for debugging Look into qnxtest.c, qnxfmtest.c, qnxptest.c and qnxpttest2.c. These programes are written to test the library. A program named "sin" (system information) is also contained. This "sin" unterstands a subset of the options of the original QNX 4 sin. The following commands are provided: sin show the status of all processes that are currently using the emulator sin pr show the status of all the installed proxies sin na show all attached names sin rt show all installed timers and their state To be do -------- much more better documentation network-wide transmissions are not implemented testing .... Have fun Andre Koppel