gbatch_open(3)

NAME
gbatch_open - open a connection to GNUbatch

gbatch_login - open a connection to GNUbatch with password

gbatch_wlogin - open a connection to GBUbatch with a password mapping user

gbatch_locallogin - open a connection on the local host

gbatch_locallogin_byid - open a connection on the local host, specifying user id

SYNOPSIS
#include <gbatch.h>

int gbatch_open(const char *hostname, const char *servname)

int gbatch_open(const char *hostname, const char *servname, const char *username)

int gbatch_login(const char *hostname, const char *servname, const char *username, const char *passwd)>

int gbatch_wlogin(const char *hostname, const char *servname, const char *username, const char *passwd)>

int gbatch_locallogin(const char *servname, const char *usernameB)>

int gbatch_locallogin_byid(const char *servname, const int_ugid_tuidB)>

DESCRIPTION
gbatch_open opens a connection from a a Unix host to the specified server, or from a predefined windows host set up in the hosts file, with the given user name, which must be mapped to the correct Unix user name.

gbatch_login logs in with the given user name (mapped to a user name on the server unless from a registered Unix host) and password.

gbatch_wlogin is as for gbatch_login, but the given user name is always mapped even if the caller is a Unix server.

gbatch_locallogin logs in on the local host. If the user name is non-null, then this will be used (if permitted) other than the effective uid.

gbatch_locallogin_byid takes a user id rather than a user name.

In all cases, hostname is the name of the host being connected to or null if the local server is to be used.

servname may be "NULL" to use a standard service name, otherwise an alternative service may be specified.

passwd should be the Unix password on the server or an alternate interface password set up by gbch-passwd(8). If this is not required it may be nulls.

Note that more than one connection can be open at any time with various combinations of user names and hosts.

When finished, close the conection with a call to gbatch_close(3).

RETURN VALUES
The function a non-negative value if successful, which is the file descriptor used in various other calls, otherwise an error code as defined in the include file gbatch.h.

EXAMPLE
 int fd;
 fd = gbatch_open("myhost", (char *) 0);
 if (fd < 0)  { /* handle error */
 ...
 }
 ...
 gbatch_close(fd)

SEE ALSO
gbatch_close(3), gbatch_newgrp(3), gbatch_setqueue(3), gbatch_jobmon(3), gbatch_varmon(3), gbch-passwd(8).

COPYRIGHT
Copyright (c) 2012 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.