CXL_NEW(3)

CXL_NEW(3) β€” cxl_new πŸŽ€

okay so welcome to the libcxl Manual page for cxl_new, bestie. This is the creation moment where you get a library context handle, and it’s giving main character energy for all your library operations πŸ’…

✨ NAME ✨

cxl_new β€” Create a new library context object that acts as a handle for all library operations 🫢

πŸ“š SYNOPSIS πŸ“š

#include <cxl/libcxl.h>

int cxl_new(struct cxl_ctx **ctx);

πŸ¦‹ DESCRIPTION πŸ¦‹

cxl_new instantiates a new library context, and stores an opaque pointer in ctx. No cap, that pointer is literally your handle. The context is freed by linklibcxl:cxl_unref[3], i.e. cxl_new(3) implies an internal linklibcxl:cxl_ref[3] πŸ’–

πŸ’€ RETURN VALUE πŸ’€

Returns 0 on success, and a negative errno on failure. Possible error codes are:

  • -ENOMEM
  • -ENXIO

🌸 EXAMPLE 🌸

See example usage in test/libcxl.c πŸ‘‘

Copyright Β© 2016 - 2022, Intel Corporation. License GPLv2: GNU GPL version 2 http://gnu.org/licenses/gpl.html. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.

🌈 SEE ALSO 🌈

  • linklibcxl:cxl_ref[3]
  • linklibcxl:cxl_unref[3]

xoxo, this page is brought to you by libcxl, dated 2026-06-30, and filed under CXL_NEW(3) πŸ’–βœ¨

πŸ“¦ where this page comes from
  • arch rolling: ndctl 85-1 Β· LGPL-2.1-only AND GPL-2.0-only AND CC0-1.0 AND MIT
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms