Index: python/vte.override
===================================================================
--- python/vte.override	(revision 1518)
+++ python/vte.override	(working copy)
@@ -114,7 +114,7 @@
 	PyObject *py_argv = NULL, *py_envv = NULL,
 		 *loglastlog = NULL, *logutmp = NULL, *logwtmp = NULL;
 	int i, n_args, n_envs;
-	GPid pid;
+	pid_t pid;
 
 	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|sOOsOOO:fork_command",
 					 kwlist, &command, &py_argv, &py_envv,
@@ -190,7 +190,7 @@
 	PyObject *py_envv = NULL,
 		 *loglastlog = NULL, *logutmp = NULL, *logwtmp = NULL;
 	int i, n_args, n_envs;
-	GPid pid;
+	pid_t pid;
 
 	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OsOOO:forkpty",
 					 kwlist, &py_envv, &directory,
Index: python/vte.defs
===================================================================
--- python/vte.defs	(revision 1518)
+++ python/vte.defs	(working copy)
@@ -59,7 +59,7 @@
 (define-method fork_command
   (of-object "VteTerminal")
   (c-name "vte_terminal_fork_command")
-  (return-type "GPid")
+  (return-type "pid_t")
   (parameters
     '("const-char*" "command")
     '("char**" "argv")
@@ -74,7 +74,7 @@
 (define-method forkpty
   (of-object "VteTerminal")
   (c-name "vte_terminal_forkpty")
-  (return-type "GPid")
+  (return-type "pid_t")
   (parameters
     '("char**" "envv")
     '("const-char*" "directory")
Index: src/vte.c
===================================================================
--- src/vte.c	(revision 1518)
+++ src/vte.c	(working copy)
@@ -2729,7 +2729,7 @@
 }
 
 /* Basic wrapper around _vte_pty_open, which handles the pipefitting. */
-static GPid
+static pid_t
 _vte_terminal_fork_basic(VteTerminal *terminal, const char *command,
 			 char **argv, char **envv,
 			 const char *directory,
@@ -2737,7 +2737,7 @@
 {
 	char **env_add;
 	int i;
-	GPid pid;
+	pid_t pid;
 	VteReaper *reaper;
 
 	/* Duplicate the environment, and add one more variable. */
@@ -2842,7 +2842,7 @@
  *
  * Returns: the ID of the new process
  */
-GPid
+pid_t
 vte_terminal_fork_command(VteTerminal *terminal,
 			  const char *command, char **argv, char **envv,
 			  const char *directory,
@@ -2914,19 +2914,15 @@
  *
  * Since: 0.11.11
  */
-GPid
+pid_t
 vte_terminal_forkpty(VteTerminal *terminal,
 		     char **envv, const char *directory,
 		     gboolean lastlog, gboolean utmp, gboolean wtmp)
 {
-	GPid ret;
-
 	g_return_val_if_fail(VTE_IS_TERMINAL(terminal), -1);
 
-	ret = _vte_terminal_fork_basic(terminal, NULL, NULL, envv,
+	return _vte_terminal_fork_basic(terminal, NULL, NULL, envv,
 				       directory, lastlog, utmp, wtmp);
-
-	return ret;
 }
 
 /* Handle an EOF from the client. */
Index: src/vte.h
===================================================================
--- src/vte.h	(revision 1518)
+++ src/vte.h	(working copy)
@@ -23,6 +23,8 @@
 #include <gtk/gtk.h>
 #include <pango/pango.h>
 
+#include <sys/types.h> /* for pid_t */
+
 G_BEGIN_DECLS
 
 /* Private implementation details. */
@@ -197,7 +199,7 @@
 
 /* You can get by with just these two functions. */
 GtkWidget *vte_terminal_new(void);
-GPid vte_terminal_fork_command(VteTerminal *terminal,
+pid_t vte_terminal_fork_command(VteTerminal *terminal,
 				const char *command, char **argv,
 				char **envv, const char *directory,
 				gboolean lastlog,
@@ -205,7 +207,7 @@
 				gboolean wtmp);
 
 /* Users of libzvt may find this useful. */
-GPid vte_terminal_forkpty(VteTerminal *terminal,
+pid_t vte_terminal_forkpty(VteTerminal *terminal,
 			   char **envv, const char *directory,
 			   gboolean lastlog,
 			   gboolean utmp,
Index: src/pty.c
===================================================================
--- src/pty.c	(revision 1518)
+++ src/pty.c	(working copy)
@@ -64,7 +64,7 @@
 #endif
 #include "../gnome-pty-helper/gnome-pty.h"
 static gboolean _vte_pty_helper_started = FALSE;
-static GPid _vte_pty_helper_pid = -1;
+static pid_t _vte_pty_helper_pid = -1;
 static int _vte_pty_helper_tunnel = -1;
 static GTree *_vte_pty_helper_map = NULL;
 #endif
@@ -983,11 +983,12 @@
  * Returns: an open file descriptor for the pty master, -1 on failure
  */
 int
-_vte_pty_open(GPid *child, char **env_add,
+_vte_pty_open(pid_t *child_pid, char **env_add,
 	      const char *command, char **argv, const char *directory,
 	      int columns, int rows,
 	      gboolean lastlog, gboolean utmp, gboolean wtmp)
 {
+	GPid child;
 	int ret = -1;
 #ifdef VTE_USE_GNOME_PTY_HELPER
 	int op = 0;
@@ -1013,18 +1014,22 @@
 	g_assert(op >= 0);
 	g_assert(op < G_N_ELEMENTS(opmap));
 	if (ret == -1) {
-		ret = _vte_pty_open_with_helper(child, env_add, command, argv,
+		ret = _vte_pty_open_with_helper(&child, env_add, command, argv,
 						directory,
 						columns, rows, opmap[op]);
 	}
 #endif
 	if (ret == -1) {
-		ret = _vte_pty_open_unix98(child, env_add, command, argv,
+		ret = _vte_pty_open_unix98(&child, env_add, command, argv,
 					   directory, columns, rows);
 	}
+	if (ret != -1) {
+		*child_pid = (pid_t) child;
+	}
 #ifdef VTE_DEBUG
 	if (_vte_debug_on(VTE_DEBUG_PTY)) {
-		g_printerr("Returning ptyfd = %d.\n", ret);
+		g_printerr("Returning ptyfd = %d, child = %ld.\n",
+			       	ret, (long) child);
 	}
 #endif
 	return ret;
Index: src/pty.h
===================================================================
--- src/pty.h	(revision 1518)
+++ src/pty.h	(working copy)
@@ -19,16 +19,15 @@
 #ifndef vte_pty_h_included
 #define vte_pty_h_included
 
+#include <sys/type.h>
 
-#include <sys/types.h>
-
 G_BEGIN_DECLS
 
 /* Start up the given binary (exact path, not interpreted at all) in a
  * pseudo-terminal of its own, returning the descriptor for the master
  * side of the PTY pair, logging the session to the specified files, and
  * storing the child's PID in the given argument. */
-int _vte_pty_open(GPid *child, char **env_add,
+int _vte_pty_open(pid_t *child, char **env_add,
 		  const char *command, char **argv, const char *directory,
 		  int columns, int rows,
 		  gboolean lastlog, gboolean utmp, gboolean wtmp);
