[gnio] Add g_socket_get_fd
- From: Alexander Larsson <alexl src gnome org>
- To: svn-commits-list gnome org
- Subject: [gnio] Add g_socket_get_fd
- Date: Wed, 6 May 2009 09:29:37 -0400 (EDT)
commit e1089e810f0b50e7debcec8f1fa257d6af0de8b4
Author: Alexander Larsson <alexl redhat com>
Date: Wed May 6 15:29:12 2009 +0200
Add g_socket_get_fd
This is useful if you want to do weird lowlevel stuff.
---
gio/gsocket.c | 8 ++++++++
gio/gsocket.h | 1 +
2 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/gio/gsocket.c b/gio/gsocket.c
index 16f74f8..62df568 100644
--- a/gio/gsocket.c
+++ b/gio/gsocket.c
@@ -850,6 +850,14 @@ g_socket_set_listen_backlog (GSocket *socket,
}
}
+int
+g_socket_get_fd (GSocket *socket)
+{
+ g_return_val_if_fail (G_IS_SOCKET (socket), -1);
+
+ return socket->priv->fd;
+}
+
GSocketAddress *
g_socket_get_local_address (GSocket *socket,
GError **error)
diff --git a/gio/gsocket.h b/gio/gsocket.h
index 1a2b1db..49a5940 100644
--- a/gio/gsocket.h
+++ b/gio/gsocket.h
@@ -82,6 +82,7 @@ GSocket * g_socket_new (GSocketFamily
GSocketType type,
const char *protocol);
GSocket * g_socket_new_from_fd (gint fd);
+int g_socket_get_fd (GSocket *socket);
GSocketAddress * g_socket_get_local_address (GSocket *socket,
GError **error);
GSocketAddress * g_socket_get_remote_address (GSocket *socket,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]