[seed] Add getegid and geteuid
- From: Robert Carr <racarr src gnome org>
- To: svn-commits-list gnome org
- Subject: [seed] Add getegid and geteuid
- Date: Mon, 13 Apr 2009 21:15:48 -0400 (EDT)
commit ac649d8e3fa6f2112bdb2ea1ee4857f67b872b17
Author: Robert Carr <racarr mireia (none)>
Date: Mon Apr 13 20:35:50 2009 -0400
Add getegid and geteuid
---
modules/os/os.c | 44 +++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 43 insertions(+), 1 deletions(-)
diff --git a/modules/os/os.c b/modules/os/os.c
index d1f84b9..5cc3afa 100644
--- a/modules/os/os.c
+++ b/modules/os/os.c
@@ -97,11 +97,53 @@ seed_os_ctermid (SeedContext ctx,
return seed_ret;
}
+SeedValue
+seed_os_getegid (SeedContext ctx,
+ SeedObject function,
+ SeedObject this_object,
+ size_t argument_count,
+ const SeedValue arguments[],
+ SeedException * exception)
+{
+ SeedValue seed_ret;
+ gid_t ret;
+
+ if (argument_count != 0)
+ {
+ EXPECTED_EXCEPTION("os.getegid", "no arguments");
+ }
+ ret = getegid ();
+
+ return seed_value_from_long (ctx, (glong) ret, exception);
+}
+
+SeedValue
+seed_os_geteuid (SeedContext ctx,
+ SeedObject function,
+ SeedObject this_object,
+ size_t argument_count,
+ const SeedValue arguments[],
+ SeedException * exception)
+{
+ SeedValue seed_ret;
+ uid_t ret;
+
+ if (argument_count != 0)
+ {
+ EXPECTED_EXCEPTION("os.geteuid", "no arguments");
+ }
+ ret = geteuid ();
+
+ return seed_value_from_long (ctx, (glong) ret, exception);
+}
+
seed_static_function os_funcs[] = {
{"chdir", seed_os_chdir, 0},
{"fchdir", seed_os_fchdir, 0},
{"getcwd", seed_os_getcwd, 0},
- {"ctermid", seed_os_ctermid, 0}
+ {"ctermid", seed_os_ctermid, 0},
+ {"getegid", seed_os_getegid, 0},
+ {"geteuid", seed_os_geteuid, 0}
};
SeedObject
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]