name_open()

Объявить имя для соединения с сервером

Прототип:

#include <sys/iofunc.h>
#include <sys/dispatch.h>
int name_open( const char *name,
int flags );

Аргументы:

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.

Библиотека:

libc

Описание:

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


Note: 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().

Возвращаемое значение:

Неотрицательное целое, представляющее идентификатор стороннего соединения (см. ConnectAttach()). Если возникла ошибка функция возвращает -1, код ошибки записывается в errno.

Коды ошибок:

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.

Примеры:

См. name_attach().

Классификация:

ЗОСРВ «Нейтрино»

Точка остановки потока
Да
Обработчик прерываний
Нет
Обработчик сигналов
Да
В потоке
Да

Тематические ссылки:

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




Предыдущий раздел: Описание API системной библиотеки