Skip to content

Latest commit

 

History

History
50 lines (35 loc) · 1.21 KB

README.md

File metadata and controls

50 lines (35 loc) · 1.21 KB

Mojo's libc support

Getting Started

The only dependency for libc is Mojo.

You can install Mojo following the instructions from the Modular website.

Once you have created a Mojo project using the magic tool,

  1. Add the mojo-community channel to your mojoproject.toml, e.g:
    [project]
    channels = ["conda-forge", "https://conda.modular.com/max", "https://repo.prefix.dev/mojo-community"]
  2. Add libc as a dependency:
    [dependencies]
    libc = ">=0.1.4"
  3. Run magic install at the root of your project, where mojoproject.toml is located
  4. libc should now be installed as a dependency. You can import libc functions from the library, e.g:
    from libc import socket

Supported Functionality

Basic socket connections

See the examples in examples/sockets/ directory.

Basic file system operations

See the examples in examples/files/ directory.

Building the project

To build the project, execute the following command:

./scripts/build.sh

Running the tests

To run the tests, execute the following command:

./scripts/run-tests.sh