Print this page
3188 ignore the comment in limits.h and define NAME_MAX
Reviewed by: Jason King <jason.brian.king@gmail.com>
Reviewed by: Peter Tribble <peter.tribble@gmail.com>
Reviewed by: Sam Zaydel <szaydel@racktopsystems.com>
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/cmd/ypcmd/ypsym.h
+++ new/usr/src/cmd/ypcmd/ypsym.h
1 1 /*
2 2 * CDDL HEADER START
3 3 *
4 4 * The contents of this file are subject to the terms of the
5 5 * Common Development and Distribution License (the "License").
6 6 * You may not use this file except in compliance with the License.
7 7 *
8 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 9 * or http://www.opensolaris.org/os/licensing.
10 10 * See the License for the specific language governing permissions
11 11 * and limitations under the License.
12 12 *
13 13 * When distributing Covered Code, include this CDDL HEADER in each
14 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 15 * If applicable, add the following below this CDDL HEADER, with the
16 16 * fields enclosed by brackets "[]" replaced with your own identifying
17 17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 18 *
19 19 * CDDL HEADER END
20 20 */
21 21 /*
22 22 * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
23 23 * Use is subject to license terms.
24 24 */
25 25
26 26 /* Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */
↓ open down ↓ |
26 lines elided |
↑ open up ↑ |
27 27 /* All Rights Reserved */
28 28
29 29 /*
30 30 * Portions of this source code were derived from Berkeley 4.3 BSD
31 31 * under license from the Regents of the University of California.
32 32 */
33 33
34 34 #ifndef __YPSYM_H
35 35 #define __YPSYM_H
36 36
37 -#pragma ident "%Z%%M% %I% %E% SMI"
38 -
39 37 #ifdef __cplusplus
40 38 extern "C" {
41 39 #endif
42 40
43 41 /*
44 42 * This contains symbol and structure definitions for modules in the YP server
45 43 */
46 44
47 45 #include <ndbm.h> /* Pull this in first */
48 46 #define DATUM
49 47 #include <stdio.h>
50 48 #include <errno.h>
51 49 #include <signal.h>
52 50 #include <rpc/rpc.h>
53 51 #include <dirent.h>
54 52 #include <sys/stat.h>
55 53 #include <sys/wait.h>
56 54 #include <rpcsvc/yp_prot.h>
57 55 #include "ypv1_prot.h"
58 56 #include <rpcsvc/ypclnt.h>
59 57
60 58 typedef void (*PFV)();
61 59 typedef int (*PFI)();
62 60 typedef unsigned int (*PFU)();
63 61 typedef long int (*PFLI)();
64 62 typedef unsigned long int (*PFULI)();
65 63 typedef short int (*PFSI)();
66 64 typedef unsigned short int (*PFUSI)();
67 65
68 66 #ifndef TRUE
69 67 #define TRUE 1
70 68 #endif
71 69
72 70 #ifndef FALSE
73 71 #define FALSE 0
74 72 #endif
75 73
76 74 #ifdef NULL
77 75 #undef NULL
78 76 #endif
79 77 #define NULL 0
80 78
81 79 /*
82 80 * Size of lock hash table
83 81 *
84 82 * It's for a hash table, hence better if it is prime.
85 83 * It's also the max number of maps and map locks, used
86 84 * for initializing shared memory: need to be big enough
87 85 * (until dynamic shared memory allocation is implemented ?).
88 86 */
89 87 #define MAXHASH 1009
90 88
91 89 /* Maximum length of a yp map name in the system v filesystem */
92 90 #define MAXALIASLEN 8
93 91
94 92 #define YPINTERTRY_TIME 10 /* Secs between tries for peer bind */
95 93 #define YPTOTAL_TIME 30 /* Total secs until timeout */
96 94 #define YPNOPORT ((unsigned short) 0) /* Out-of-range port value */
97 95
98 96 /* External refs to yp server data structures */
99 97
100 98 extern bool ypinitialization_done;
101 99 extern struct timeval ypintertry;
102 100 extern struct timeval yptimeout;
103 101 extern char myhostname[];
104 102 extern bool silent;
105 103 #ifdef MINUS_C_OPTION
106 104 extern bool multiflag;
107 105 #endif
108 106
109 107 /* External ref to logging func */
110 108 extern void logprintf(char *format, ...);
111 109
112 110 /* External refs for /var/yp/securenets support */
113 111 extern void get_secure_nets(char *daemon_name);
114 112
115 113 /* External refs to yp server-only functions */
116 114 extern bool ypcheck_map_existence(char *pname);
117 115 extern bool ypget_map_master(char **owner, DBM *fdb);
118 116 extern DBM *ypset_current_map(char *map, char *domain, uint_t *error);
119 117 extern void ypclr_current_map(void);
120 118 extern bool_t ypmkfilename(char *domain, char *map, char *path);
121 119 extern int yplist_maps();
122 120 extern bool yp_map_access(SVCXPRT *transp, uint_t *error, DBM *fdb);
123 121 extern bool ypget_map_order(char *map, char *domain, uint_t *order);
124 122
125 123 extern bool ypcheck_domain();
126 124 extern datum dbm_do_nextkey();
127 125 extern void ypclr_current_map(void);
128 126
129 127 extern void ypdomain(SVCXPRT *transp, bool always_respond);
130 128 extern void ypmatch(SVCXPRT *transp, struct svc_req *rqstp);
131 129 extern void ypfirst(SVCXPRT *transp);
132 130 extern void ypnext(SVCXPRT *transp);
133 131 extern void ypxfr(SVCXPRT *transp, int prog);
134 132 extern void ypall(SVCXPRT *transp);
135 133 extern void ypmaster(SVCXPRT *transp);
136 134 extern void yporder(SVCXPRT *transp);
137 135 extern void ypmaplist(SVCXPRT *transp);
138 136 extern void ypoldmatch(SVCXPRT *transp, struct svc_req *rqstp);
139 137 extern void ypoldfirst(SVCXPRT *transp);
140 138 extern void ypoldnext(SVCXPRT *transp);
141 139 extern void ypoldpoll(SVCXPRT *transp);
142 140 extern void ypoldpush(SVCXPRT *transp);
143 141 extern void ypoldpull(SVCXPRT *transp);
144 142 extern void ypoldget(SVCXPRT *transp);
145 143 extern int yp_matchdns(DBM *, struct ypreq_key *, struct ypresp_val *);
146 144 extern int yp_oldmatchdns(DBM *fdb,
147 145 struct yprequest *req, struct ypresponse *resp);
148 146
149 147 extern bool _xdr_ypreqeust(XDR *xdrs, struct yprequest *ps);
150 148 extern bool _xdr_ypresponse(XDR *xdrs, struct ypresponse *ps);
151 149
152 150 extern void setup_resolv(bool *fwding, int *child, CLIENT **client,
153 151 char *tp_type, long prognum);
154 152 extern int resolv_req(bool *fwding, CLIENT **client, int *pid,
155 153 char *tp, SVCXPRT *xprt, struct ypreq_key *req,
156 154 char *map);
157 155
↓ open down ↓ |
109 lines elided |
↑ open up ↑ |
158 156
159 157 /* definitions for reading files of lists */
160 158
161 159 struct listofnames
162 160 {
163 161 struct listofnames *nextname;
164 162 char *name;
165 163 };
166 164 typedef struct listofnames listofnames;
167 165
168 -/*
169 - * XXX- NAME_MAX can't be defined in <limits.h> in a POSIX conformant system
170 - * (under conditions which apply to Sun systems). Removal of this define
171 - * caused yp to break (and only yp!). Hence, NAME_MAX is defined here
172 - * *exactly* as it was in <limits.h>. I suspect this may not be the
173 - * desired value. I suspect the desired value is either:
174 - * - the maxumum name length for any file system type, or
175 - * - should be _POSIX_NAME_MAX which is the minimum-maximum name
176 - * length in a POSIX conformant system (which just happens to
177 - * be 14), or
178 - * - should be gotten by pathconf() or fpathconf().
179 - * XXX- I leave this to the owners of yp!
180 - */
181 -#define NAME_MAX 14 /* s5 file system maximum name length */
182 -
183 166 #ifdef __cplusplus
184 167 }
185 168 #endif
186 169
187 170 #endif /* __YPSYM_H */
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX