Open - HP 68000 Series User Manual

Debugger/simulator
Table of Contents

Advertisement

open

Function
Open a UNIX file for reading and/or writing
Synopsis
int open(path,oflag)
char
*path;
int
oflag;
Description
The open() macro opens a UNIX file, returning an UNIX file descriptor. path
is the name of the file to be opened. oflag is the mode in which the file will be
opened. The possible modes may be found in the header file
/usr/include/fcntl.h. Some useful modes are:
read only
0
write only
1
read/write
2
no delay
4
append
8
create
256 (HP-UX) or 512 (SunOS)
truncate
512 (HP-UX) or 1024 (SunOS)
These modes may be combined be adding the appropriate values together.
This macro is an interface to the UNIX system call open(2). Refer to the
HP-UX Reference Manual for detailed information.
Diagnostics
If the system call to open(2) is successful, the system file descriptor is
returned. Otherwise, -1 is returned and a system generated error message is
written to the journal window of the debugger.
Chapter 11: Predefined Macros
open
465

Advertisement

Table of Contents
loading

This manual is also suitable for:

B1466

Table of Contents