PMUSEZONE(3)

πŸ“¦
version 7.2.2 Β· 2 versions
, in arch rolling, centos-stream 10, fedora 43, fedora 44, ubuntu resolute, ubuntu stonking

πŸ’– PMUSEZONE(3) πŸ’–

okay bestie, welcome to pmUseZone β€” the lil glow-up button for your reporting timezone ✨ (yes it's a section 3 library function, we're in the C trenches today, hydrate first πŸ«–)


πŸŽ€ NAME πŸŽ€

pmUseZone β€” re-establish a reporting timezone πŸŒπŸ’…

no cap, that's the whole job. it takes a timezone you already made and makes it the timezone again. main character energy, but for zones.


✨ C SYNOPSIS ✨

#include <pcp/pmapi.h>

int pmUseZone(const int tz_handle);

cc ... -lpcp

so you're gonna #include <pcp/pmapi.h> first, obviously 🫢, then call pmUseZone with a const int tz_handle and it hands you back an int. when you link, you need cc ... -lpcp β€” do not forget the -lpcp or the linker will simply Not Know Her 😭


πŸ¦‹ DESCRIPTION πŸ¦‹

okay so here's the tea β˜• β€” there's a thing called the current reporting timezone, and it's lowkey the boss of two other functions: pmCtime(3) and pmLocaltime(3) are both out here reading whatever the current reporting timezone is set to. they don't have their own opinions. they're just following her lead. periodt.

so the argument tz_handle is an identifier for a reporting timezone that was previously established by a call to pmNewZone(3) or pmNewContextZone(3) β€” like, you gotta have made it first, bestie, we're not manifesting zones out of thin air πŸ™ˆ β€” and once you pass it in, that zone becomes the current reporting timezone. boom. switched. iconic.


πŸ’€ DIAGNOSTICS πŸ’€

if the return value comes back less than zero, that means the value of tz_handle is not legal. like, not a real handle. not one of ours. the vibe check failed fr fr 😭 go back and check which zone you're actually holding.


🌈 SEE ALSO 🌈

your required reading, bestie, go be nosy πŸ‘‘:


and that's the whole page, no notes πŸŽ€ it's brought to you by Performance Co-Pilot (aka PCP, the queen herself πŸ‘‘), filed under PMUSEZONE(3). go set your zones, bestie β€” slay πŸ’…βœ¨πŸ¦‹

πŸ“¦ where this page comes from