gbatch_gethenv(3)

NAME
gbatch_gethenv - get static environment

SYNOPSIS
#include <gbatch.h>

char **gbatch_gethenv(const int fd)

DESCRIPTION
The function gbatch_gethenv is used to obtain a copy of the 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.

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 "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 "char *" location containing "NULL".

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

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.

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

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.

AUTHOR
John M Collins, Xi Software Ltd.