Путеводитель по Руководству Linux

  User  |  Syst  |  Libr  |  Device  |  Files  |  Other  |  Admin  |  Head  |



   pmgetopt_r    ( 3 )

обработка командной строки для инструментов PMAPI (command line handling for PMAPI tools)

Возвращаемое значение (Return value)

The pmGetOptions function returns either when it detects a command-line option that is not one of the standard PCP set, or when the end of the command line options has been reached (at which point -1 is returned). Both the pmgetopt_r and pmGetOptions routines return control to the caller in the same way that a regular getopt call would, with the return value indicating either the end of all processing (-1), or the single character form of the option currently being processed, or zero for the special long-option-only case. For all option-processing cases, the opts structure is returned containing filled out optarg, opterr, optopt, optind, and index fields as normal (do NOT use the global optarg or optind from your platform C library, these will NOT be modified).

pmGetOptions does not return to the caller when any of the standard PCP options are being processed (although the override mechanism can be used to still detect such options if needed).

The pmGetContextOptions function returns zero on success, or a negative PCP error code on failure. The error field within the opts parameter will also be non-zero in the latter case.