<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>GUnixSocketAddress</title>
-<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
+<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
<link rel="home" href="index.html" title="GIO Reference Manual">
-<link rel="up" href="networking.html" title="Lowlevel platform-independent network support">
+<link rel="up" href="networking.html" title="Low-level network support">
<link rel="prev" href="GInetSocketAddress.html" title="GInetSocketAddress">
<link rel="next" href="GSocketControlMessage.html" title="GSocketControlMessage">
-<meta name="generator" content="GTK-Doc V1.13 (XML mode)">
+<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
-<link rel="part" href="pt01.html" title="Part I. GIO Overview">
-<link rel="chapter" href="ch01.html" title="Introduction">
-<link rel="chapter" href="ch02.html" title="Compiling GIO applications">
-<link rel="chapter" href="ch03.html" title="Running GIO applications">
-<link rel="chapter" href="extending-gio.html" title="Extending GIO">
-<link rel="part" href="pt02.html" title="Part II. API Reference">
-<link rel="chapter" href="file_ops.html" title="File Operations">
-<link rel="chapter" href="file_mon.html" title="File System Monitoring">
-<link rel="chapter" href="async.html" title="Asynchronous I/O">
-<link rel="chapter" href="conversion.html" title="Data conversion">
-<link rel="chapter" href="streaming.html" title="Streaming I/O">
-<link rel="chapter" href="types.html" title="File types and applications">
-<link rel="chapter" href="volume_mon.html" title="Volumes and Drives">
-<link rel="chapter" href="icons.html" title="Icons">
-<link rel="chapter" href="failable_initialization.html" title="Failable Initialization">
-<link rel="chapter" href="networking.html" title="Lowlevel platform-independent network support">
-<link rel="chapter" href="resolver.html" title="DNS resolution">
-<link rel="chapter" href="highlevel-socket.html" title="Highlevel network functionallity">
-<link rel="chapter" href="utils.html" title="Utilities">
-<link rel="chapter" href="extending.html" title="Extending GIO">
-<link rel="part" href="migrating.html" title="Part III. Migrating to GIO">
-<link rel="chapter" href="ch19.html" title="Migrating from POSIX to GIO">
-<link rel="chapter" href="ch20.html" title="Migrating from GnomeVFS to GIO">
-<link rel="chapter" href="gio-hierarchy.html" title="Object Hierarchy">
-<link rel="index" href="api-index-full.html" title="Index">
-<link rel="index" href="api-index-deprecated.html" title="Index of deprecated symbols">
-<link rel="index" href="api-index-2-18.html" title="Index of new symbols in 2.18">
-<link rel="index" href="api-index-2-20.html" title="Index of new symbols in 2.20">
-<link rel="index" href="api-index-2-22.html" title="Index of new symbols in 2.22">
-<link rel="index" href="api-index-2-24.html" title="Index of new symbols in 2.24">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
<a href="#GUnixSocketAddress.properties" class="shortcut">Properties</a>
</td></tr>
</table>
-<div class="refentry" title="GUnixSocketAddress">
+<div class="refentry">
<a name="GUnixSocketAddress"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
</td>
<td valign="top" align="right"></td>
</tr></table></div>
-<div class="refsynopsisdiv" title="Synopsis">
+<div class="refsynopsisdiv">
<a name="GUnixSocketAddress.synopsis"></a><h2>Synopsis</h2>
-<pre class="synopsis"> <a class="link" href="GUnixSocketAddress.html#GUnixSocketAddress-struct" title="GUnixSocketAddress">GUnixSocketAddress</a>;
-<a class="link" href="GSocketAddress.html" title="GSocketAddress"><span class="returnvalue">GSocketAddress</span></a> * <a class="link" href="GUnixSocketAddress.html#g-unix-socket-address-new" title="g_unix_socket_address_new ()">g_unix_socket_address_new</a> (const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> *path);
-<a class="link" href="GSocketAddress.html" title="GSocketAddress"><span class="returnvalue">GSocketAddress</span></a> * <a class="link" href="GUnixSocketAddress.html#g-unix-socket-address-new-abstract" title="g_unix_socket_address_new_abstract ()">g_unix_socket_address_new_abstract</a> (const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> *path,
- <span class="returnvalue">int</span> path_len);
-<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> <a class="link" href="GUnixSocketAddress.html#g-unix-socket-address-get-is-abstract" title="g_unix_socket_address_get_is_abstract ()">g_unix_socket_address_get_is_abstract</a>
- (<a class="link" href="GUnixSocketAddress.html" title="GUnixSocketAddress"><span class="returnvalue">GUnixSocketAddress</span></a> *address);
-const <span class="returnvalue">char</span> * <a class="link" href="GUnixSocketAddress.html#g-unix-socket-address-get-path" title="g_unix_socket_address_get_path ()">g_unix_socket_address_get_path</a> (<a class="link" href="GUnixSocketAddress.html" title="GUnixSocketAddress"><span class="returnvalue">GUnixSocketAddress</span></a> *address);
-<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gsize"><span class="returnvalue">gsize</span></a> <a class="link" href="GUnixSocketAddress.html#g-unix-socket-address-get-path-len" title="g_unix_socket_address_get_path_len ()">g_unix_socket_address_get_path_len</a> (<a class="link" href="GUnixSocketAddress.html" title="GUnixSocketAddress"><span class="returnvalue">GUnixSocketAddress</span></a> *address);
-<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> <a class="link" href="GUnixSocketAddress.html#g-unix-socket-address-abstract-names-supported" title="g_unix_socket_address_abstract_names_supported ()">g_unix_socket_address_abstract_names_supported</a>
- (void);
+<pre class="synopsis">
+#include <gio/gunixsocketaddress.h>
+
+struct <a class="link" href="GUnixSocketAddress.html#GUnixSocketAddress-struct" title="struct GUnixSocketAddress">GUnixSocketAddress</a>;
+enum <a class="link" href="GUnixSocketAddress.html#GUnixSocketAddressType" title="enum GUnixSocketAddressType">GUnixSocketAddressType</a>;
+<a class="link" href="GSocketAddress.html" title="GSocketAddress"><span class="returnvalue">GSocketAddress</span></a> * <a class="link" href="GUnixSocketAddress.html#g-unix-socket-address-new" title="g_unix_socket_address_new ()">g_unix_socket_address_new</a> (<em class="parameter"><code>const <a href="./../glib/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *path</code></em>);
+<a class="link" href="GSocketAddress.html" title="GSocketAddress"><span class="returnvalue">GSocketAddress</span></a> * <a class="link" href="GUnixSocketAddress.html#g-unix-socket-address-new-abstract" title="g_unix_socket_address_new_abstract ()">g_unix_socket_address_new_abstract</a> (<em class="parameter"><code>const <a href="./../glib/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *path</code></em>,
+ <em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> path_len</code></em>);
+<a class="link" href="GSocketAddress.html" title="GSocketAddress"><span class="returnvalue">GSocketAddress</span></a> * <a class="link" href="GUnixSocketAddress.html#g-unix-socket-address-new-with-type" title="g_unix_socket_address_new_with_type ()">g_unix_socket_address_new_with_type</a> (<em class="parameter"><code>const <a href="./../glib/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *path</code></em>,
+ <em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> path_len</code></em>,
+ <em class="parameter"><code><a class="link" href="GUnixSocketAddress.html#GUnixSocketAddressType" title="enum GUnixSocketAddressType"><span class="type">GUnixSocketAddressType</span></a> type</code></em>);
+<a href="./../glib/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> <a class="link" href="GUnixSocketAddress.html#g-unix-socket-address-get-is-abstract" title="g_unix_socket_address_get_is_abstract ()">g_unix_socket_address_get_is_abstract</a>
+ (<em class="parameter"><code><a class="link" href="GUnixSocketAddress.html" title="GUnixSocketAddress"><span class="type">GUnixSocketAddress</span></a> *address</code></em>);
+<a class="link" href="GUnixSocketAddress.html#GUnixSocketAddressType" title="enum GUnixSocketAddressType"><span class="returnvalue">GUnixSocketAddressType</span></a> <a class="link" href="GUnixSocketAddress.html#g-unix-socket-address-get-address-type" title="g_unix_socket_address_get_address_type ()">g_unix_socket_address_get_address_type</a>
+ (<em class="parameter"><code><a class="link" href="GUnixSocketAddress.html" title="GUnixSocketAddress"><span class="type">GUnixSocketAddress</span></a> *address</code></em>);
+const <span class="returnvalue">char</span> * <a class="link" href="GUnixSocketAddress.html#g-unix-socket-address-get-path" title="g_unix_socket_address_get_path ()">g_unix_socket_address_get_path</a> (<em class="parameter"><code><a class="link" href="GUnixSocketAddress.html" title="GUnixSocketAddress"><span class="type">GUnixSocketAddress</span></a> *address</code></em>);
+<a href="./../glib/glib/glib-Basic-Types.html#gsize"><span class="returnvalue">gsize</span></a> <a class="link" href="GUnixSocketAddress.html#g-unix-socket-address-get-path-len" title="g_unix_socket_address_get_path_len ()">g_unix_socket_address_get_path_len</a> (<em class="parameter"><code><a class="link" href="GUnixSocketAddress.html" title="GUnixSocketAddress"><span class="type">GUnixSocketAddress</span></a> *address</code></em>);
+<a href="./../glib/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> <a class="link" href="GUnixSocketAddress.html#g-unix-socket-address-abstract-names-supported" title="g_unix_socket_address_abstract_names_supported ()">g_unix_socket_address_abstract_names_supported</a>
+ (<em class="parameter"><code><span class="type">void</span></code></em>);
</pre>
</div>
-<div class="refsect1" title="Object Hierarchy">
+<div class="refsect1">
<a name="GUnixSocketAddress.object-hierarchy"></a><h2>Object Hierarchy</h2>
<pre class="synopsis">
- <a href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#GObject">GObject</a>
+ <a href="./../gobject/gobject/gobject-The-Base-Object-Type.html#GObject">GObject</a>
+----<a class="link" href="GSocketAddress.html" title="GSocketAddress">GSocketAddress</a>
+----GUnixSocketAddress
</pre>
</div>
-<div class="refsect1" title="Implemented Interfaces">
+<div class="refsect1">
<a name="GUnixSocketAddress.implemented-interfaces"></a><h2>Implemented Interfaces</h2>
<p>
GUnixSocketAddress implements
<a class="link" href="GSocketConnectable.html" title="GSocketConnectable">GSocketConnectable</a>.</p>
</div>
-<div class="refsect1" title="Properties">
+<div class="refsect1">
<a name="GUnixSocketAddress.properties"></a><h2>Properties</h2>
<pre class="synopsis">
- "<a class="link" href="GUnixSocketAddress.html#GUnixSocketAddress--abstract" title='The "abstract" property'>abstract</a>" <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> : Read / Write / Construct Only
- "<a class="link" href="GUnixSocketAddress.html#GUnixSocketAddress--path" title='The "path" property'>path</a>" <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a>* : Read / Write / Construct Only
- "<a class="link" href="GUnixSocketAddress.html#GUnixSocketAddress--path-as-array" title='The "path-as-array" property'>path-as-array</a>" <a href="http://library.gnome.org/devel/glib/unstable/glib-Byte-Arrays.html#GByteArray"><span class="type">GByteArray</span></a>* : Read / Write / Construct Only
+ "<a class="link" href="GUnixSocketAddress.html#GUnixSocketAddress--abstract" title='The "abstract" property'>abstract</a>" <a href="./../glib/glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> : Read / Write / Construct Only
+ "<a class="link" href="GUnixSocketAddress.html#GUnixSocketAddress--address-type" title='The "address-type" property'>address-type</a>" <a class="link" href="GUnixSocketAddress.html#GUnixSocketAddressType" title="enum GUnixSocketAddressType"><span class="type">GUnixSocketAddressType</span></a> : Read / Write / Construct Only
+ "<a class="link" href="GUnixSocketAddress.html#GUnixSocketAddress--path" title='The "path" property'>path</a>" <a href="./../glib/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a>* : Read / Write / Construct Only
+ "<a class="link" href="GUnixSocketAddress.html#GUnixSocketAddress--path-as-array" title='The "path-as-array" property'>path-as-array</a>" <a href="./../glib/glib/glib-Byte-Arrays.html#GByteArray"><span class="type">GByteArray</span></a>* : Read / Write / Construct Only
</pre>
</div>
-<div class="refsect1" title="Description">
+<div class="refsect1">
<a name="GUnixSocketAddress.description"></a><h2>Description</h2>
<p>
-Support for UNIX-domain (aka local) sockets.</p>
+Support for UNIX-domain (also known as local) sockets.
+</p>
+<p>
+UNIX domain sockets are generally visible in the filesystem.
+However, some systems support abstract socket names which are not
+visible in the filesystem and not affected by the filesystem
+permissions, visibility, etc. Currently this is only supported
+under Linux. If you attempt to use abstract sockets on other
+systems, function calls may return <a class="link" href="gio-GIOError.html#G-IO-ERROR-NOT-SUPPORTED:CAPS"><code class="literal">G_IO_ERROR_NOT_SUPPORTED</code></a>
+errors. You can use <a class="link" href="GUnixSocketAddress.html#g-unix-socket-address-abstract-names-supported" title="g_unix_socket_address_abstract_names_supported ()"><code class="function">g_unix_socket_address_abstract_names_supported()</code></a>
+to see if abstract names are supported.
+</p>
+<p>
+Note that <code class="filename"><gio/gunixsocketaddress.h></code> belongs to
+the UNIX-specific GIO interfaces, thus you have to use the
+<code class="filename">gio-unix-2.0.pc</code> pkg-config file when using it.
+</p>
</div>
-<div class="refsect1" title="Details">
+<div class="refsect1">
<a name="GUnixSocketAddress.details"></a><h2>Details</h2>
-<div class="refsect2" title="GUnixSocketAddress">
-<a name="GUnixSocketAddress-struct"></a><h3>GUnixSocketAddress</h3>
-<pre class="programlisting">typedef struct _GUnixSocketAddress GUnixSocketAddress;</pre>
+<div class="refsect2">
+<a name="GUnixSocketAddress-struct"></a><h3>struct GUnixSocketAddress</h3>
+<pre class="programlisting">struct GUnixSocketAddress;</pre>
<p>
A UNIX-domain (local) socket address, corresponding to a
-<span class="type">struct sockaddr_un</span>.</p>
+<span class="type">struct sockaddr_un</span>.
+</p>
+</div>
+<hr>
+<div class="refsect2">
+<a name="GUnixSocketAddressType"></a><h3>enum GUnixSocketAddressType</h3>
+<pre class="programlisting">typedef enum {
+ G_UNIX_SOCKET_ADDRESS_INVALID,
+ G_UNIX_SOCKET_ADDRESS_ANONYMOUS,
+ G_UNIX_SOCKET_ADDRESS_PATH,
+ G_UNIX_SOCKET_ADDRESS_ABSTRACT,
+ G_UNIX_SOCKET_ADDRESS_ABSTRACT_PADDED
+} GUnixSocketAddressType;
+</pre>
+<p>
+The type of name used by a <a class="link" href="GUnixSocketAddress.html" title="GUnixSocketAddress"><span class="type">GUnixSocketAddress</span></a>.
+<a class="link" href="GUnixSocketAddress.html#G-UNIX-SOCKET-ADDRESS-PATH:CAPS"><code class="literal">G_UNIX_SOCKET_ADDRESS_PATH</code></a> indicates a traditional unix domain
+socket bound to a filesystem path. <a class="link" href="GUnixSocketAddress.html#G-UNIX-SOCKET-ADDRESS-ANONYMOUS:CAPS"><code class="literal">G_UNIX_SOCKET_ADDRESS_ANONYMOUS</code></a>
+indicates a socket not bound to any name (eg, a client-side socket,
+or a socket created with <code class="function">socketpair()</code>).
+</p>
+<p>
+For abstract sockets, there are two incompatible ways of naming
+them; the man pages suggest using the entire <code class="literal">struct
+sockaddr_un</code> as the name, padding the unused parts of the
+<code class="literal">sun_path</code> field with zeroes; this corresponds to
+<a class="link" href="GUnixSocketAddress.html#G-UNIX-SOCKET-ADDRESS-ABSTRACT-PADDED:CAPS"><code class="literal">G_UNIX_SOCKET_ADDRESS_ABSTRACT_PADDED</code></a>. However, many programs
+instead just use a portion of <code class="literal">sun_path</code>, and pass an appropriate
+smaller length to <code class="function">bind()</code> or <code class="function">connect()</code>. This is
+<a class="link" href="GUnixSocketAddress.html#G-UNIX-SOCKET-ADDRESS-ABSTRACT:CAPS"><code class="literal">G_UNIX_SOCKET_ADDRESS_ABSTRACT</code></a>.
+</p>
+<div class="variablelist"><table border="0">
+<col align="left" valign="top">
+<tbody>
+<tr>
+<td><p><a name="G-UNIX-SOCKET-ADDRESS-INVALID:CAPS"></a><span class="term"><code class="literal">G_UNIX_SOCKET_ADDRESS_INVALID</code></span></p></td>
+<td>invalid
+</td>
+</tr>
+<tr>
+<td><p><a name="G-UNIX-SOCKET-ADDRESS-ANONYMOUS:CAPS"></a><span class="term"><code class="literal">G_UNIX_SOCKET_ADDRESS_ANONYMOUS</code></span></p></td>
+<td>anonymous
+</td>
+</tr>
+<tr>
+<td><p><a name="G-UNIX-SOCKET-ADDRESS-PATH:CAPS"></a><span class="term"><code class="literal">G_UNIX_SOCKET_ADDRESS_PATH</code></span></p></td>
+<td>a filesystem path
+</td>
+</tr>
+<tr>
+<td><p><a name="G-UNIX-SOCKET-ADDRESS-ABSTRACT:CAPS"></a><span class="term"><code class="literal">G_UNIX_SOCKET_ADDRESS_ABSTRACT</code></span></p></td>
+<td>an abstract name
+</td>
+</tr>
+<tr>
+<td><p><a name="G-UNIX-SOCKET-ADDRESS-ABSTRACT-PADDED:CAPS"></a><span class="term"><code class="literal">G_UNIX_SOCKET_ADDRESS_ABSTRACT_PADDED</code></span></p></td>
+<td>an abstract name, 0-padded
+ to the full length of a unix socket name
+</td>
+</tr>
+</tbody>
+</table></div>
+<p class="since">Since 2.26</p>
</div>
<hr>
-<div class="refsect2" title="g_unix_socket_address_new ()">
+<div class="refsect2">
<a name="g-unix-socket-address-new"></a><h3>g_unix_socket_address_new ()</h3>
-<pre class="programlisting"><a class="link" href="GSocketAddress.html" title="GSocketAddress"><span class="returnvalue">GSocketAddress</span></a> * g_unix_socket_address_new (const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> *path);</pre>
+<pre class="programlisting"><a class="link" href="GSocketAddress.html" title="GSocketAddress"><span class="returnvalue">GSocketAddress</span></a> * g_unix_socket_address_new (<em class="parameter"><code>const <a href="./../glib/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *path</code></em>);</pre>
<p>
Creates a new <a class="link" href="GUnixSocketAddress.html" title="GUnixSocketAddress"><span class="type">GUnixSocketAddress</span></a> for <em class="parameter"><code>path</code></em>.
</p>
<p>
To create abstract socket addresses, on systems that support that,
-use <a class="link" href="GUnixSocketAddress.html#g-unix-socket-address-new-abstract" title="g_unix_socket_address_new_abstract ()"><code class="function">g_unix_socket_address_new_abstract()</code></a>.</p>
+use <a class="link" href="GUnixSocketAddress.html#g-unix-socket-address-new-abstract" title="g_unix_socket_address_new_abstract ()"><code class="function">g_unix_socket_address_new_abstract()</code></a>.
+</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>path</code></em> :</span></p></td>
-<td> the socket path
-</td>
+<td>the socket path</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td> a new <a class="link" href="GUnixSocketAddress.html" title="GUnixSocketAddress"><span class="type">GUnixSocketAddress</span></a>
-
+<td>a new <a class="link" href="GUnixSocketAddress.html" title="GUnixSocketAddress"><span class="type">GUnixSocketAddress</span></a>
</td>
</tr>
</tbody>
<p class="since">Since 2.22</p>
</div>
<hr>
-<div class="refsect2" title="g_unix_socket_address_new_abstract ()">
+<div class="refsect2">
<a name="g-unix-socket-address-new-abstract"></a><h3>g_unix_socket_address_new_abstract ()</h3>
-<pre class="programlisting"><a class="link" href="GSocketAddress.html" title="GSocketAddress"><span class="returnvalue">GSocketAddress</span></a> * g_unix_socket_address_new_abstract (const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> *path,
- <span class="returnvalue">int</span> path_len);</pre>
+<pre class="programlisting"><a class="link" href="GSocketAddress.html" title="GSocketAddress"><span class="returnvalue">GSocketAddress</span></a> * g_unix_socket_address_new_abstract (<em class="parameter"><code>const <a href="./../glib/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *path</code></em>,
+ <em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> path_len</code></em>);</pre>
+<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
+<h3 class="title">Warning</h3>
+<p><code class="literal">g_unix_socket_address_new_abstract</code> is deprecated and should not be used in newly-written code. Use <a class="link" href="GUnixSocketAddress.html#g-unix-socket-address-new-with-type" title="g_unix_socket_address_new_with_type ()"><code class="function">g_unix_socket_address_new_with_type()</code></a>.</p>
+</div>
+<p>
+Creates a new <a class="link" href="GUnixSocketAddress.html#G-UNIX-SOCKET-ADDRESS-ABSTRACT-PADDED:CAPS"><code class="literal">G_UNIX_SOCKET_ADDRESS_ABSTRACT_PADDED</code></a>
+<a class="link" href="GUnixSocketAddress.html" title="GUnixSocketAddress"><span class="type">GUnixSocketAddress</span></a> for <em class="parameter"><code>path</code></em>.
+</p>
+<div class="variablelist"><table border="0">
+<col align="left" valign="top">
+<tbody>
+<tr>
+<td><p><span class="term"><em class="parameter"><code>path</code></em> :</span></p></td>
+<td>the abstract name. <span class="annotation">[<acronym title="Parameter points to an array of items."><span class="acronym">array</span></acronym> length=path_len][<acronym title="Generics and defining elements of containers and arrays."><span class="acronym">element-type</span></acronym> gchar]</span>
+</td>
+</tr>
+<tr>
+<td><p><span class="term"><em class="parameter"><code>path_len</code></em> :</span></p></td>
+<td>the length of <em class="parameter"><code>path</code></em>, or -1</td>
+</tr>
+<tr>
+<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
+<td>a new <a class="link" href="GUnixSocketAddress.html" title="GUnixSocketAddress"><span class="type">GUnixSocketAddress</span></a>
+</td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<hr>
+<div class="refsect2">
+<a name="g-unix-socket-address-new-with-type"></a><h3>g_unix_socket_address_new_with_type ()</h3>
+<pre class="programlisting"><a class="link" href="GSocketAddress.html" title="GSocketAddress"><span class="returnvalue">GSocketAddress</span></a> * g_unix_socket_address_new_with_type (<em class="parameter"><code>const <a href="./../glib/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *path</code></em>,
+ <em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> path_len</code></em>,
+ <em class="parameter"><code><a class="link" href="GUnixSocketAddress.html#GUnixSocketAddressType" title="enum GUnixSocketAddressType"><span class="type">GUnixSocketAddressType</span></a> type</code></em>);</pre>
+<p>
+Creates a new <a class="link" href="GUnixSocketAddress.html" title="GUnixSocketAddress"><span class="type">GUnixSocketAddress</span></a> of type <em class="parameter"><code>type</code></em> with name <em class="parameter"><code>path</code></em>.
+</p>
<p>
-Creates a new abstract <a class="link" href="GUnixSocketAddress.html" title="GUnixSocketAddress"><span class="type">GUnixSocketAddress</span></a> for <em class="parameter"><code>path</code></em>.
+If <em class="parameter"><code>type</code></em> is <a class="link" href="GUnixSocketAddress.html#G-UNIX-SOCKET-ADDRESS-PATH:CAPS"><code class="literal">G_UNIX_SOCKET_ADDRESS_PATH</code></a>, this is equivalent to
+calling <a class="link" href="GUnixSocketAddress.html#g-unix-socket-address-new" title="g_unix_socket_address_new ()"><code class="function">g_unix_socket_address_new()</code></a>.
</p>
<p>
-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.
+If <em class="parameter"><code>path_type</code></em> is <a class="link" href="GUnixSocketAddress.html#G-UNIX-SOCKET-ADDRESS-ABSTRACT:CAPS"><code class="literal">G_UNIX_SOCKET_ADDRESS_ABSTRACT</code></a>, then <em class="parameter"><code>path_len</code></em>
+bytes of <em class="parameter"><code>path</code></em> will be copied to the socket's path, and only those
+bytes will be considered part of the name. (If <em class="parameter"><code>path_len</code></em> is -1,
+then <em class="parameter"><code>path</code></em> is assumed to be NUL-terminated.) For example, if <em class="parameter"><code>path</code></em>
+was "test", then calling <a class="link" href="GSocketAddress.html#g-socket-address-get-native-size" title="g_socket_address_get_native_size ()"><code class="function">g_socket_address_get_native_size()</code></a> on the
+returned socket would return 7 (2 bytes of overhead, 1 byte for the
+abstract-socket indicator byte, and 4 bytes for the name "test").
</p>
<p>
-Note that not all systems (really only Linux) support abstract
-socket names, so if you use them on other systems function calls may
-return <a class="link" href="gio-GIOError.html#G-IO-ERROR-NOT-SUPPORTED:CAPS"><code class="literal">G_IO_ERROR_NOT_SUPPORTED</code></a> errors. You can use
-<a class="link" href="GUnixSocketAddress.html#g-unix-socket-address-abstract-names-supported" title="g_unix_socket_address_abstract_names_supported ()"><code class="function">g_unix_socket_address_abstract_names_supported()</code></a> to see if abstract
-names are supported.
+If <em class="parameter"><code>path_type</code></em> is <a class="link" href="GUnixSocketAddress.html#G-UNIX-SOCKET-ADDRESS-ABSTRACT-PADDED:CAPS"><code class="literal">G_UNIX_SOCKET_ADDRESS_ABSTRACT_PADDED</code></a>, then
+<em class="parameter"><code>path_len</code></em> bytes of <em class="parameter"><code>path</code></em> will be copied to the socket's path, the
+rest of the path will be padded with 0 bytes, and the entire
+zero-padded buffer will be considered the name. (As above, if
+<em class="parameter"><code>path_len</code></em> is -1, then <em class="parameter"><code>path</code></em> is assumed to be NUL-terminated.) In
+this case, <a class="link" href="GSocketAddress.html#g-socket-address-get-native-size" title="g_socket_address_get_native_size ()"><code class="function">g_socket_address_get_native_size()</code></a> will always return
+the full size of a <code class="literal">struct sockaddr_un</code>, although
+<a class="link" href="GUnixSocketAddress.html#g-unix-socket-address-get-path-len" title="g_unix_socket_address_get_path_len ()"><code class="function">g_unix_socket_address_get_path_len()</code></a> will still return just the
+length of <em class="parameter"><code>path</code></em>.
</p>
<p>
-If <em class="parameter"><code>path_len</code></em> is -1 then <em class="parameter"><code>path</code></em> 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 <em class="parameter"><code>path_len</code></em> up to the max size
-of an abstract unix domain name is filled with zero bytes.</p>
+<a class="link" href="GUnixSocketAddress.html#G-UNIX-SOCKET-ADDRESS-ABSTRACT:CAPS"><code class="literal">G_UNIX_SOCKET_ADDRESS_ABSTRACT</code></a> is preferred over
+<a class="link" href="GUnixSocketAddress.html#G-UNIX-SOCKET-ADDRESS-ABSTRACT-PADDED:CAPS"><code class="literal">G_UNIX_SOCKET_ADDRESS_ABSTRACT_PADDED</code></a> for new programs. Of course,
+when connecting to a server created by another process, you must
+use the appropriate type corresponding to how that process created
+its listening socket.
+</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>path</code></em> :</span></p></td>
-<td> the abstract name
+<td>the name. <span class="annotation">[<acronym title="Parameter points to an array of items."><span class="acronym">array</span></acronym> length=path_len][<acronym title="Generics and defining elements of containers and arrays."><span class="acronym">element-type</span></acronym> gchar]</span>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>path_len</code></em> :</span></p></td>
-<td> the length of <em class="parameter"><code>path</code></em>, or -1
+<td>the length of <em class="parameter"><code>path</code></em>, or -1</td>
+</tr>
+<tr>
+<td><p><span class="term"><em class="parameter"><code>type</code></em> :</span></p></td>
+<td>a <a class="link" href="GUnixSocketAddress.html#GUnixSocketAddressType" title="enum GUnixSocketAddressType"><span class="type">GUnixSocketAddressType</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td> a new <a class="link" href="GUnixSocketAddress.html" title="GUnixSocketAddress"><span class="type">GUnixSocketAddress</span></a>
-
+<td>a new <a class="link" href="GUnixSocketAddress.html" title="GUnixSocketAddress"><span class="type">GUnixSocketAddress</span></a>
</td>
</tr>
</tbody>
</table></div>
-<p class="since">Since 2.22</p>
+<p class="since">Since 2.26</p>
</div>
<hr>
-<div class="refsect2" title="g_unix_socket_address_get_is_abstract ()">
+<div class="refsect2">
<a name="g-unix-socket-address-get-is-abstract"></a><h3>g_unix_socket_address_get_is_abstract ()</h3>
-<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> g_unix_socket_address_get_is_abstract
- (<a class="link" href="GUnixSocketAddress.html" title="GUnixSocketAddress"><span class="returnvalue">GUnixSocketAddress</span></a> *address);</pre>
+<pre class="programlisting"><a href="./../glib/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> g_unix_socket_address_get_is_abstract
+ (<em class="parameter"><code><a class="link" href="GUnixSocketAddress.html" title="GUnixSocketAddress"><span class="type">GUnixSocketAddress</span></a> *address</code></em>);</pre>
+<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
+<h3 class="title">Warning</h3>
+<p><code class="literal">g_unix_socket_address_get_is_abstract</code> is deprecated and should not be used in newly-written code. Use <a class="link" href="GUnixSocketAddress.html#g-unix-socket-address-get-address-type" title="g_unix_socket_address_get_address_type ()"><code class="function">g_unix_socket_address_get_address_type()</code></a></p>
+</div>
<p>
-Gets <em class="parameter"><code>address</code></em>'s path.</p>
+Tests if <em class="parameter"><code>address</code></em> is abstract.
+</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>address</code></em> :</span></p></td>
-<td> a <a class="link" href="GInetSocketAddress.html" title="GInetSocketAddress"><span class="type">GInetSocketAddress</span></a>
+<td>a <a class="link" href="GInetSocketAddress.html" title="GInetSocketAddress"><span class="type">GInetSocketAddress</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td> <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the address is abstract, <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> otherwise
-
-</td>
+<td>
+<a href="./../glib/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the address is abstract, <a href="./../glib/glib/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> otherwise</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.22</p>
</div>
<hr>
-<div class="refsect2" title="g_unix_socket_address_get_path ()">
+<div class="refsect2">
+<a name="g-unix-socket-address-get-address-type"></a><h3>g_unix_socket_address_get_address_type ()</h3>
+<pre class="programlisting"><a class="link" href="GUnixSocketAddress.html#GUnixSocketAddressType" title="enum GUnixSocketAddressType"><span class="returnvalue">GUnixSocketAddressType</span></a> g_unix_socket_address_get_address_type
+ (<em class="parameter"><code><a class="link" href="GUnixSocketAddress.html" title="GUnixSocketAddress"><span class="type">GUnixSocketAddress</span></a> *address</code></em>);</pre>
+<p>
+Gets <em class="parameter"><code>address</code></em>'s type.
+</p>
+<div class="variablelist"><table border="0">
+<col align="left" valign="top">
+<tbody>
+<tr>
+<td><p><span class="term"><em class="parameter"><code>address</code></em> :</span></p></td>
+<td>a <a class="link" href="GInetSocketAddress.html" title="GInetSocketAddress"><span class="type">GInetSocketAddress</span></a>
+</td>
+</tr>
+<tr>
+<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
+<td>a <a class="link" href="GUnixSocketAddress.html#GUnixSocketAddressType" title="enum GUnixSocketAddressType"><span class="type">GUnixSocketAddressType</span></a>
+</td>
+</tr>
+</tbody>
+</table></div>
+<p class="since">Since 2.26</p>
+</div>
+<hr>
+<div class="refsect2">
<a name="g-unix-socket-address-get-path"></a><h3>g_unix_socket_address_get_path ()</h3>
-<pre class="programlisting">const <span class="returnvalue">char</span> * g_unix_socket_address_get_path (<a class="link" href="GUnixSocketAddress.html" title="GUnixSocketAddress"><span class="returnvalue">GUnixSocketAddress</span></a> *address);</pre>
+<pre class="programlisting">const <span class="returnvalue">char</span> * g_unix_socket_address_get_path (<em class="parameter"><code><a class="link" href="GUnixSocketAddress.html" title="GUnixSocketAddress"><span class="type">GUnixSocketAddress</span></a> *address</code></em>);</pre>
<p>
Gets <em class="parameter"><code>address</code></em>'s path, or for abstract sockets the "name".
</p>
Guaranteed to be zero-terminated, but an abstract socket
may contain embedded zeros, and thus you should use
<a class="link" href="GUnixSocketAddress.html#g-unix-socket-address-get-path-len" title="g_unix_socket_address_get_path_len ()"><code class="function">g_unix_socket_address_get_path_len()</code></a> to get the true length
-of this string.</p>
+of this string.
+</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>address</code></em> :</span></p></td>
-<td> a <a class="link" href="GInetSocketAddress.html" title="GInetSocketAddress"><span class="type">GInetSocketAddress</span></a>
+<td>a <a class="link" href="GInetSocketAddress.html" title="GInetSocketAddress"><span class="type">GInetSocketAddress</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td> the path for <em class="parameter"><code>address</code></em>
-
+<td>the path for <em class="parameter"><code>address</code></em>
</td>
</tr>
</tbody>
<p class="since">Since 2.22</p>
</div>
<hr>
-<div class="refsect2" title="g_unix_socket_address_get_path_len ()">
+<div class="refsect2">
<a name="g-unix-socket-address-get-path-len"></a><h3>g_unix_socket_address_get_path_len ()</h3>
-<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gsize"><span class="returnvalue">gsize</span></a> g_unix_socket_address_get_path_len (<a class="link" href="GUnixSocketAddress.html" title="GUnixSocketAddress"><span class="returnvalue">GUnixSocketAddress</span></a> *address);</pre>
+<pre class="programlisting"><a href="./../glib/glib/glib-Basic-Types.html#gsize"><span class="returnvalue">gsize</span></a> g_unix_socket_address_get_path_len (<em class="parameter"><code><a class="link" href="GUnixSocketAddress.html" title="GUnixSocketAddress"><span class="type">GUnixSocketAddress</span></a> *address</code></em>);</pre>
<p>
Gets the length of <em class="parameter"><code>address</code></em>'s path.
</p>
<p>
-For details, see <a class="link" href="GUnixSocketAddress.html#g-unix-socket-address-get-path" title="g_unix_socket_address_get_path ()"><code class="function">g_unix_socket_address_get_path()</code></a>.</p>
+For details, see <a class="link" href="GUnixSocketAddress.html#g-unix-socket-address-get-path" title="g_unix_socket_address_get_path ()"><code class="function">g_unix_socket_address_get_path()</code></a>.
+</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>address</code></em> :</span></p></td>
-<td> a <a class="link" href="GInetSocketAddress.html" title="GInetSocketAddress"><span class="type">GInetSocketAddress</span></a>
+<td>a <a class="link" href="GInetSocketAddress.html" title="GInetSocketAddress"><span class="type">GInetSocketAddress</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td> the length of the path
-
-</td>
+<td>the length of the path</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.22</p>
</div>
<hr>
-<div class="refsect2" title="g_unix_socket_address_abstract_names_supported ()">
+<div class="refsect2">
<a name="g-unix-socket-address-abstract-names-supported"></a><h3>g_unix_socket_address_abstract_names_supported ()</h3>
-<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> g_unix_socket_address_abstract_names_supported
- (void);</pre>
+<pre class="programlisting"><a href="./../glib/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> g_unix_socket_address_abstract_names_supported
+ (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
<p>
-Checks if abstract unix domain socket names are supported.</p>
+Checks if abstract unix domain socket names are supported.
+</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td> <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if supported, <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> otherwise
-
-</td>
+<td>
+<a href="./../glib/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if supported, <a href="./../glib/glib/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> otherwise</td>
</tr></tbody>
</table></div>
<p class="since">Since 2.22</p>
</div>
</div>
-<div class="refsect1" title="Property Details">
+<div class="refsect1">
<a name="GUnixSocketAddress.property-details"></a><h2>Property Details</h2>
-<div class="refsect2" title='The "abstract" property'>
+<div class="refsect2">
<a name="GUnixSocketAddress--abstract"></a><h3>The <code class="literal">"abstract"</code> property</h3>
-<pre class="programlisting"> "abstract" <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> : Read / Write / Construct Only</pre>
-<p>Whether or not this is an abstract address.</p>
+<pre class="programlisting"> "abstract" <a href="./../glib/glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> : Read / Write / Construct Only</pre>
+<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
+<h3 class="title">Warning</h3>
+<p><code class="literal">GUnixSocketAddress:abstract</code> is deprecated and should not be used in newly-written code. Use <a class="link" href="GUnixSocketAddress.html#GUnixSocketAddress--address-type" title='The "address-type" property'><span class="type">"address-type"</span></a>, which
+distinguishes between zero-padded and non-zero-padded
+abstract addresses.</p>
+</div>
+<p>
+Whether or not this is an abstract address
+</p>
<p>Default value: FALSE</p>
</div>
<hr>
-<div class="refsect2" title='The "path" property'>
+<div class="refsect2">
+<a name="GUnixSocketAddress--address-type"></a><h3>The <code class="literal">"address-type"</code> property</h3>
+<pre class="programlisting"> "address-type" <a class="link" href="GUnixSocketAddress.html#GUnixSocketAddressType" title="enum GUnixSocketAddressType"><span class="type">GUnixSocketAddressType</span></a> : Read / Write / Construct Only</pre>
+<p>The type of UNIX socket address.</p>
+<p>Default value: G_UNIX_SOCKET_ADDRESS_PATH</p>
+</div>
+<hr>
+<div class="refsect2">
<a name="GUnixSocketAddress--path"></a><h3>The <code class="literal">"path"</code> property</h3>
-<pre class="programlisting"> "path" <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a>* : Read / Write / Construct Only</pre>
+<pre class="programlisting"> "path" <a href="./../glib/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a>* : Read / Write / Construct Only</pre>
<p>UNIX socket path.</p>
<p>Default value: NULL</p>
</div>
<hr>
-<div class="refsect2" title='The "path-as-array" property'>
+<div class="refsect2">
<a name="GUnixSocketAddress--path-as-array"></a><h3>The <code class="literal">"path-as-array"</code> property</h3>
-<pre class="programlisting"> "path-as-array" <a href="http://library.gnome.org/devel/glib/unstable/glib-Byte-Arrays.html#GByteArray"><span class="type">GByteArray</span></a>* : Read / Write / Construct Only</pre>
+<pre class="programlisting"> "path-as-array" <a href="./../glib/glib/glib-Byte-Arrays.html#GByteArray"><span class="type">GByteArray</span></a>* : Read / Write / Construct Only</pre>
<p>UNIX socket path, as byte array.</p>
</div>
</div>
</div>
<div class="footer">
<hr>
- Generated by GTK-Doc V1.13</div>
+ Generated by GTK-Doc V1.18</div>
</body>
</html>
\ No newline at end of file