PMNEWZONE(3)

๐Ÿ“ฆ
version 7.2.2 ยท 2 versions
, in arch rolling, centos-stream 10, fedora 43, fedora 44, ubuntu resolute, ubuntu stonking

PMNEWZONE(3) ๐Ÿ’–

okay bestie, welcome to the Library Functions Manual for PCP (that's Performance Co-Pilot, iykyk) โ€” this one's all about the reporting timezone and honestly? it's giving "tiny function, huge vibes." โœจ


๐ŸŒธ NAME ๐ŸŒธ

pmNewZone</p> โ€” establish a reporting timezone ๐Ÿ•ฐ๏ธ


๐ŸŽ€ C SYNOPSIS ๐ŸŽ€

#include <pcp/pmapi.h>

int pmNewZone(const char *tz);

cc ... -lpcp

like yes, that's the whole thing, she's short and she knows it ๐Ÿ’…


๐Ÿฆ‹ DESCRIPTION ๐Ÿฆ‹

so here's the tea: there's a thing called the current reporting timezone, and it's lowkey the main character of this whole page. it's the timezone that pmCtime(3) and pmLocaltime(3) use when they're doing their little time conversions. so if you change it, those two change their whole attitude. periodt. โฐ

the argument tz is where you pass in your timezone string โ€” and it's in the exact same format as the one described for the TZ environment variable. so go peep environ(7) if you need the deets, bestie, no cap. ๐Ÿ“–

and what does pmNewZone actually do? two things, both iconic:

  1. it sets the current reporting timezone to whatever tz says, and
  2. it returns a value โ€” and that value is not just decoration, honey. you can pass it into a later call to pmUseZone(3) to restore this exact reporting timezone. it's like a save point. main character energy fr fr. ๐ŸŽฎโœจ

๐Ÿ’€ DIAGNOSTICS ๐Ÿ’€

if the return value comes back less than zero, that's a ๐Ÿšจ fatal error ๐Ÿšจ from a system call. and the most likely culprit? our old friend malloc(3). so if you see a negative number, don't panic, just... check your memory allocation situation. ๐Ÿ™ˆ

lowkey a warning: negative return = something went very wrong at the system-call level. treat it accordingly, bestie. ๐Ÿ˜ญ

๐Ÿซถ SEE ALSO ๐Ÿซถ

the whole squad, in alphabetical order because we're organized queens ๐Ÿ‘‘


and that's the whole page, babe!! ๐ŸŒˆ this little icon of a manpage comes to you from Performance Co-Pilot (that's the PCP crew ๐Ÿ’–) and it lives in section PMNEWZONE(3) of the manual. go forth and timezone responsibly, bestie โ€” you got this. ๐Ÿ‘‘๐Ÿ’œ

๐Ÿ“ฆ where this page comes from