• Keine Ergebnisse gefunden

get_FPU_control

Im Dokument C LANGUAGE 4400 SERIES (Seite 189-200)

Return the contents of the MC68881 control and status registers

SYNOPSIS

#include <float_interrupt.h>

void get_FPU_control(buffer) struct FPU control *buffer;

Arguments

<buffer> The address of the structure to contain the contents of the MC68881 registers

Returns

None

DESCRIPTION

The get FPU control function returns the contents of the MC68881 control and status registers (FPCR and FPSR, respectively). The user may inspect and modify the contents of these registers.

This function expects <buffer> to be the address of a structure that is defined as:

0-8

struct FPU_control {

} ;

struct control_register fpcr;

struct status_register fpsr;

/* control register */

/* status register */

The organization of the individual registers is defined by these structures:

struct status _register {

unsigned : 3; /* unused */

NOTES

The include-file <float_interrupt.h> contains the definitions of the above structures.

SEE ALSO

C Library: put_FPU _control()

System Call: FPUJesume(), get_FPU_exception(},put...!'PU_exception(}

G-lO

Access MC68881 coprocessor exception-information

SYNOPSIS

#include <errno.h>

#include <float_interrupt.h>

int get_FPU_exception(buffer)

struct FPU_interrupt_data *buffer;

Arguments

<buffer> The address of a buffer which will receive the MC68881 coprocessor exception-information

Returns

Zero if successful, otherwise -1 with <errno> set to the system error code

DESCRIPTION

The get_FPU_exception function accesses the exception information provided by the MC68881 coprocessor when it detects an error for which it is generating interrupts. This function is intended for use in an interrupt-handling routine when attempting to recover from errors detected by the MC68881 coprocessor.

The get FPU exception function retums zero if it successfully accesses the exception information, otherwise, it retums -1 with <errno> set to the system error code.

The get _ FPU _exception function expects < buffer> to be the address of a structure defined as:

struct FPU_interrupt_data {

} ;

struct state frame FPU frame; - - /*

struct control_register fpcr; /*

struct status_register fpsr; /*

short *fpiar; /*

fpreg fp[8]; /*

long CPU_data_register[8]; /*

long CPU_address_register[8]; /*

struct exception_frame CPU_frame;

FPU state frame */

control register */

status register */

instruction address register ~

floating-point data registers CPU "D" registers */

CPU "A" registers */

/* CPU exception frame */

The individual components of this structure are defined as:

G-12

struct exception_frame {

} ;

unsigned short operation;

short *address;

struct status _register {

struct exception_frame { unsigned short sr;

short *CPU_pc;

short frame _type;

short *pc;

unsigned short ir;

unsigned short operation;

short *address;

The contents of these structures reflect the contents of the CPU and coprocessor registers at the time that the exception interrupt was generated. For interpretation of the information contained in these structures, consult the appropriate hardware manuals.

ERRORS REPORTED

EBDCL The CPU cannot support the MC68881 coprocessor

?

NOTES

Exception infonnation is available only after the MC68881 interrupts the CPU. The user must have previously enabled these interrupts by setting the appropriate bits in the MC68881 control register.

The user must call the routine FPU resunteO to resume execution of the interrupted MC68881 instruction and exit the interrupt-handling routine. Attempting to exit the interrupt-handling routine by using the return statement may lead to unpredictable results because the program counter stored on the stack may not be correct.

The include-file </loat_interrupt.h> contains the above structure definitions.

SEE ALSO

C Library: get FPU control(), put FPU controZ() - -

-System Calls: FPU Jesume(), put_FPU _exception{}

G-14

geteuld

geteuid

Get the effective user-ID number of the current task.

SYNOPSIS

int geteuid ()

Arguments

None

Returns

The effective user-ID number of the current task

DESCRIPTION

The geteuid function gets the effective user-ID number of the current task and returns that value as its result.

ERRORS REPORTED

None

SEE ALSO

System Call: getuid(), setuid()

getpass

getpass

Get a password using a prompt.

SYNOPSIS

char *getpass(prompt)

char *prompt;

Arguments

<prompt> The address of the character-string containing the prompt

Returns

The address of a character-string containing the password read, or (char *) NULL if there was an error

DESCRIPTION

The getpass function writes the characters in the character-string referenced by <prompt> to the standard I/O output stream <stderr>. Getpass clears the echo attribute on the terminal associated with the standard I/O input stream <stdin>, then reads cpara.cters from <stdin> up to the first end-of-line character (EOL) or to the end of the file; saving the first eight characters in a static buffer, discarding the remaining characters if any and the end-of-line character, if any.

Getpass restores the echo attribute on the terminal to its original state, terminates the characters saved with a null-character, completing the character-string, then returns the address of that character-string as its result.

If getpass encounters an error, it restores the terminal to its original state and returns (char *) NULL as its result.

G-16

get pass

NOTES

The getpass function uses standard I/O and may enlarge a program more than expected.

Nothing is written to < stderr> if <prompt> is (char *) NULL.

The getpass function catches keyboard, quit, alarm, and hang-up signals. If it catches a signal, it resets the terminal to its original configuration then resignals the signal so the calling program can handle that signal.

If getpass returns indicating an error, <ermo> contains the system error code.

The character-string referenced by the result of getpass is in static memory and is overwritten by subsequent get pass calls.

The standard I/O output stream < stderr> must be attached to a terminal unless <prompt> is (char *) NULL. Otherwise, getpass returns (char *) NULL with <ermo> set to ENOTTY.

The standard I/O input stream < stdin> must be attached to a terminal or getpass returns (char

* )

NULL with <ermo> set to ENOTTY.

SEE ALSO

C Library:!puts(), gets(), stderr, stdin

getpid

getpid

Get task-ID number of the current task.

SYNOPSIS

int getpid ()

Arguments

None

Returns

The task-ID number of the current task

DESCRIPTION

The getpid function gets the task-ID number of the current task and returns that value as its result.

ERRORS REPORTED

None

SEE ALSO

System Call: exec(), fork() Command: status

G-18

getppl'd

getppid

Get the task-ID number of the parent of the current task.

SYNOPSIS

int getppid ()

Arguments

None

Returns

The task-ID number of the parent of the current task

DESCRIPTION

This function gets the task-ID number of the parent of the current task and returns that value as its result.

ERRORS REPORTED

SEE ALSO

System Call: exec{},fork{}, getpid{}

Command: status

Im Dokument C LANGUAGE 4400 SERIES (Seite 189-200)