ibm-information-center/dist/eclipse/plugins/i5OS.ic.apis_5.4.0.1/qsysetgroups.htm

233 lines
7.3 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Copyright" content="Copyright (c) 2006 by IBM Corporation">
<title>qsysetgroups()--Set Supplemental Group IDs</title>
<!-- Begin Header Records ========================================== -->
<!-- All rights reserved. Licensed Materials Property of IBM -->
<!-- US Government Users Restricted Rights -->
<!-- Use, duplication or disclosure restricted by -->
<!-- GSA ADP Schedule Contract with IBM Corp. -->
<!-- Change History: -->
<!-- YYMMDD USERID Change description -->
<!-- This file has undergone html cleanup June 2002 by JET -->
<!--End Header Records -->
<link rel="stylesheet" type="text/css" href="../rzahg/ic.css">
</head>
<body>
<a name="Top_Of_Page"></a>
<!-- Java sync-link -->
<script type="text/javascript" language="Javascript" src="../rzahg/synch.js">
</script>
<h2>qsysetgroups()--Set Supplemental Group IDs</h2>
<!-- =========================================== -->
<!-- S Y N T A X / P A R M T A B L E -->
<!-- =========================================== -->
<div class="box" style="width: 80%;">
<br>
&nbsp;&nbsp;Syntax<br>
<pre>
#include &lt;qsysetid.h&gt;
int qsysetgroups(int <em>gidsetsize</em>, gid_t <em>grouplist</em>[])
</pre>
&nbsp;&nbsp;Service Program Name: QSYSETIDS<br>
<!-- iddvc RMBR -->
<br>
&nbsp;&nbsp;Default Public Authority: *USE<br>
<!-- iddvc RMBR -->
<br>
&nbsp;&nbsp;Threadsafe: No<br>
<!-- iddvc RMBR -->
<br>
</div>
<!-- =========================================== -->
<!-- D E F I N I T I O N -->
<!-- =========================================== -->
<p>The qsysetgroups API sets the supplementary group IDs of the calling thread.
The qsysetgroups API cannot set more than (NGROUPS_MAX-1) groups in the group
set.</p>
<img src="delta.gif" alt="Start of change">
<p> The real group
ID, effective group ID and saved group ID remain unchanged.</p>
<p>Job scoped locks with a lock state of *SHRRD are held on the user profiles
associated with the real user ID, effective user ID, saved user ID, real group
ID, effective group ID, saved group ID, and all of the supplemental groups.</p>
<img src="deltaend.gif" alt="End of change">
<br>
<!-- =========================================== -->
<!-- P A R A M E T E R S -->
<!-- ==========================================
= -->
<h3>Parameters</h3>
<dl><!-- Parameter 1 -->
<dt><strong><em>gidsetsize</em></strong></dt>
<dd>(Input) The number of elements in the supplied array <em>grouplist</em>.
<img src="delta.gif" alt="Start of change">
If the number of elements is specified as 0,
the current supplementary groups will be removed.
<img src="deltaend.gif" alt="End of change">
<!-- Parameter 2 --><br>
<br>
</dd>
<dt><strong><em>grouplist</em></strong></dt>
<dd>(Input) The supplementary group IDs.</dd>
</dl>
<br>
<!-- =========================================== -->
<!-- A U T H O R I T I E S A N D L O C K S -->
<!-- =========================================== -->
<h3>Authorities and locks</h3>
<!-- auth / lock 1 -->
<dl>
<dt><strong>User profile associated with <em>gid</em> Authority</strong></dt>
<dd>*USE authority is required to the user profile associated with each <em>gid</em>
in the group list if the <em>gid</em> is not equal to the current
thread's real, effective, or saved group IDs or one of the groups in the
current thread's supplemental group list.
<!-- auth / lock 2 --><br>
<br>
</dd>
<dt><strong>User profile associated with each <em>gid</em> Lock</strong></dt>
<dd>*SHRRD</dd>
</dl>
<br>
<!-- =========================================== -->
<!-- R E T U R N V A L U E -->
<!-- =========================================== -->
<h3>Return Value</h3>
<table cellpadding="5">
<!-- cols="5 95" -->
<tr>
<td align="left" valign="top"><em>0</em></td>
<td align="left" valign="top"><strong>qsysetgroups()</strong> was
successful.</td>
</tr>
<tr>
<td align="left" valign="top"><em>-1</em></td>
<td align="left" valign="top"><strong>qsysetgroups()</strong> was not
successful. The <em>errno</em> global variable is set to indicate the
error.</td>
</tr>
</table>
<br>
<br>
<!-- =========================================== -->
<!-- E R R O R C O N D I T I O N S -->
<!-- =========================================== -->
<h3>Error Conditions</h3>
<p>If <strong>qsysetgroups()</strong> is not successful, <em>errno</em> usually
indicates one of the following errors. Under some conditions, <em>errno</em>
could indicate an error other than those listed here.</p>
<table cellpadding="5">
<!-- cols="25 75" -->
<tr>
<th align="left" valign="bottom">Error condition</th>
<th align="left" valign="bottom">Additional information</th>
</tr>
<tr>
<td align="left" valign="top">
<em>[<a href="unix14.htm#EAGAIN">EAGAIN</a>]</em></td>
<td align="left" valign="top">
<p>User profile associated with a <em>gid</em> is locked. Try again.</p>
</td></tr>
<tr><td align="left" valign="top"><em>[<a href="unix14.htm#EDAMAGE">EDAMAGE</a>]</em></td>
<td align="left" valign="top">
<p>The user profile associated with a <em>gid</em> or an internal system object is
damaged.</p>
</td></tr>
<tr>
<td align="left" valign="top">
<em>[<a href="unix14.htm#EINVAL">EINVAL</a>]</em></td>
<td align="left" valign="top">
<p>One of the GID values in the <em>grouplist</em> argument is not valid.
Following are possible reasons:</p>
<ul compact>
<li>Out of range.</li>
<li>Not associated with a user profile.</li>
<li>gidsetsize too large.</li>
</ul>
</td>
</tr>
<tr><td align="left" valign="top"><em>[<a href="unix14.htm#ENOTSUP">ENOTSUP</a>]</em></td>
<td align="left" valign="top">
<p>Operation not supported. The current effective user profile specifies
OWNER(*GRPPRF), but the user's first group is not equal to the current
effective group profile and the user's first group is not in this list of
supplemental groups.</p>
</td></tr>
<tr><td align="left" valign="top"><em>[<a href="unix14.htm#EPERM">EPERM</a>]</em></td>
<td align="left" valign="top">
<p>Operation not permitted. Following are possible reasons:</p>
<ul>
<li>The thread does not have *USE authority to the user profile associated with
the <em>GID</em> and the <em>GID</em> to be set is not the same as the real,
effective, saved group IDs or any of the supplemental groups.</li>
<li>Supplemental groups cannot be set if effective GID is 0.</li>
</ul>
</td></tr>
<tr><td align="left" valign="top"><em>[<a href="unix14.htm#EUNKNOWN">EUNKNOWN</a>]</em></td>
<td align="left" valign="top">
<p>An unknown error has occurred. Check the joblog for error messages.</p>
</td></tr>
</table>
<br>
<!-- =========================================== -->
<!-- R E L A T E D I N F O R M A T I O N -->
<!-- =========================================== --><br>
<hr>
API introduced: V5R2
<hr>
<center>
<table cellpadding="2" cellspacing="2">
<tr align="center">
<td valign="middle" align="center"><a href="#Top_Of_Page">Top</a> | <a href=
"unix.htm">UNIX-Type APIs</a> | <a href="aplist.htm">APIs by category</a></td>
</tr>
</table>
</center>
</body>
</html>