.TH sysi86() "" "" "System Call (libc)"
.PC "Identify parts within Intel-based machines"
.B "#include <sys/sysi86.h>
\fBint sysi86(\fIhardware\^\fB, \fItype\^\fB)\fR
\fBint \fIhardware\^\fB, *\fItype\^\fB;\fR
.PP
The system call
.B sysi86()
identifies parts within Intel-based computers.
.I hardware
names the machine part that you wish to identify; you should always use one
of the constants defined in header file
.BR <sys/sysi86.h> .
.I type
point to the
.B int
into which
.B sysi86()
writes an identifying code.
.PP
.B sysi86()
returns \-1 if it was unable to read your machine.
It returns a value other than \-1 if it succeeds in reading your machine.
.SH Example
The following program identifies the type of floating-point processor in your
machine.
.DM
#include <sys/sysi86.h>
.DE
.DM
#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
.DE
.DM
const char *
floating_point_provider ()
{
	int fp_type;
.DE
.DM
	if (sysi86 (SI86FPHW, & fp_type) == -1)
		return "unable to retrieve FP type";
.DE
.DM
	switch (fp_type) {
.sp \n(pDu
	case FP_NO:
		return "no FP hardware or emulation available";
.DE
.DM
	case FP_SW:
		return "software emulation of FP hardware";
.DE
.DM
	case FP_287:
		return "80287 hardware FP";
.DE
.DM
	case FP_387:
		return "80387 or 80486DX hardware FP";
.DE
.DM
	default:
		return "unknown floating-point provider";
	}
}
.DE
.DM
main()
{
	printf("%s\en", floating_point_provider());
}
.DE
.SH "See Also"
.Xr "libc," libc
.Xr "sysi86.h" sysi86.h
.SH Notes
At present under \*(CO, this system call can interrogate a machine only
for the type of its floating-point processor.

