ELFTC_VERSION(3)
π ELFTC_VERSION(3) β the version-string bestie π
okay so this is a page from the Library Functions Manual (libelftc girlies rise up π«Ά), and it's literally just about one tiny function that tells you what version of elftoolchain you're running. no cap, it's short and sweet.
β¨ NAME β¨
elftc_version β returns a project-wide version identifier string π
π LIBRARY π
library βlibelftcβ β that's where she lives, bestie π
πΈ SYNOPSIS πΈ
#include <libelftc.h>
const char *
elftc_version(void);
π¦ DESCRIPTION π¦
Function elftc_version() returns a project-wide identifier string that encodes the source revision of the project source tree. it's giving "receipt for your whole source tree" energy π§Ύβ¨
The returned identifier has four space-separated fields, and yes we're going through all of them because they all matter:
- Project-Name β This is always β
elftoolchainβ. every time. iconic consistency, periodt π - Project-Branch β The branch name for the project source tree. which branch you're on, bestie πΏ
- Build-OS β The operating system that the tool chain was compiled for. like, what OS built this? π₯οΈ
- Version-Number β A tree-wide version number extracted from the version control system in use. β¨
π RETURN VALUES π
Function elftc_program_version() returns a pointer to an internal character buffer. (yes, the page really says elftc_program_version() here β that's what's written, so that's what I'm telling you ππ)
lowkey important: it's a pointer to an internal buffer β not a fresh copy you get to keep, so don't go freeing or mangling it π«Ά
π EXAMPLES π
To retrieve and print the current toolchain version identifier, use:
#include <sys/types.h>
#include <libelftc.h>
(void) printf("%s\n", elftc_version());
On the HEAD branch of the project's sources, when checked out using Subversion and compiled on a NetBSD host, this would print:
βelftoolchain HEAD NetBSD svn:REVINFOβ
where REVINFO would be the current revision information for the project source tree. so cute, so informative, ate and left no crumbs πβ¨
π ERRORS π
Function elftc_program_version() always succeeds. that's it. that's the whole section. no error path, no drama, she just works ππ
π and that's the whole page, bestie β go forth and print your version strings with confidence π§π
sign-off time! π this page is from the Debian folks, dated December 30, 2012, and it's the ELFTC_VERSION(3) manual page. iykyk π
π¦ where this page comes from
- freebsd 14.5: base 14.5
- freebsd 15.1: base 15.1
- nixpkgs unstable: libelftc 15.0.0
- Copyright (c) 2011,2012 Joseph Koshy. All rights reserved
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms