diff options
Diffstat (limited to 'usr/src/man/man3proc/Psymbol_iter.3proc')
-rw-r--r-- | usr/src/man/man3proc/Psymbol_iter.3proc | 92 |
1 files changed, 56 insertions, 36 deletions
diff --git a/usr/src/man/man3proc/Psymbol_iter.3proc b/usr/src/man/man3proc/Psymbol_iter.3proc index 37b14ce822..2378a19b9b 100644 --- a/usr/src/man/man3proc/Psymbol_iter.3proc +++ b/usr/src/man/man3proc/Psymbol_iter.3proc @@ -93,7 +93,8 @@ In the case of the .Fn Pxsymbol_iter function an additional .Sy prsyminfo_t -argument will be provided to the callback. The definitions of +argument will be provided to the callback. +The definitions of .Sy proc_sym_f , .Sy proc_xsym_f , and @@ -104,14 +105,16 @@ are found in The .Fa object_name argument names the object that is a part of the controlled process which -will be searched for symbols. Only one object may be searched at any -given time. Valid object names may be obtained through the +will be searched for symbols. +Only one object may be searched at any given time. +Valid object names may be obtained through the .Xr Pobjname 3PROC and .Xr Pobject_iter 3PROC -functions, among others. The system also has two special object names -that may be passed in to refer to the objects of the executable file and -for ld.so.1. The symbol +functions, among others. +The system also has two special object names that may be passed in to refer to +the objects of the executable file and for ld.so.1. +The symbol .Dv PR_OBJ_EXEC refers to the executables object and the symbol .Dv PR_OBJ_LDSO @@ -122,33 +125,38 @@ The argument controls which of two possible symbol tables will be searched. If the argument is .Dv PR_SYMTAB -then the ELF symbol table will be searched. Otherwise, if it is +then the ELF symbol table will be searched. +Otherwise, if it is .Dv PR_DYNSYM then the symbol table associated with the dynamic section will be -searched instead. If any other value is specified for +searched instead. +If any other value is specified for .Fa which , then an error will be returned. .Pp The .Fa mask -argument controls which symbols will be included. The +argument controls which symbols will be included. +The .Fa mask argument allows for control over both the symbol's binding and the -symbol's type. These flags logically correspond to the various ELF -symbol bindings and types. The following values may be passed as a -bitwise-inclusive-OR into the +symbol's type. +These flags logically correspond to the various ELF symbol bindings and types. +The following values may be passed as a bitwise-inclusive-OR into the .Fa flags argument: .Bl -tag -width Dv -offset indent .It Dv BIND_LOCAL -The symbol is a local symbol. Local symbols are not visible outside of -their object file. +The symbol is a local symbol. +Local symbols are not visible outside of their object file. .It Dv BIND_GLOBAL -The symbol is a global symbol. Global symbols are visible outside of -their object file and may be referred to by other ELF objects. +The symbol is a global symbol. +Global symbols are visible outside of their object file and may be referred to +by other ELF objects. .It Dv BIND_WEAK -The symbol is a weak symbol. Weak symbols are visible outside of their -object file, but another definition of the symbol may be used instead. +The symbol is a weak symbol. +Weak symbols are visible outside of their object file, but another definition of +the symbol may be used instead. .It Dv BIND_ANY This is a combination of .Dv BIND_LOCAL , @@ -159,7 +167,8 @@ Every symbol's binding will match this value. .It Dv TYPE_NOTYPE The symbol's type is not specified. .It Dv TYPE_OBJECT -The symbol refers to a data object. For example, variables. +The symbol refers to a data object. +For example, variables. .It Dv TYPE_FUNC The symbol refers to a function. .It Dv TYPE_SECTION @@ -191,28 +200,35 @@ and .Fn Pxsymbol_iter functions allow for a link-map identifier to be specified in the .Fa lmid -argument. This will restrict the search for the object specified in +argument. +This will restrict the search for the object specified in .Fa object_name -to the specified link-map. There are three special link-map identifiers -that may be passed in. The symbol +to the specified link-map. +There are three special link-map identifiers that may be passed in. +The symbol .Dv PR_LMID_EVERY -indicates that every link-map should be searched. The symbol +indicates that every link-map should be searched. +The symbol .Dv LM_ID_BASE indicates that the base link-map, the one that is used for the -executable should be searched. Finally, the symbol +executable should be searched. +Finally, the symbol .Dv LM_ID_LDSO -refers to the link-map that is used by the run-time link editor, -ld.so.1. The functions which do not allow a link-map identifier to be -specified always search every link-map. +refers to the link-map that is used by the run-time link editor, ld.so.1. +The functions which do not allow a link-map identifier to be specified always +search every link-map. .Pp By default, symbols are iterated based on the order of the symbol -table being searched. However, it is also possible to iterate based on -the name of the symbol and based on the address of the symbol. To -iterate by name use the +table being searched. +However, it is also possible to iterate based on the name of the symbol and +based on the address of the symbol. +To iterate by name use the .Fn Psymbol_iter_by_name -function. To iterate by address use the +function. +To iterate by address use the .Fn Psymbol_iter_by_addr -function. The +function. +The .Fn Psymbol_iter , .Fn Psymbol_iter_by_lmid , and @@ -221,11 +237,13 @@ functions all sort based on the order of the symbol table. .Pp The return value of the callback function .Fa func -determines whether or not iteration continues. If +determines whether or not iteration continues. +If .Fa func returns .Sy 0, -then iteration will continue. However, if +then iteration will continue. +However, if .Fa func returns non-zero, then iteration will halt and that value will be used as the return value of the @@ -235,7 +253,8 @@ as the return value of the .Fn Psymbol_iter_by_name , and .Fn Pxsymbol_iter -functions. Because these functions return +functions. +Because these functions return .Sy -1 on internal failure, it is recommended that the callback function not return .Sy -1 @@ -253,7 +272,8 @@ functions return .Sy 0 . If there was an internal error then .Sy -1 -is returned. Otherwise, if the callback function +is returned. +Otherwise, if the callback function .Fa func returns non-zero, then its return value will be returned instead. .Sh INTERFACE STABILITY |