s390_sthyi(2)
β¨ s390_sthyi(2) β¨
okay bestie, so this is the manual page for s390_sthyi from section 2 (that's the system calls girlies π
) of the System Calls Manual. it's giving very niche, very s390, very main character. let's get into it π«Ά
πΈ NAME πΈ
s390_sthyi β emulate STHYI instruction
like, that's literally the whole vibe. it pretends to do the thing. iconic.
π LIBRARY π
Standard C library (libc, -lc)
π¦ SYNOPSIS π¦
#include <asm/sthyi.h> /* Definition of STHYI_* constants */
#include <sys/syscall.h> /* Definition of SYS_* constants */
#include <unistd.h>
int syscall(SYS_s390_sthyi, unsigned long function_code,
void *resp_buffer, uint64_t *return_code,
unsigned long flags);
not me having to say this: glibc provides no wrapper fors390_sthyi(), so you literally have to go throughsyscall(2). no cute little convenience function for us. we do it raw β¨
π DESCRIPTION π
The s390_sthyi() system call emulates the STHYI (Store Hypervisor Information) instruction. it hands you hardware resource info for the machine and all its virtualization levels β CPU type and capacity, the machine model, and a whole bunch of other metrics. very "here's your whole entire origin story" of it π
The function_code argument says which function to actually perform. these are the code(s) we support, and there is exactly one:
STHYI_FC_CP_IFL_CAPβ return CP (Central Processor) and IFL (Integrated Facility for Linux) capacity information. periodt.
The resp_buffer argument is the address of a response buffer. when function_code is STHYI_FC_CP_IFL_CAP, that buffer must be one page (4K) in size β no smaller, bestie, don't try it π. if the system call returns 0, the response buffer gets filled with CPU capacity info. otherwise? the response buffer's content is unchanged. nothing happens to it. it just sits there.
The return_code argument stores the return code of the STHYI instruction, and it's one of these two:
0β Success. slay.4β Unsupported function code. π
want more deets on return_code, function_code, and resp_buffer? the reference is down in NOTES, go look π
The flags argument exists purely to allow for future extensions, and right now it must be set to 0. that's it. zero. don't be creative π§
π RETURN VALUE π
On success (that is: emulation succeeded), the return value of s390_sthyi() matches the condition code of the STHYI instructions, which is a value in the range [0..3].
- a return value of
0means CPU capacity information is stored in*resp_bufferβ - a return value of
3means "unsupported function code", and the content of*resp_bufferis unchanged π - the return values
1and2are reserved. don't touch, don't interpret, don't make it weird.
On error, -1 is returned, and errno is set to indicate the error.
π₯ ERRORS π₯
EFAULTβ the value specified inresp_bufferorreturn_codeis not a valid address. (bad pointer bestie, we've all been there)EINVALβ the value specified inflagsis nonzero. we said0. we meant0.ENOMEMβ allocating memory for handling the CPU capacity information failed. out of memory, of course πEOPNOTSUPPβ the value specified infunction_codeis not valid. that function code is not it.
β STANDARDS β
Linux on s390.
π HISTORY π
Linux 4.15.
π NOTES π
- for the full details of the STHYI instruction, go read the documentation page π
- when you're going through the system call interface, your response buffer does not have to fulfill the alignment requirements described in the STHYI instruction definition. cute, right?
- the kernel caches the response (for up to one second, as of Linux 4.16). so subsequent system call invocations may return the cached response. yes, it's giving "I already answered that" energy π
π SEE ALSO π
syscall(2)β the one true doorway πͺ
vibe check complete. you now know everything this page knows, no cap. go forth and emulate that instruction π β¨
this has been the s390_sthyi(2) page, brought to you by Linux man-pages 6.20, dated 2026-02-08, mwah π«Ά
π¦ where this page comes from
- arch rolling: man-pages 6.20-1 Β· BSD-2-Clause AND BSD-3-Clause AND BSD-4.3TAHOE AND BSD-4-Clause-UC AND GPL-1.0-or-later AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-or-later AND LGPL-3.0-linking-exception AND LGPL-3.0-or-later AND LicenseRef-Public-Domain AND LicenseRef-UltraPermissive AND Linux-man-pages-1-para AND Linux-man-pages-copyleft AND Linux-man-pages-copyleft-2-para AND Linux-man-pages-copyleft-var AND MIT AND Spencer-94
- nixpkgs unstable: man-pages 6.20
- π the page's license: GPL-2.0-or-later
- Copyright 2017, International Business Machines Corp
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms