Opens the generic data link control (GDLC) device manager by special file name.
The open subroutine allows the application user to open a GDLC device manager by specifying the DLC special file name and the target device handler special file name. Since the GDLC device manager is multiplexed, more than one process can open it (or the same process many times) and still have unique channel identifications.
Each open carries the communications device handler's special file name so that the DLC knows on which port to transfer data. This name must directly follow the DLC's special file name. For example, in the /dev/dlcether/ent0 character string, ent0 is the special file name of the Ethernet device handler. GDLC obtains this name using its dlcmpx routine.
Each GDLC supports the open subroutine interface by way of its dlcopen and dlcmpx entry points. This subroutine may be called from the process environment only.
Item | Description |
---|---|
path | Consists of a character string containing the /dev special
file name of the GDLC device manager, with the name of the communications
device handler appended as follows:
|
oflag | Specifies a value for the file status flag. The GDLC device
manager ignores all but the following flags:
|
mode | Specifies the O_CREAT mode parameter. This is ignored by GDLC. |
ext | Specifies the extended subroutine parameter. This is a pointer to the dlc_open_ext extended I/O structure for the open subroutines. |
Upon successful completion, the open subroutine returns a valid file descriptor that identifies the opened GDLC channel.
If an error occurs, a value of -1 is returned with one of the following error values available using the errno global variable, as defined in the /usr/include/sys/errno.h file:
Value | Description |
---|---|
ECHILD | Indicates that the device manager cannot create a kernel process. |
EINVAL | Indicates an invalid value. |
ENODEV | Indicates that no such device handler is present. |
ENOMEM | Indicates insufficient resources to satisfy the open subroutine. |
EFAULT | Indicates that a kernel service, such as the copyin or initp kernel service, has failed. |