/***********************************************************************/ /* */ /* OCaml */ /* */ /* Contributed by Stephane Glondu */ /* */ /* Copyright 2009 Institut National de Recherche en Informatique et */ /* en Automatique. All rights reserved. This file is distributed */ /* under the terms of the GNU Library General Public License, with */ /* the special exception on linking described in file ../../LICENSE. */ /* */ /***********************************************************************/ #include #include #include #ifdef HAS_INITGROUPS #include #ifdef HAS_UNISTD #include #endif #include #include #include #include "unixsupport.h" CAMLprim value unix_initgroups(value user, value group) { if (! caml_string_is_c_safe(user)) unix_error(EINVAL, "initgroups", user); if (initgroups(String_val(user), Int_val(group)) == -1) { uerror("initgroups", Nothing); } return Val_unit; } #else CAMLprim value unix_initgroups(value user, value group) { invalid_argument("initgroups not implemented"); } #endif