diff --git a/gio/gcredentials.c b/gio/gcredentials.c
index ee37247..e79901f 100644
--- a/gio/gcredentials.c
+++ b/gio/gcredentials.c
@@ -24,17 +24,10 @@
 
 #include <stdlib.h>
 
-#ifdef __linux__
-#define __USE_GNU
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <unistd.h>
-#include <string.h>
-#endif
-
 #include <gobject/gvaluecollector.h>
 
 #include "gcredentials.h"
+#include "gnetworkingprivate.h"
 #include "gioerror.h"
 
 #include "glibintl.h"
@@ -58,8 +51,10 @@
  * g_unix_connection_receive_credentials() for details.
  *
  * On Linux, the native credential type is a <type>struct ucred</type>
- * - see the <literal>unix(7)</literal> man page for details. This
- * corresponds to %G_CREDENTIALS_TYPE_LINUX_UCRED.
+ * - see the
+ * <citerefentry><refentrytitle>unix</refentrytitle><manvolnum>7</manvolnum></citerefentry>
+ * man page for details. This corresponds to
+ * %G_CREDENTIALS_TYPE_LINUX_UCRED.
  */
 
 /**
diff --git a/gio/gnetworkingprivate.h b/gio/gnetworkingprivate.h
index 9cbb55d..dcfba0d 100644
--- a/gio/gnetworkingprivate.h
+++ b/gio/gnetworkingprivate.h
@@ -40,6 +40,14 @@
 
 #else /* !G_OS_WIN32 */
 
+/* need this for struct ucred on Linux */
+#ifdef __linux__
+#define __USE_GNU
+#include <sys/types.h>
+#include <sys/socket.h>
+#undef __USE_GNU
+#endif
+
 #include <sys/types.h>
 #include <arpa/inet.h>
 #include <arpa/nameser.h>
diff --git a/gio/gsocket.c b/gio/gsocket.c
index cc8bf6b..fbb8974 100644
--- a/gio/gsocket.c
+++ b/gio/gsocket.c
@@ -27,14 +27,6 @@
 
 #include "config.h"
 
-/* for struct ucred */
-#include <stdlib.h>
-#ifdef __linux__
-#define __USE_GNU
-#include <sys/types.h>
-#include <sys/socket.h>
-#endif
-
 #include "gsocket.h"
 
 #include <errno.h>
@@ -3343,6 +3335,11 @@ g_socket_receive_message (GSocket                 *socket,
  * the %G_IO_ERROR_NOT_SUPPORTED error. On Linux this is implemented
  * by reading the %SO_PEERCRED option on the underlying socket.
  *
+ * Other ways to obtain credentials from a foreign peer includes the
+ * #GUnixCredentialsMessage type and
+ * g_unix_connection_send_credentials() /
+ * g_unix_connection_receive_credentials() functions.
+ *
  * Returns: %NULL if @error is set, otherwise a #GCredentials object
  * that must be freed with g_object_unref().
  *
diff --git a/gio/gunixconnection.c b/gio/gunixconnection.c
index b5cf136..d5da2a0 100644
--- a/gio/gunixconnection.c
+++ b/gio/gunixconnection.c
@@ -316,6 +316,9 @@ gboolean                g_unix_connection_create_pair                   (GUnixCo
  * byte to the stream, as this is required for credentials passing to
  * work on some implementations.
  *
+ * Other ways to exchange credentials with a foreign peer includes the
+ * #GUnixCredentialsMessage type and g_socket_get_credentials() function.
+ *
  * Note that this function only works on Linux, currently.
  *
  * Returns: %TRUE on success, %FALSE if @error is set.
@@ -382,6 +385,9 @@ g_unix_connection_send_credentials (GUnixConnection      *connection,
  * single byte from the stream, as this is required for credentials
  * passing to work on some implementations.
  *
+ * Other ways to exchange credentials with a foreign peer includes the
+ * #GUnixCredentialsMessage type and g_socket_get_credentials() function.
+ *
  * Returns: Received credentials on success (free with
  * g_object_unref()), %NULL if @error is set.
  *
diff --git a/gio/gunixcredentialsmessage.c b/gio/gunixcredentialsmessage.c
index f287c60..e6dadfb 100644
--- a/gio/gunixcredentialsmessage.c
+++ b/gio/gunixcredentialsmessage.c
@@ -26,9 +26,12 @@
  * %G_SOCKET_FAMILY_UNIX family).
  *
  * For an easier way to send and receive credentials over
- * stream-oriented UNIX sockets, see g_unix_connection_send_credentials() and
- * g_unix_connection_receive_credentials().
- **/
+ * stream-oriented UNIX sockets, see
+ * g_unix_connection_send_credentials() and
+ * g_unix_connection_receive_credentials(). To receive credentials of
+ * a foreign process connected to a socket, use
+ * g_socket_get_credentials().
+ */
 
 #include "config.h"
 
