Darin Petkov | f7897bc | 2011-06-08 17:13:36 -0700 | [diff] [blame] | 1 | // Copyright (c) 2011 The Chromium OS Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #include "shill/glib.h" |
| 6 | |
| 7 | namespace shill { |
| 8 | |
Darin Petkov | 92c4390 | 2011-06-09 20:46:06 -0700 | [diff] [blame^] | 9 | guint GLib::ChildWatchAdd(GPid pid, |
| 10 | GChildWatchFunc function, |
| 11 | gpointer data) { |
| 12 | return g_child_watch_add(pid, function, data); |
| 13 | } |
| 14 | |
| 15 | gboolean GLib::SourceRemove(guint tag) { |
| 16 | return g_source_remove(tag); |
| 17 | } |
| 18 | |
Darin Petkov | f7897bc | 2011-06-08 17:13:36 -0700 | [diff] [blame] | 19 | gboolean GLib::SpawnAsync(const gchar *working_directory, |
| 20 | gchar **argv, |
| 21 | gchar **envp, |
| 22 | GSpawnFlags flags, |
| 23 | GSpawnChildSetupFunc child_setup, |
| 24 | gpointer user_data, |
| 25 | GPid *child_pid, |
| 26 | GError **error) { |
| 27 | return g_spawn_async(working_directory, |
| 28 | argv, |
| 29 | envp, |
| 30 | flags, |
| 31 | child_setup, |
| 32 | user_data, |
| 33 | child_pid, |
| 34 | error); |
| 35 | } |
| 36 | |
Darin Petkov | 92c4390 | 2011-06-09 20:46:06 -0700 | [diff] [blame^] | 37 | void GLib::SpawnClosePID(GPid pid) { |
| 38 | g_spawn_close_pid(pid); |
| 39 | } |
| 40 | |
Darin Petkov | f7897bc | 2011-06-08 17:13:36 -0700 | [diff] [blame] | 41 | } // namespace shill |