ssyyssii8866() -- System Call (libc)

Identify parts within Intel-based machines
#iinncclluuddee <ssyyss/ssyyssii8866.hh>
iinntt ssyyssii8866(_h_a_r_d_w_a_r_e, _t_y_p_e)
iinntt _h_a_r_d_w_a_r_e, *_t_y_p_e;

The  system call  ssyyssii8866() identifies  parts within  Intel-based computers.
_h_a_r_d_w_a_r_e  names the  machine part  that  you wish  to identify;  you should
always use one of the constants defined in header file <ssyyss/ssyyssii8866.hh>. _t_y_p_e
point to the iinntt into which ssyyssii8866() writes an identifying code.

ssyyssii8866() returns  -1 if it was  unable to read your  machine.  It returns a
value other than -1 if it succeeds in reading your machine.

_E_x_a_m_p_l_e
The following  program identifies the  type of floating-point  processor in
your machine.

#include <sys/sysi86.h>

#ifndef FP_NO
/*
 * The following header may be needed to get the FP_... constants on some
 * other implementations of the iBCS2 specification; while the sysi86()
 * system call and the SI86FPHW constant are part of the iBCS2 specification,
 * the FP_... constants and the <sys/fp.h> header are not.
 */
#include <sys/fp.h>
#endif

const char *
floating_point_provider ()
{
    int fp_type;

    if (sysi86 (SI86FPHW, & fp_type) == -1)
        return "unable to retrieve FP type";

    switch (fp_type) {

    case FP_NO:
        return "no FP hardware or emulation available";

    case FP_SW:
        return "software emulation of FP hardware";

    case FP_287:
        return "80287 hardware FP";

    case FP_387:
        return "80387 or 80486DX hardware FP";

    default:
        return "unknown floating-point provider";
    }
}

main()
{
    printf("%s\n", floating_point_provider());
}

_S_e_e _A_l_s_o
lliibbcc, ssyyssii8866.hh

_N_o_t_e_s
At present under COHERENT, this  system call can interrogate a machine only
for the type of its floating-point processor.

