![]() |
![]() |
![]() |
GIO Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy | Implemented Interfaces | Properties |
GUnixSocketAddress; GSocketAddress * g_unix_socket_address_new (const gchar *path
); GSocketAddress * g_unix_socket_address_new_abstract (const gchar *path
,int path_len
); gboolean g_unix_socket_address_get_is_abstract (GUnixSocketAddress *address
); const char * g_unix_socket_address_get_path (GUnixSocketAddress *address
); gsize g_unix_socket_address_get_path_len (GUnixSocketAddress *address
); gboolean g_unix_socket_address_abstract_names_supported (void
);
"abstract" gboolean : Read / Write / Construct Only "path" gchar* : Read / Write / Construct Only "path-as-array" GByteArray* : Read / Write / Construct Only
typedef struct _GUnixSocketAddress GUnixSocketAddress;
A UNIX-domain (local) socket address, corresponding to a struct sockaddr_un.
GSocketAddress * g_unix_socket_address_new (const gchar *path
);
Creates a new GUnixSocketAddress for path
.
To create abstract socket addresses, on systems that support that,
use g_unix_socket_address_new_abstract()
.
|
the socket path |
Returns : |
a new GUnixSocketAddress |
Since 2.22
GSocketAddress * g_unix_socket_address_new_abstract (const gchar *path
,int path_len
);
Creates a new abstract GUnixSocketAddress for path
.
Unix domain sockets are generally visible in the filesystem. However, some systems support abstract socket name which are not visible in the filesystem and not affected by the filesystem permissions, visibility, etc.
Note that not all systems (really only Linux) support abstract
socket names, so if you use them on other systems function calls may
return G_IO_ERROR_NOT_SUPPORTED
errors. You can use
g_unix_socket_address_abstract_names_supported()
to see if abstract
names are supported.
If path_len
is -1 then path
is assumed to be a zero terminated
string (although in general abstract names need not be zero terminated
and can have embedded nuls). All bytes after path_len
up to the max size
of an abstract unix domain name is filled with zero bytes.
|
the abstract name |
|
the length of path , or -1
|
Returns : |
a new GUnixSocketAddress |
Since 2.22
gboolean g_unix_socket_address_get_is_abstract
(GUnixSocketAddress *address
);
Gets address
's path.
|
a GInetSocketAddress |
Returns : |
TRUE if the address is abstract, FALSE otherwise
|
Since 2.22
const char * g_unix_socket_address_get_path (GUnixSocketAddress *address
);
Gets address
's path, or for abstract sockets the "name".
Guaranteed to be zero-terminated, but an abstract socket
may contain embedded zeros, and thus you should use
g_unix_socket_address_get_path_len()
to get the true length
of this string.
|
a GInetSocketAddress |
Returns : |
the path for address
|
Since 2.22
gsize g_unix_socket_address_get_path_len (GUnixSocketAddress *address
);
Gets the length of address
's path.
For details, see g_unix_socket_address_get_path()
.
|
a GInetSocketAddress |
Returns : |
the length of the path |
Since 2.22
"abstract"
property"abstract" gboolean : Read / Write / Construct Only
Whether or not this is an abstract address.
Default value: FALSE
"path"
property"path" gchar* : Read / Write / Construct Only
UNIX socket path.
Default value: NULL
"path-as-array"
property"path-as-array" GByteArray* : Read / Write / Construct Only
UNIX socket path, as byte array.