The subsequent elements are found in the system sysctl.h file and are: The top level names are:ĬTL_MACHDEP sys/sysctl.h Machine dependent The first element indicates the level of the information and the subsequent elements indicate the value to read. The size of the MIB array depends on the data to be read or written. Newp - a pointer to the buffer containing the new value to be set. Note: if the new attribute value is not being set, the next two variables should be set to Nil and 0. Oldp - a pointer to the buffer into which the value is copied. ![]() Note: if the old attribute value is not required, the next two variables can be set to Nil and 0. Namelen - the length of the array of integers in name. Each element of this array must contain the correct value to read or write the particular system attribute. Name - a pointer to a Management Information Base (MIB) array of integers. ![]() Typing 'sysctl-a | more' in a Terminal will list all the sysctls.įunction FPsysctl ( Name : pcint namelen : cuint oldp : pointer oldlenp : psize_t newp : pointer newlen : size_t ) : cint cdecl external name 'sysctl' For details of the sysctls available, start a Terminal and type 'man sysctl'. The '/usr/local/share/fpcsrc/rtl/darwin/sysctlh.inc' source file is a partial translation of the macOS '/usr/include/sys/sysctl.h' file. This provides a wealth of information detailing system hardware and configuration attributes which can be useful when debugging or simply optimising your application (eg to take advantage of threads on multi-core CPU systems). Sysctl provides an interface that allows you to read and, with appropriate privileges, set many kernel attributes in macOS (and Linux and the BSDs). These are described below with code examples.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |