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 — search for 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.
In the past, when an application used name_open()
to connect to a service, the server wasn't notified.
Now, an _IO_CONNECT message with a subtype of
_IO_CONNECT_OPEN is sent to the server.
The server application must be able handle this message.
For an example, see the documentation for
name_attach().
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:
| Safety: | |
|---|---|
| Cancellation point | Yes |
| Interrupt handler | No |
| Signal handler | Yes |
| Thread | Yes |