4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
23 * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
27 /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
28 /* All Rights Reserved */
31 #pragma ident "%Z%%M% %I% %E% SMI"
36 * returns a list of remote systems accessible to uucico
38 * -l -> returns only the local system name.
39 * -c -> print remote systems accessible to cu
46 int c
, lflg
= 0, cflg
= 0;
47 char s
[BUFSIZ
], prev
[BUFSIZ
], name
[BUFSIZ
];
48 extern void setservice();
49 extern int sysaccess(), getsysline();
51 /* Set locale environment variables local definitions */
52 (void) setlocale(LC_ALL
, "");
53 #if !defined(TEXT_DOMAIN) /* Should be defined by cc -D */
54 #define TEXT_DOMAIN "SYS_TEST" /* Use this only if it wasn't */
56 (void) textdomain(TEXT_DOMAIN
);
58 while ( (c
= getopt(argc
, argv
, "lc")) != EOF
)
67 (void) fprintf(stderr
, gettext("usage: uuname [-l|-c]\n"));
73 (void) fprintf(stderr
,
74 gettext("uuname: -l overrides -c ... -c option ignored\n"));
86 if ( sysaccess(EACCESS_SYSTEMS
) != 0 ) {
87 (void)fprintf(stderr
, gettext(
88 "%s: cannot access Systems files\n"), argv
[0]);
92 while ( getsysline(s
, sizeof(s
)) ) {
93 if((s
[0] == '#') || (s
[0] == ' ') || (s
[0] == '\t') ||
96 (void) sscanf(s
, "%s", name
);
97 if (EQUALS(name
, prev
))
100 (void) strcpy(prev
, name
);
105 /* small, private copies of assert(), logent(), */
106 /* cleanup() so we can use routines in sysfiles.c */
110 assert(s1
, s2
, i1
, file
, line
)
111 char *s1
, *s2
, *file
; int i1
, line
;
113 (void)fprintf(stderr
, "uuname: %s %s\n", s2
, s1
);
122 void cleanup(code
) { exit(code
); }