Stdlib module kernel/users.vitl

This page is a wiki-style reference for one concrete stdlib file. It explains what the file owns, where it fits in the family, and how to decide whether this is the right surface to depend on.

Visual portrait of kernel/users.vitl
Wiki-style portrait for kernel/users.vitl.

Family: kernel

Kind: public stdlib surface

Page style: this reference follows the same “encyclopedic card + portrait + usage contract” logic as the keyword pages, but for stdlib modules.

Summary

Overview

FieldValue
Pathkernel/users.vitl
Familykernel
Kindpublic stdlib surface
Line count330
Declared procedures46
Declared forms/picks3

`kernel/users.vitl` is a public stdlib surface inside the `kernel` family. It should be read as one focused slice of the broader family responsibility: System-facing runtime helpers such as process, scheduler, threads, sync, users, signals, network, device, and memory.

Purpose

This file should be chosen because of responsibility, not because its name “sounds close enough”. Inside the kernel family, it carries one focused part of the contract and keeps that responsibility separate from neighboring concerns.

  • A service manager may use scheduler, process, and signals while keeping policy in separate code.
  • A network-facing runtime should explain why it depends on kernel surfaces instead of lighter families.

Taxonomy

Think of this page as a generated encyclopedia entry rather than a hand-written tutorial. The goal is to show what kind of module this is, how dense it is, and what reading strategy makes sense before depending on it.

  • Large algorithm surface: this file exposes many procedures and likely acts as a domain toolkit rather than a single thin wrapper.
  • Owns domain vocabulary: the module declares data shapes in addition to executable helpers, so its types are part of the contract.
  • Has tuning constants: part of the module behavior is controlled by named constants that document default precision, limits, or policy.
  • Minimal top-level dependencies: the module reads as mostly self-contained from its opening declarations.
  • Explicit export surface: the file ends with visible export declarations instead of relying only on implicit namespace discovery.

Implementation profile

This profile is inferred directly from the source text. It does not replace reading the file, but it tells you quickly whether the module is mostly declarative, loop-heavy, branch-heavy, or organized around many small exits.

SignalCountWhat it suggests
if1Branching density and local decision-making.
while0Loop-heavy or iterative implementation style.
for0Collection-style traversal at source level.
match0Variant-driven branching or grammar-style decoding.
let0Local state and intermediate value density.
give46Number of explicit exit points and result shaping.

Top-level API inventory

SurfaceItems
Proceduresgetuid, geteuid, setuid, seteuid, getgid, getegid, setgid, setegid, getgroups, setgroups, getpid, getppid
FormsPasswdEntry, GroupEntry, RlimitEntry
Picksnone declared at top level
ConstantsRLIMIT_CPU, RLIMIT_FSIZE, RLIMIT_DATA, RLIMIT_STACK, RLIMIT_CORE, RLIMIT_RSS, RLIMIT_NPROC, RLIMIT_NOFILE, RLIMIT_MEMLOCK, RLIMIT_AS, RLIM_INFINITY
Exports*

Imported surfaces

This file does not advertise a top-level `use` surface in its opening declarations. That often means it is either self-contained or an aggregation layer.

Position in family

This file is module 12 of 12 in the kernel family when ordered by path. By procedure count it ranks 1, and by line count it ranks 2. Those ranks are useful as rough signals of breadth, not as quality judgments.

Declaration map

The declaration map turns raw source into a scan-friendly catalog. It is useful when the file is large enough that a reader wants to orient by kinds of surfaces first.

LineNameKindRole
1vitte/kernel_name/usersspaceDeclares the namespace that anchors this file in the stdlib tree.
9RLIMIT_CPUconstDefines a named constant reused across the module.
10RLIMIT_FSIZEconstDefines a named constant reused across the module.
11RLIMIT_DATAconstDefines a named constant reused across the module.
12RLIMIT_STACKconstDefines a named constant reused across the module.
13RLIMIT_COREconstDefines a named constant reused across the module.
14RLIMIT_RSSconstDefines a named constant reused across the module.
15RLIMIT_NPROCconstDefines a named constant reused across the module.
16RLIMIT_NOFILEconstDefines a named constant reused across the module.
17RLIMIT_MEMLOCKconstDefines a named constant reused across the module.
18RLIMIT_ASconstDefines a named constant reused across the module.
20RLIM_INFINITYconstDefines a named constant reused across the module.
23PasswdEntryformIntroduces a structured data shape that other procedures can exchange.
32GroupEntryformIntroduces a structured data shape that other procedures can exchange.
39RlimitEntryformIntroduces a structured data shape that other procedures can exchange.
48getuidprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
53geteuidprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
58setuidprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
63seteuidprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
68getgidprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
73getegidprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
78setgidprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
83setegidprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
88getgroupsprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
93setgroupsprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
102getpidprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
107getppidprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
112getpgidprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
117setpgidprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
122getpgrpprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
127setsidprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
132getsidprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
141getpwuidprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
153getpwnamprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
165getgrgidprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
174getgrnamprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
187getrlimitprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
195setrlimitprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
200getrlimit_cpuprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
205setrlimit_cpuprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
210getrlimit_fsizeprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
215setrlimit_fsizeprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
220getrlimit_nofileprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
225setrlimit_nofileprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
234getenvprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
239setenvprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
244unsetenvprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
249environprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
254clearenvprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
263getpriorityprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
268setpriorityprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
273getrusageprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
282get_loginprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
287get_usernameprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
292get_home_dirprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
297get_shellprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
302is_rootprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
311accessprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
316faccessatprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
321eaccessprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
326initgroupsprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.

The table is exhaustive for top-level declarations of the selected kinds. This file declares 61 matching surfaces.

Representative signatures

These signatures are shown in source order so the page keeps the feel of a reference manual, not just a keyword cloud.

  • const RLIMIT_CPU: i32 = 0 (line 9)
  • const RLIMIT_FSIZE: i32 = 1 (line 10)
  • const RLIMIT_DATA: i32 = 2 (line 11)
  • const RLIMIT_STACK: i32 = 3 (line 12)
  • const RLIMIT_CORE: i32 = 4 (line 13)
  • const RLIMIT_RSS: i32 = 5 (line 14)
  • const RLIMIT_NPROC: i32 = 6 (line 15)
  • const RLIMIT_NOFILE: i32 = 7 (line 16)
  • const RLIMIT_MEMLOCK: i32 = 8 (line 17)
  • const RLIMIT_AS: i32 = 9 (line 18)
  • const RLIM_INFINITY: i64 = 9223372036854775807 (line 20)
  • form PasswdEntry { (line 23)
  • form GroupEntry { (line 32)
  • form RlimitEntry { (line 39)
  • proc getuid() -> i32 { (line 48)
  • proc geteuid() -> i32 { (line 53)
  • proc setuid(uid: i32) -> int { (line 58)
  • proc seteuid(uid: i32) -> int { (line 63)

The list is intentionally capped here; the source file declares 60 matching signatures in total.

How to use this module

Start by reading the file as an ownership boundary. Ask three questions: what enters this module, what stable types or procedures it exports, and what adjacent module should stay outside of it.

  1. Read space and top-level imports first so the ownership boundary of kernel/users.vitl is explicit.
  2. Scan constants before procedures; they often encode precision, limits, or policy assumptions that explain later behavior.
  3. Read declared forms and picks before algorithms so the data vocabulary is stable in your head.
  4. Traverse procedures in source order; the early helpers usually explain the naming and numeric conventions used later.
  5. Use the source landmarks section below as a table of contents when the file is large.

User example

This example is generated from the actual stdlib module surface. Its job is not to be the smallest snippet possible; its job is to show a realistic consumer-shaped file that exercises the module and mirrors the language keywords the module itself relies on.

space demo/kernel_users
const SAMPLE_LABEL: string = "demo"
form UserReport {
  label: string,
  ready: bool
}
proc run_example() -> UserReport {
  let stable: bool = ready and true
  if ready {
    give UserReport { label: "not-ready", ready: false }
  }
    give UserReport { label: "ok", ready: ready }
  let copies: f64 = 1 as f64
}
export run_example

Keyword coverage

This table makes the “all keywords of the module” requirement auditable. It compares the detected Vitte keywords in the source file with the generated consumer example above.

KeywordPresent in module sourceUsed in generated user example
spaceyesyes
constyesyes
formyesyes
procyesyes
ifyesyes
giveyesyes
exportyesyes
andyesyes
asyesyes

The generated snippet exercises every detected Vitte keyword used by this module.

Source shape

space vitte/kernel_name/users
// Resource limit constants
const RLIMIT_CPU: i32 = 0
const RLIMIT_FSIZE: i32 = 1
const RLIMIT_DATA: i32 = 2
const RLIMIT_STACK: i32 = 3
const RLIMIT_CORE: i32 = 4
const RLIMIT_RSS: i32 = 5
const RLIMIT_NPROC: i32 = 6
const RLIMIT_NOFILE: i32 = 7

The excerpt is not meant to replace the file. It exists to make the module recognizable at first glance, the same way a Wikipedia infobox helps the reader orient before reading the whole article.

Source landmarks

Large files are easier to retain when they have visible landmarks. When the source contains explicit section banners, they are surfaced here; otherwise the first major declarations are used as anchors.

  • User and Group Management — User/group operations, / Environment variables, resource_id limits, permissions
  • User ID Operations
  • Process ID Operations
  • Password and Group Database
  • Resource Limits
  • Environment Variables
  • Process Priority and Scheduling
  • User Information Functions
  • Access Control

Source organization

When a file carries its own internal chaptering, those chapters usually reveal the intended reading order better than a flat symbol list. This section reconstructs that organization from the source itself.

Opening declarations

Top-level items: 1. Procedures: 0. Data surfaces: 0. Constants: 0.

First visible names: vitte/kernel_name/users

User and Group Management — User/group operations, / Environment variables, resource_id limits, permissions

Top-level items: 14. Procedures: 0. Data surfaces: 3. Constants: 11.

First visible names: RLIMIT_CPU, RLIMIT_FSIZE, RLIMIT_DATA, RLIMIT_STACK, RLIMIT_CORE, RLIMIT_RSS, RLIMIT_NPROC, RLIMIT_NOFILE, RLIMIT_MEMLOCK, RLIMIT_AS

User ID Operations

Top-level items: 10. Procedures: 10. Data surfaces: 0. Constants: 0.

First visible names: getuid, geteuid, setuid, seteuid, getgid, getegid, setgid, setegid, getgroups, setgroups

Process ID Operations

Top-level items: 7. Procedures: 7. Data surfaces: 0. Constants: 0.

First visible names: getpid, getppid, getpgid, setpgid, getpgrp, setsid, getsid

Password and Group Database

Top-level items: 4. Procedures: 4. Data surfaces: 0. Constants: 0.

First visible names: getpwuid, getpwnam, getgrgid, getgrnam

Resource Limits

Top-level items: 8. Procedures: 8. Data surfaces: 0. Constants: 0.

First visible names: getrlimit, setrlimit, getrlimit_cpu, setrlimit_cpu, getrlimit_fsize, setrlimit_fsize, getrlimit_nofile, setrlimit_nofile

Environment Variables

Top-level items: 5. Procedures: 5. Data surfaces: 0. Constants: 0.

First visible names: getenv, setenv, unsetenv, environ, clearenv

Process Priority and Scheduling

Top-level items: 3. Procedures: 3. Data surfaces: 0. Constants: 0.

First visible names: getpriority, setpriority, getrusage

User Information Functions

Top-level items: 5. Procedures: 5. Data surfaces: 0. Constants: 0.

First visible names: get_login, get_username, get_home_dir, get_shell, is_root

Access Control

Top-level items: 5. Procedures: 4. Data surfaces: 0. Constants: 0.

First visible names: access, faccessat, eaccess, initgroups, *

Complete API catalog

This catalog is the exhaustive file-level index for the module. It is intentionally closer to a generated encyclopedia appendix than to a tutorial summary.

Constants

LineNameSignatureRole
9RLIMIT_CPUconst RLIMIT_CPU: i32 = 0Defines a named constant reused across the module.
10RLIMIT_FSIZEconst RLIMIT_FSIZE: i32 = 1Defines a named constant reused across the module.
11RLIMIT_DATAconst RLIMIT_DATA: i32 = 2Defines a named constant reused across the module.
12RLIMIT_STACKconst RLIMIT_STACK: i32 = 3Defines a named constant reused across the module.
13RLIMIT_COREconst RLIMIT_CORE: i32 = 4Defines a named constant reused across the module.
14RLIMIT_RSSconst RLIMIT_RSS: i32 = 5Defines a named constant reused across the module.
15RLIMIT_NPROCconst RLIMIT_NPROC: i32 = 6Defines a named constant reused across the module.
16RLIMIT_NOFILEconst RLIMIT_NOFILE: i32 = 7Defines a named constant reused across the module.
17RLIMIT_MEMLOCKconst RLIMIT_MEMLOCK: i32 = 8Defines a named constant reused across the module.
18RLIMIT_ASconst RLIMIT_AS: i32 = 9Defines a named constant reused across the module.
20RLIM_INFINITYconst RLIM_INFINITY: i64 = 9223372036854775807Defines a named constant reused across the module.

Data surfaces

LineNameSignatureRole
23PasswdEntryform PasswdEntry {Introduces a structured data shape that other procedures can exchange.
32GroupEntryform GroupEntry {Introduces a structured data shape that other procedures can exchange.
39RlimitEntryform RlimitEntry {Introduces a structured data shape that other procedures can exchange.

Procedures

LineNameSignatureRole
48getuidproc getuid() -> i32 {Represents one top-level surface in the file contract and should be read as part of the module boundary.
53geteuidproc geteuid() -> i32 {Represents one top-level surface in the file contract and should be read as part of the module boundary.
58setuidproc setuid(uid: i32) -> int {Represents one top-level surface in the file contract and should be read as part of the module boundary.
63seteuidproc seteuid(uid: i32) -> int {Represents one top-level surface in the file contract and should be read as part of the module boundary.
68getgidproc getgid() -> i32 {Represents one top-level surface in the file contract and should be read as part of the module boundary.
73getegidproc getegid() -> i32 {Represents one top-level surface in the file contract and should be read as part of the module boundary.
78setgidproc setgid(gid: i32) -> int {Represents one top-level surface in the file contract and should be read as part of the module boundary.
83setegidproc setegid(gid: i32) -> int {Represents one top-level surface in the file contract and should be read as part of the module boundary.
88getgroupsproc getgroups() -> [i32] {Represents one top-level surface in the file contract and should be read as part of the module boundary.
93setgroupsproc setgroups(groups: [i32]) -> int {Represents one top-level surface in the file contract and should be read as part of the module boundary.
102getpidproc getpid() -> i32 {Represents one top-level surface in the file contract and should be read as part of the module boundary.
107getppidproc getppid() -> i32 {Represents one top-level surface in the file contract and should be read as part of the module boundary.
112getpgidproc getpgid(pid: i32) -> i32 {Represents one top-level surface in the file contract and should be read as part of the module boundary.
117setpgidproc setpgid(pid: i32, pgid: i32) -> int {Represents one top-level surface in the file contract and should be read as part of the module boundary.
122getpgrpproc getpgrp() -> i32 {Represents one top-level surface in the file contract and should be read as part of the module boundary.
127setsidproc setsid() -> i32 {Represents one top-level surface in the file contract and should be read as part of the module boundary.
132getsidproc getsid(pid: i32) -> i32 {Represents one top-level surface in the file contract and should be read as part of the module boundary.
141getpwuidproc getpwuid(uid: i32) -> PasswdEntry {Represents one top-level surface in the file contract and should be read as part of the module boundary.
153getpwnamproc getpwnam(name: string) -> PasswdEntry {Represents one top-level surface in the file contract and should be read as part of the module boundary.
165getgrgidproc getgrgid(gid: i32) -> GroupEntry {Represents one top-level surface in the file contract and should be read as part of the module boundary.
174getgrnamproc getgrnam(name: string) -> GroupEntry {Represents one top-level surface in the file contract and should be read as part of the module boundary.
187getrlimitproc getrlimit(resource_id: i32) -> RlimitEntry {Represents one top-level surface in the file contract and should be read as part of the module boundary.
195setrlimitproc setrlimit(resource_id: i32, rlim: RlimitEntry) -> int {Represents one top-level surface in the file contract and should be read as part of the module boundary.
200getrlimit_cpuproc getrlimit_cpu() -> RlimitEntry {Represents one top-level surface in the file contract and should be read as part of the module boundary.
205setrlimit_cpuproc setrlimit_cpu(limit: RlimitEntry) -> int {Represents one top-level surface in the file contract and should be read as part of the module boundary.
210getrlimit_fsizeproc getrlimit_fsize() -> RlimitEntry {Represents one top-level surface in the file contract and should be read as part of the module boundary.
215setrlimit_fsizeproc setrlimit_fsize(limit: RlimitEntry) -> int {Represents one top-level surface in the file contract and should be read as part of the module boundary.
220getrlimit_nofileproc getrlimit_nofile() -> RlimitEntry {Represents one top-level surface in the file contract and should be read as part of the module boundary.
225setrlimit_nofileproc setrlimit_nofile(limit: RlimitEntry) -> int {Represents one top-level surface in the file contract and should be read as part of the module boundary.
234getenvproc getenv(name: string) -> string {Represents one top-level surface in the file contract and should be read as part of the module boundary.
239setenvproc setenv(name: string, value: string, overwrite: int) -> int {Represents one top-level surface in the file contract and should be read as part of the module boundary.
244unsetenvproc unsetenv(name: string) -> int {Represents one top-level surface in the file contract and should be read as part of the module boundary.
249environproc environ() -> [string] {Represents one top-level surface in the file contract and should be read as part of the module boundary.
254clearenvproc clearenv() -> int {Represents one top-level surface in the file contract and should be read as part of the module boundary.
263getpriorityproc getpriority(which: i32, who: i32) -> i32 {Represents one top-level surface in the file contract and should be read as part of the module boundary.
268setpriorityproc setpriority(which: i32, who: i32, prio: i32) -> int {Represents one top-level surface in the file contract and should be read as part of the module boundary.
273getrusageproc getrusage(who: i32) -> [i64] {Represents one top-level surface in the file contract and should be read as part of the module boundary.
282get_loginproc get_login() -> string {Represents one top-level surface in the file contract and should be read as part of the module boundary.
287get_usernameproc get_username() -> string {Represents one top-level surface in the file contract and should be read as part of the module boundary.
292get_home_dirproc get_home_dir() -> string {Represents one top-level surface in the file contract and should be read as part of the module boundary.
297get_shellproc get_shell() -> string {Represents one top-level surface in the file contract and should be read as part of the module boundary.
302is_rootproc is_root() -> int {Represents one top-level surface in the file contract and should be read as part of the module boundary.
311accessproc access(pathname: string, mode: i32) -> int {Represents one top-level surface in the file contract and should be read as part of the module boundary.
316faccessatproc faccessat(dirfd: i32, pathname: string, mode: i32, flag_bits: i32) -> int {Represents one top-level surface in the file contract and should be read as part of the module boundary.
321eaccessproc eaccess(pathname: string, mode: i32) -> int {Represents one top-level surface in the file contract and should be read as part of the module boundary.
326initgroupsproc initgroups(user_name: string, group: i32) -> int {Represents one top-level surface in the file contract and should be read as part of the module boundary.

Exports

LineNameSignatureRole
330*export *Re-exports surfaces that the module wants to expose as part of its public boundary.

Integration boundaries

Within kernel, this file should remain focused. If a future helper changes the host boundary, scheduling boundary, or data-shape boundary, it probably belongs in a neighbor module instead of being added here by convenience.

  • Family responsibility: System-facing runtime helpers such as process, scheduler, threads, sync, users, signals, network, device, and memory.
  • Family architecture role: Use `kernel` when the program explicitly models system services, scheduling, process behavior, or device-facing coordination.

Composition guidance

Choose this module when

  • Choose kernel/users.vitl when the main question is owned by this module rather than by transport, storage, orchestration, or user-interface code.
  • A service manager may use scheduler, process, and signals while keeping policy in separate code.
  • A network-facing runtime should explain why it depends on kernel surfaces instead of lighter families.

Pause before extending it when

  • Avoid extending this file when the new helper mostly changes the boundary to host I/O, runtime coordination, or foreign integration instead of staying inside kernel.
  • Check nearby modules such as kernel/device.vitl, kernel/fileio.vitl, kernel/interrupt.vitl before adding convenience wrappers here.

Relationship table

This table keeps the page closer to a real encyclopedia entry: a module is easier to understand when compared with its nearest alternatives in the same family.

NeighborProceduresData surfacesWhy compare it
kernel/device.vitl00Shares the same family boundary but carries a distinct slice of responsibility.
kernel/fileio.vitl442Shares the same family boundary but carries a distinct slice of responsibility.
kernel/interrupt.vitl90Shares the same family boundary but carries a distinct slice of responsibility.
kernel/memory.vitl181Shares the same family boundary but carries a distinct slice of responsibility.
kernel/network.vitl424Shares the same family boundary but carries a distinct slice of responsibility.
kernel/process.vitl142Shares the same family boundary but carries a distinct slice of responsibility.
kernel/scheduler.vitl10Shares the same family boundary but carries a distinct slice of responsibility.
kernel/signals.vitl181Shares the same family boundary but carries a distinct slice of responsibility.

Neighbor modules