/*
    YPS-0.2, NIS-Server for Linux
    Copyright (C) 1994  Tobias Reber

    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
static char rcsid[]="@(#)$Id: domainname.c,v 0.16 1994/01/02 21:59:08 root Exp $";
/*
 *	$Author: root $
 *	$Log: domainname.c,v $
 * Revision 0.16  1994/01/02  21:59:08  root
 * Strict prototypes
 *
 * Revision 0.15  1994/01/02  20:10:08  root
 * Added GPL notice
 *
 * Revision 0.14  1993/06/12  10:49:35  root
 * Align with include-4.4
 *
 */

#include <unistd.h>
#include <stdio.h>

void
main(int argc, char **argv)
{
	if (argv[1]) 
		setdomainname(argv[1], strlen(argv[1]));
	else {
		char domainname[64];
		getdomainname(domainname, sizeof domainname);
		printf("%s\n", domainname);
	}
}
