zoneid

0.2.0 • Public • Published

zoneid: Binding for illumos zone-related library functions

This package exposes the following libc functions on illumos systems:

#include <zone.h>

zoneid_t getzoneid(void);
zoneid_t getzoneidbyname(const char *name);
ssize_t getzonenamebyid(zoneid_t id, char *buf, size_t buflen);

For details on these functions, see getzoneid(3c).

Synopsis

Here's an example use:

var mod_assert = require('assert');
var mod_zoneid = require('zoneid');

var myzoneid = mod_zoneid.getzoneid();
var myzonename = mod_zoneid.getzonenamebyid(myzoneid);

console.log(myzoneid);
console.log(myzonename);
mod_assert.equal(myzoneid, mod_zoneid.getzoneidbyname(myzonename));

In the global zone, this prints:

0
global

In a non-global zone, this could print:

71
a2cf54c9-ec0d-412d-b40d-d38c6092b114

/zoneid/

    Package Sidebar

    Install

    npm i zoneid

    Weekly Downloads

    2

    Version

    0.2.0

    License

    MIT

    Last publish

    Collaborators

    • bahamat
    • todd.whiteman
    • kusor
    • michael.hicks
    • trentm
    • dap
    • jclulow
    • arekinath
    • melloc
    • kellymclaughlin