Middleware, development tools, realtime operating system
software and services for superior embedded design


Home
QNX Community Resources
Developer Support
QNX Documentation Library
QNX Developer Support

QNX Developer Support

QNX Software Systems
Developer Resources
Blogs
Board support packages
Foundry27 projects
Forums
Hardware support listing
Online video tutorials
Product documentation
Technical Articles

[Previous] [Contents] [Index] [Next]

name_open()

Open a name for a server connection

Synopsis:

#include <sys/iofunc.h>
#include <sys/dispatch.h>

int name_open( const char * name, 
               int flags );

Arguments:

name
The name that you want to open for a server connection.
flags
Flags that affect the function's behavior:
  • NAME_FLAG_ATTACH_GLOBAL -- attach the name globally instead of locally.

Library:

libc

Use the -l c option to qcc to link against this library. This library is usually included automatically.

Description:

The name_open() function opens name for a server connection. No ordering is guaranteed when accessing resources on other nodes.


Note: Before, when an application used to call name_open() to connect to a service, the server was not aware of that. This has been changed now -- a _IO_CONNECT/_IO_CONNECT_OPEN message is actually sent to the server.

The server application has to be modified to handle a possible _IO_CONNECT message coming in. See the example code in name_attach() to see how to handle this message.


Returns:

A nonnegative integer representing a side-channel connection ID (see ConnectAttach()) or -1 if an error occurred (errno is set).

Errors:

EACCES
Search permission is denied on a component of the name.
EBADFSYS
While attempting to open the named file, either the file itself or a component of the path prefix was found to be corrupted. A system failure -- from which no automatic recovery is possible -- occurred while the file was being written to, or while the directory was being updated. You'll need to invoke appropriate systems-administration procedures to correct this situation before proceeding.
EBUSY
The connection specified by name has already been opened and additional connections aren't permitted.
EINTR
The name_open() operation was interrupted by a signal.
EISDIR
The named path is a directory.
ELOOP
Too many levels of symbolic links or prefixes.
EMFILE
Too many file descriptors are currently in use by this process.
ENAMETOOLONG
The length of the name string exceeds PATH_MAX, or a pathname component is longer than NAME_MAX.
ENFILE
Too many files are currently open in the system.
ENOENT
The connection specified by name doesn't exist.
ENOTDIR
A component of the name prefix isn't a directory.

Examples:

See name_attach().

Classification:

QNX Neutrino

Safety:
Cancellation point Yes
Interrupt handler No
Signal handler Yes
Thread Yes

See also:

ConnectAttach(), name_attach(), name_detach(), name_close(), open()


[Previous] [Contents] [Index] [Next]