Read - HP 68000 Series User Manual

Debugger/simulator
Table of Contents

Advertisement

Chapter 11: Predefined Macros

read

read
Function
Read from a system file
Synopsis
int read(fildes, buf, nbyte)
int
char
unsigned nbyte;
Description
The read macro reads from a system file. This macro is an interface to the
UNIX system call read(2). Refer to the HP-UX Reference Manual for detailed
information.
Diagnostics
If the system call to read(2) is successful, the number of bytes read is returned.
Otherwise, -1 is returned and a system generated error message is written to
the journal window of the debugger.
Example
The following command file segment defines two global debugger symbols and
includes the definition of a user-defined macro that uses read().
Symbol Add int infile
Symbol Add int outfile
Debugger Macro Add int foo(infile, outfile)
int
int
{
}
468
fildes;
*buf;
infile;
/* file descriptor to read from */
outfile;
/* file descriptor to write to
char
buf[80];
while (!read(infile, buf, 80))
write(outfile, buf, 80);
*/

Advertisement

Table of Contents
loading

This manual is also suitable for:

B1466

Table of Contents