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 | 3258a81 | 2011-06-23 11:28:45 -0700 | [diff] [blame] | 9 | GLib::~GLib() {} |
| 10 | |
Darin Petkov | 92c4390 | 2011-06-09 20:46:06 -0700 | [diff] [blame] | 11 | guint GLib::ChildWatchAdd(GPid pid, |
| 12 | GChildWatchFunc function, |
| 13 | gpointer data) { |
| 14 | return g_child_watch_add(pid, function, data); |
| 15 | } |
| 16 | |
| 17 | gboolean GLib::SourceRemove(guint tag) { |
| 18 | return g_source_remove(tag); |
| 19 | } |
| 20 | |
Darin Petkov | f7897bc | 2011-06-08 17:13:36 -0700 | [diff] [blame] | 21 | gboolean GLib::SpawnAsync(const gchar *working_directory, |
| 22 | gchar **argv, |
| 23 | gchar **envp, |
| 24 | GSpawnFlags flags, |
| 25 | GSpawnChildSetupFunc child_setup, |
| 26 | gpointer user_data, |
| 27 | GPid *child_pid, |
| 28 | GError **error) { |
| 29 | return g_spawn_async(working_directory, |
| 30 | argv, |
| 31 | envp, |
| 32 | flags, |
| 33 | child_setup, |
| 34 | user_data, |
| 35 | child_pid, |
| 36 | error); |
| 37 | } |
| 38 | |
Darin Petkov | 92c4390 | 2011-06-09 20:46:06 -0700 | [diff] [blame] | 39 | void GLib::SpawnClosePID(GPid pid) { |
| 40 | g_spawn_close_pid(pid); |
| 41 | } |
| 42 | |
Darin Petkov | f7897bc | 2011-06-08 17:13:36 -0700 | [diff] [blame] | 43 | } // namespace shill |