Note that fcntl(2) returns EINVAL for invalid command.
[netbsd-mini2440.git] / usr.bin / ypwhich / ypwhich.1
blob6e9155a79d344a9dc05f4c7da4dae033d1cc4125
1 .\" $NetBSD: ypwhich.1,v 1.14 2005/02/26 16:22:27 wiz Exp $
2 .\"
3 .\" Copyright (c) 1994 Christopher G. Demetriou
4 .\" All rights reserved.
5 .\"
6 .\" Redistribution and use in source and binary forms, with or without
7 .\" modification, are permitted provided that the following conditions
8 .\" are met:
9 .\" 1. Redistributions of source code must retain the above copyright
10 .\"    notice, this list of conditions and the following disclaimer.
11 .\" 2. Redistributions in binary form must reproduce the above copyright
12 .\"    notice, this list of conditions and the following disclaimer in the
13 .\"    documentation and/or other materials provided with the distribution.
14 .\" 3. All advertising materials mentioning features or use of this software
15 .\"    must display the following acknowledgement:
16 .\"      This product includes software developed by Christopher G. Demetriou.
17 .\" 4. The name of the author may not be used to endorse or promote products
18 .\"    derived from this software without specific prior written permission
19 .\"
20 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
21 .\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
22 .\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
23 .\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
24 .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
25 .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26 .\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27 .\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28 .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
29 .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 .\"
31 .Dd January 24, 2008
32 .Dt YPWHICH 1
33 .Os
34 .Sh NAME
35 .Nm ypwhich
36 .Nd return hostname of NIS server of map master
37 .Sh SYNOPSIS
38 .Nm
39 .Op Fl d Ar domain
40 .Oo
41 .Op Fl h
42 .Ar host
43 .Oc
44 .Op Fl T
45 .Nm
46 .Op Fl d Ar domain
47 .Op Fl h Ar host
48 .Op Fl f
49 .Op Fl t
50 .Op Fl T
51 .Fl m Op Ar mname
52 .Nm
53 .Fl x
54 .Sh DESCRIPTION
55 .Nm
56 tells which
57 .Tn NIS
58 server supplies
59 .Tn NIS
60 services to a client, or which is the master for a map.
61 If invoked without arguments, it gives the
62 .Tn NIS
63 server for the local machine.
65 .Ar host
66 is specified, that machine is queried to find out which
67 .Tn NIS
68 server it is using.
69 .Pp
70 The options are as follows:
71 .Bl -tag -width Fl
72 .It Fl d Ar domain
73 Specify a domain other than the default domain.
74 .It Fl h Ar host
75 Specify a host other than localhost to query for information.
76 .It Fl f
77 When used in conjunction with
78 .Fl m ,
79 force
80 .Nm
81 to query
82 .Ar host
83 directly, without using the local copy of
84 .Xr ypbind 8 .
85 .It Fl t
86 Inhibit translation of map nicknames
87 to their corresponding map names.
88 .It Fl T
89 Use TCP protocol instead of UDP.
90 .It Fl m Op Ar mname
91 Find the master
92 .Tn NIS
93 server for the named map.
94 .Ar mname
95 can be a map name or nickname.
97 .Ar mname
98 is omitted,
99 .Nm
100 will produce a list of available maps.
101 .It Fl x
102 Display the map nickname table.
106 exits with a non-zero exit code if
107 .Fl m
108 is used, and there was a problem in determining the map's master.
109 .Sh SEE ALSO
110 .Xr domainname 1 ,
111 .Xr ypcat 1 ,
112 .Xr ypmatch 1 ,
113 .Xr nis 8 ,
114 .Xr ypbind 8 ,
115 .Xr yppoll 8 ,
116 .Xr ypset 8
117 .Sh AUTHORS
118 .An Charles D. Cranor