Skip to content

Latest commit

 

History

History
61 lines (38 loc) · 2.12 KB

demi_init.md

File metadata and controls

61 lines (38 loc) · 2.12 KB

demi_init()

Name

demi_init - Initializes Demikernel.

Synopsis

#include <demi/libos.h>

int demi_init(int argc, char *const argv[]);

Description

demi_init() initializes Demikernel. It sets up devices, instantiates LibOSes, and performs general initialization tasks.

The argv parameter is an array of argument strings passed to Demikernel. The argc parameter is a positive integer that specifies the length of that array.

The array of argument strings provides Demikernel with various information that are critical for its initialization. For instance, these arguments shall state which LibOSes should be initialized, and whether or not runtime features shall be turned on.

All arguments supported by Demikernel are listed in the table below. Arguments that are not listed therein are ignored.

ID Argument Description Supported OS
ARG-4 --catnap Enables Linux Sockets LibOS Linux
ARG-5 --catnip Enables DPDK LibOS Linux
ARG-6 --catpowder Enables Linux Raw Sockets LibOS Linux

These arguments are mutually exclusive. Demikernel currently does not support multiple LibOSes to co-exist. Issue #158 tracks progress of this feature.

Return Value

On success, zero is returned. On error, a positive error code is returned and any subsequent call to Demikernel may result in unexpected behavior.

Errors

On error, one of the following positive error codes is returned:

  • EINVAL - The argc argument is less than or equal to zero.
  • EINVAL - The argv argument is NULL.
  • EEXIST - The LibOS has already been initialized.

Conforming To

Error codes are conformant to POSIX.1-2017.

Bugs

Demikernel may fail with error codes that are not listed in this manual page.

Disclaimer

Any behavior that is not documented in this manual page is unintentional and should be reported.