[seed] Add os.getpgid
- From: Robert Carr <racarr src gnome org>
- To: svn-commits-list gnome org
- Subject: [seed] Add os.getpgid
- Date: Mon, 13 Apr 2009 21:16:08 -0400 (EDT)
commit 7dfbb440f03d3448a12a6e713a91e1d688c367aa
Author: Robert Carr <racarr mireia (none)>
Date: Mon Apr 13 20:56:50 2009 -0400
Add os.getpgid
---
modules/os/os.c | 23 +++++++++++++++++++++--
1 files changed, 21 insertions(+), 2 deletions(-)
diff --git a/modules/os/os.c b/modules/os/os.c
index c60d71e..b394a7e 100644
--- a/modules/os/os.c
+++ b/modules/os/os.c
@@ -221,12 +221,30 @@ seed_os_getlogin (SeedContext ctx,
{
if (argument_count != 0)
{
- EXPECTED_EXCEPTION("os.geteuid", "no arguments");
+ EXPECTED_EXCEPTION("os.getlogin", "no arguments");
}
return seed_value_from_string (ctx, getlogin(), exception);
}
+SeedValue
+seed_os_getpgid (SeedContext ctx,
+ SeedObject function,
+ SeedObject this_object,
+ size_t argument_count,
+ const SeedValue arguments[],
+ SeedException * exception)
+{
+ pid_t pid;
+ if (argument_count != 1)
+ {
+ EXPECTED_EXCEPTION("os.getpgid", "no arguments");
+ }
+ pid = (pid_t) seed_value_to_long (ctx, arguments[0], exception);
+
+ return seed_value_from_long (ctx, (glong) getpgid(pid), exception);
+}
+
seed_static_function os_funcs[] = {
{"chdir", seed_os_chdir, 0},
{"fchdir", seed_os_fchdir, 0},
@@ -236,7 +254,8 @@ seed_static_function os_funcs[] = {
{"geteuid", seed_os_geteuid, 0},
{"getgid", seed_os_getgid, 0},
{"getuid", seed_os_getuid, 0},
- {"getlogin", seed_os_getlogin, 0}
+ {"getlogin", seed_os_getlogin, 0},
+ {"getpgid", seed_os_getpgid, 0}
};
SeedObject
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]