Giter Club home page Giter Club logo

mqueue-mac's Introduction

mqueue-mac

Implementation of POSIX mqueue using System V messages.

23-January-2022
James P. Parziale

Description

I got frustrated not being able to test code that uses mqueue.h on the Mac. So I attempted to kludge an mqueue that will work on the Mac to satisfy simple programs that use mqueue's.

I make no guarantee that it will work exactly like mqueue, if it will work for you at all. But it works well enough for me to debug some Linux programs on my Mac.

Build

To build, just use make in the main directory. This will create mqueue.o, and then go into the test directory and create mq_client and mq_server.

Run a test

You can run the test programs using make run

Both mq_client and mq_server open a receive queue for themselves. mq_client opens a send queue to the server, then sends its queue name to the server. mq_server receives the client's queue name and uses it to open a send queue back to the client.

The client prompts for text to be entered from stdin. It sends the text to the server, which prints it and sends it back to the client.

If the user enters ^D to the client's prompt, the client sends a special string to the server which causes it to exit its loop and both the client and server terminate.

@TODO

It would also be possible to add signal handlers to catch ^C and gracefully terminate the programs as well.


mqueue-mac's People

Contributors

nuncio-bitis avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.