Previous PageTable Of Contents../index.htmlIndexNext Page

dx_fileerrno( )

Description | Example

Name:
int dx_fileerrno(void)
Inputs:
none

Returns:

system error value

Includes:

dxxxlib.h, srllib.h

Mode:

Synchronous

Top Of PageDescription

The dx_fileerrno( ) function returns the system error value from the operating system. Functions may indicate a system error in one of two ways:

  1. Indirectly: A system error is indicated by receiving the system error code, such as EDX_SYSTEM, typically by calling the SRL function ATDV_LASTERR( ).
  2. Directly: Failure of the function itself indicates a system error, such as with the dx_open( ) and dx_close( ) functions, and the dx_fileclose( ), dx_fileopen( ), dx_fileread( ), dx_fileseek( ), and dx_filewrite( ) functions (i.e., no system error code like EDX_SYSTEM is returned, usually because a valid device handle doesn't exist).

In both these cases, call dx_fileerrno( ) to obtain the correct system error value, which provides the reason for the error. For example, if the dx_fileopen( ) function fails, the correct system error value can only be obtained by calling dx_fileerrno( ). Unpredictable results could occur if, instead, you used the global variable errno to obtain the system error value. See the Microsoft Visual C++ Run-Time Library Reference for more information on system error values.

This function returns one of the following error values reported by the operating system:


Table 8. List of System Error Values

Value

Description

E2BIG

Argument list too long.

EACCES

Permission denied; indicates a locking or sharing violation. The file's permission setting or sharing mode does not allow the specified access. This error signifies that an attempt was made to access a file (or, in some cases, a directory) in a way that is incompatible with the file's attributes. For example, the error can occur when an attempt is made to read from a file that is not open, to open an existing read-only file for writing, or to open a directory instead of a file. The error can also occur in an attempt to rename a file or directory or to remove an existing directory.

EAGAIN

No more processes. An attempt to create a new process failed because there are no more process slots, or there is not enough memory, or the maximum nesting level has been reached.

EBADF

Bad file number; invalid file descriptor (file is not opened for writing). Possible causes: 1) The specified file handle is not a valid file-handle value or does not refer to an open file. 2) An attempt was made to write to a file or device opened for read-only access or a locked file.

EDOM

Math argument.

EEXIST

Files exist. An attempt has been made to create a file that already exists. For example, the _O_CREAT and _O_EXCL flags are specified in an _open call, but the named file already exists.

EINTR

A signal was caught.

EINVAL

Invalid argument. An invalid value was given for one of the arguments to a function. For example, the value given for the origin or the position specified by offset when positioning a file pointer (by means of a call to fseek) is before the beginning of the file. Other possibilities are as follows: The dev/evt/handler triplet was not registered or has already been registered. Invalid timeout value. Invalid flags or pmode argument.

EIO

Error during a Windows open.

EMFILE

Too many open files. No more file handles are available, so no more files can be opened.

ENOENT

No such file or directory; invalid device name; file or path not found. The specified file or directory does not exist or cannot be found. This message can occur whenever a specified file does not exist or a component of a path does not specify an existing directory.

ENOMEM

Not enough memory. Not enough memory is available for the attempted operation. The library has run out of space when allocating memory for internal data structures.

ENOSPC

Not enough space left on the device for the operation. No more space for writing is available on the device (for example, when the disk is full).

ERANGE

Result too large. An argument to a math function is too large, resulting in partial or total loss of significance in the result. This error can also occur in other functions when an argument is larger than expected.

ESR_TMOUT

Timed out waiting for event.

EXDEV

Cross-device link. An attempt was made to move a file to a different device (using the rename function).

 

Top Of PageExample


Previous PageTable Of ContentsTop Of PageIndexNext Page

Click here to contact Dialogic Customer Engineering

Copyright 2002, Dialogic Corporation
All rights reserved
This page generated February, 2002