=head1 NAME

gbatch_gethenv - get static environment

=head1 SYNOPSIS

=for man
\&\fB#include <gbatch.h>\fR
.PP

=for html
<STRONG>#include &lt;gbatch.h&gt;</STRONG>
<br>

B<char **gbatch_gethenv(const int> I<fd>B<)>

=head1 DESCRIPTION

The function B<gbatch_gethenv> is used to obtain a copy of the I<static
environment file> for the server. This will provide the environment
variables which a job running on that server would have unless
overridden by separate environment variables in the job.

I<fd> is a file descriptor which was previously returned by a
successful call to gbatch_open(3).

The result is a vector of character pointers containing environment
variable assignments of the form C<NAME=VALUE>. This list is
terminated by a null pointer. If there is no static environment file,
an empty list is returned, i.e. it will be a pointer to a C<char *>
location containing C<NULL>.

Unlike other routines, the user has the responsibility to deallocate
the space allocated, each string and the overall vector, when not
required.

=head1 RETURN VALUES

The function returns a null-terminated vector of character vectors  if
successful, otherwise \fBNULL\fR and an error code as
defined in the include file \fBgbatch.h\fR is placed in
\fBgbatch_dataerror\fR.

=head1 SEE ALSO

gbatch_delenv(3),
gbatch_getenv(3),
gbatch_getenvlist(3),
gbatch_putenv(3),
gbatch_putenvlist(3).

=head1 COPYRIGHT

Copyright (c) 2009 Free Software Foundation, Inc.
This is free software. You may redistribute copies of it under the
terms of the GNU General Public License
<http://www.gnu.org/licenses/gpl.html>.
There is NO WARRANTY, to the extent permitted by law.

=head1 AUTHOR

John M Collins, Xi Software Ltd.

=cut

## Local Variables:
## mode: nroff
## End:
