OPENPROM(4)
okay bestie, welcome to openprom(4) β the OPENPROM interface manual page β and yes, we're gonna get into all the ioctl lore. π
β¨
β¨ NAME β¨
openprom β OPENPROM interface. short, iconic, to the point. π
πΈ SYNOPSIS πΈ
#include <machine/openpromio.h>
π DESCRIPTION π
The file /dev/openprom is an interface to the OPENPROM. This interface is highly stylized β ioctls are used for all operations. These ioctls refer to βnodesβ, which are simply βmagicβ integer values describing data areas. Occasionally the number 0 may be used or returned instead, as described below. πβ¨
The calls that take and/or return a node use a pointer to an int variable for this purpose; others use a pointer to a struct opiocdesc descriptor, which contains a node and two counted strings. π«Ά
The first string is comprised of the fields op_namelen (an int) and op_name (a char *), giving the name of a field. The second string is comprised of the fields op_buflen and op_buf, used analogously. These two counted strings work in a βvalue-resultβ fashion. At entry to the ioctl, the counts are expected to reflect the buffer size; on return, the counts are updated to reflect the buffer contents. the way that buffer-size-in / contents-out pipeline works is lowkey iconic. π
The following ioctls are supported:
OPIOCGETOPTNODEβ takes nothing, and fills in the options node number. literally no args, just options-node business. π«ΆOPIOCGETNEXTβ takes a node number and returns the number of the following node. The node following the last node is number0; the node following number0is the first node. the wraparound is real, bestie. πOPIOCGETCHILDβ takes a node number and returns the number of the first βchildβ of that node. This child may have siblings; these can be discovered by usingOPIOCGETNEXT. family tree energy, fr fr. π³OPIOCGETβ fills in the value of the named property for the given node. If no such property is associated with that node, the value length is set to-1. If the named property exists but has no value, the value length is set to0. no property vs empty property are different β don't mix them up. πOPIOCSETβ writes the given value under the given name. The OPENPROM may refuse this operation; in this caseEINVALis returned. consent matters, even for OPENPROM. πOPIOCNEXTPROPβ finds the property whose name follows the given name in OPENPROM internal order. The resulting name is returned in the value field. If the named property is the last, the βnextβ name is the empty string. As withOPIOCGETNEXT, the next name after the empty string is the first name. it's giving linked list but make it OPENPROM. π
π FILES π
/dev/openpromβ the main character device file. π
π ERRORS π
The following may result in rejection of an operation:
EINVALβ the given node number is not zero and does not correspond to any valid node, or is zero where zero is not allowed.EBADFβ the requested operation requires permissions not specified at the call toopen().ENAMETOOLONGβ the given name or value field exceeds the maximum allowed length (8191bytes).ENOMEMβ memory could not be allocated.ENOTTYβ the ioctl is not supported on this architecture.
π₯ SEE ALSO π₯
ioctl(2), eeprom(8) β go read those too, bestie. π«Ά
π°οΈ HISTORY π°οΈ
The openprom interface first appeared in OpenBSD 3.0 for sparc64. It has been available on macppc since OpenBSD 4.3, on octeon since OpenBSD 6.0, on armv7 since OpenBSD 6.0, and on arm64 since OpenBSD 6.1. the timeline is giving slow but steady glow-up. π
π BUGS π
Due to limitations within the OPENPROM itself, these functions run at elevated priority and may adversely affect system performance. π not the performance plot twist, but okay.
mwah π β source/version: Debian; date: September 11, 2022; manual: OPENPROM(4). periodt. π
π¦ where this page comes from
- nixpkgs unstable: cvs-export
- Copyright (c) 1992, 1993 The Regents of the University of California. All rights reserved
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms