1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
|
--- build/os-type 1998/04/24 14:27:16 1.1
+++ build/os-type 1998/04/24 14:28:04
@@ -106,6 +106,7 @@
;;
"linux"*) OS=linux;;
"freebsd"*) OS="${osname}${osmajver}";;
+ "netbsd"*) OS="netbsd131";;
# OpenBSD looks like freebsd2 right now
"openbsd"*) OS="freebsd2";;
"dgux"*) OS=dgux;;
--- include/defs.h 1998/04/24 14:28:52 1.1
+++ include/defs.h 1998/04/24 14:29:43
@@ -403,7 +403,11 @@
extern void error(char *, ...);
extern void fatalerr(char *, ...);
extern void message(int, char *, ...);
+#if defined(NETBSD)
+extern void setproctitle(const char *fmt, ...);
+#else
extern void setproctitle(char *fmt, ...);
+#endif /* NetBSD */
#else
extern void debugmsg();
extern void error();
--- include/filesys.h 1998/04/24 14:30:29 1.1
+++ include/filesys.h 1998/04/24 14:30:47
@@ -111,7 +111,7 @@
typedef struct statvfs statfs_t;
# define statfs(mp,sb) statvfs(mp,sb)
#else
-#if defined(BSD386) || defined(__bsdi__) || defined(FREEBSD) || STATFS_TYPE == STATFS_OSF1
+#if defined(BSD386) || defined(__bsdi__) || defined(FREEBSD) || defined(NETBSD) || STATFS_TYPE == STATFS_OSF1
typedef struct statfs statfs_t;
#else
# include <sys/vfs.h>
--- src/filesys-os.c 1998/04/24 14:35:12 1.1
+++ src/filesys-os.c 1998/04/24 14:38:58
@@ -51,7 +51,9 @@
#if FSI_TYPE == FSI_GETFSSTAT
static struct statfs *mnt = NULL;
+#if !defined(NETBSD)
typedef u_long ulong;
+#endif /* !NetBSD */
#endif /* FSI_GETFSSTAT */
#if FSI_TYPE == FSI_MNTCTL
@@ -179,6 +181,16 @@
if (mnt->f_flags & M_RDONLY)
mntstruct.me_flags |= MEFLAG_READONLY;
#endif
+#if defined(NETBSD)
+ if (strcmp(mnt->f_fstypename, MOUNT_NFS)) {
+ (void) sprintf(remote_dev, "%s", mnt->f_mntfromname);
+ mntstruct.me_path = remote_dev;
+ mntstruct.me_type = METYPE_NFS;
+ } else {
+ mntstruct.me_path = mnt->f_mntonname;
+ mntstruct.me_type = METYPE_OTHER;
+ }
+#else
switch ((ulong)((struct statfs*)mnt)->f_type) {
case MOUNT_NFS:
(void) sprintf(remote_dev, "%s", mnt->f_mntfromname);
@@ -190,6 +202,7 @@
mntstruct.me_type = METYPE_OTHER;
break;
}
+#endif /* !NetBSD */
mnt++;
entries_left--;
--- src/setargs.c 1998/04/24 14:40:02 1.1
+++ src/setargs.c 1998/04/24 14:41:06
@@ -130,7 +130,11 @@
/*
* Stdarg front-end to _setproctitle()
*/
+#if defined(NETBSD)
+extern void setproctitle(const char *fmt, ...)
+#else
extern void setproctitle(char *fmt, ...)
+#endif
{
static char buf[BUFSIZ];
va_list args;
--- /dev/null Fri Apr 24 09:44:17 1998
+++ config/mf.netbsd131 Fri Apr 24 15:43:50 1998
@@ -0,0 +1,56 @@
+#
+# Copyright (c) 1993 Michael A. Cooper
+# Copyright (c) 1993 Regents of the University of California.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# 3. All advertising materials mentioning features or use of this software
+# must display the following acknowledgement:
+# This product includes software developed by the University of
+# California, Berkeley and its contributors.
+# 4. Neither the name of the University nor the names of its contributors
+# may be used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+#
+
+#
+# NetBSD 1.3.1 Makefile
+#
+
+#
+# Functions that are missing in this OS are contained in the
+# files specified in ${MISSINGOBJS}.
+#
+#MISSINGOBJS = $(O)strerror.o $(O)strcasecmp.o
+
+#
+# System libraries that we need to load.
+#
+LIB_SYS = -lcompat
+
+#
+# System dependent options for compiling
+#
+#CFLAGS_OS =
+
+BIN_DIR = /usr/local/bin
--- /dev/null Fri Apr 24 09:44:17 1998
+++ config/os-netbsd131.h Fri Apr 24 15:55:44 1998
@@ -0,0 +1,156 @@
+/*
+ * Copyright (c) 1993 Michael A. Cooper
+ * Copyright (c) 1993 Regents of the University of California.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+/*
+ * Original Id: os-freebsd2.h,v 1.2 1996/02/15 18:53:48 mcooper Exp
+ */
+
+/*
+ * TEMPLATE os-*.h file
+ */
+
+/*
+ * Define the following name for use in #ifdef's.
+ * The value should be all upper-case with no periods (.).
+ */
+#if !defined(NETBSD)
+#define NETBSD
+#endif
+
+/*
+ * NOTE: NetBSD uses 64-bit file size semantics, and so you
+ * must be careful when using varargs-type functions
+ * like the *printf family when printing elements which
+ * might be 64-bits (such as stat->st_size from stat.h).
+ */
+
+/*
+ * Set process args to messages that show up when running ps(1)
+ *
+ * Under some OS's, the SETARGS code will cause ": is not an identifier"
+ * errors for "special" commands.
+ */
+#define SETARGS
+
+/*
+ * Define the type of directory routines your system has.
+ */
+#define DIR_TYPE DIR_DIRENT
+
+/*
+ * Determine what routines we have to get filesystem info.
+ */
+#define FSI_TYPE FSI_GETFSSTAT
+
+/*
+ * Type of non-blocking I/O.
+ */
+#define NBIO_TYPE NBIO_FCNTL
+
+/*
+ * Type of wait() function to use.
+ */
+#define WAIT_TYPE WAIT_WAIT3
+
+/*
+ * Type of argument passed to wait() (above).
+ */
+#define WAIT_ARG_TYPE int
+
+/*
+ * Select the type of executable file format.
+ */
+#define EXE_TYPE EXE_AOUT
+
+/*
+ * Select the type of statfs() system call (if any).
+ */
+#define STATFS_TYPE STATFS_BSD
+
+/*
+ * Type of arg functions we have.
+ */
+#define ARG_TYPE ARG_STDARG
+
+/*
+ * UID argument type for chown()
+ */
+typedef uid_t CHOWN_UID_T;
+
+/*
+ * GID argument type for chown()
+ */
+typedef gid_t CHOWN_GID_T;
+
+/*
+ * Our types, usually these are uid_t and gid_t.
+ */
+typedef uid_t UID_T; /* Must be signed */
+typedef gid_t GID_T; /* Must be signed */
+
+/*
+ * Generic pointer, used by memcpy, malloc, etc. Usually char or void.
+ */
+typedef void POINTER;
+
+/*
+ * Type of set file time function available
+ */
+#define SETFTIME_TYPE SETFTIME_UTIMES
+
+/*
+ * Type of set line buffering function available
+ */
+#define SETBUF_TYPE SETLINEBUF
+
+/*
+ * Things we have
+ */
+#define HAVE_FCHOWN /* Have fchown() */
+#define HAVE_FCHMOD /* Have fchmod() */
+#define HAVE_SELECT /* Have select() */
+#define HAVE_SAVED_IDS /* Have POSIX style saved [ug]id's */
+#define POSIX_SIGNALS /* Have POSIX signals */
+
+/*
+ * Things we need
+ */
+#define NEED_UNISTD_H /* Need <unistd.h> */
+
+/*
+ * Path to the remote shell command.
+ * Define this only if the pathname is different than
+ * that which appears in "include/paths.h".
+ */
+#define _PATH_REMSH "/usr/bin/rsh" /**/
--- src/message.c 1998/04/24 14:59:28 1.1
+++ src/message.c 1998/04/24 15:02:47
@@ -467,10 +467,21 @@
(void) sprintf(tempfile, "%s/%s", cp, _RDIST_TMP);
msgfac->mf_filename = tempfile;
+#if defined(NETBSD)
+ {
+ int fd;
+
+ if ((fd = mkstemp(msgfac->mf_filename)) < 0 ||
+ (msgfac->mf_fptr = fdopen(fd, "w")) == NULL)
+ fatalerr("Cannot open notify file for writing: %s: %s.",
+ msgfac->mf_filename, SYSERR);
+ }
+#else
(void) mktemp(msgfac->mf_filename);
if ((msgfac->mf_fptr = fopen(msgfac->mf_filename, "w"))==NULL)
fatalerr("Cannot open notify file for writing: %s: %s.",
msgfac->mf_filename, SYSERR);
+#endif
debugmsg(DM_MISC, "Created notify temp file '%s'",
msgfac->mf_filename);
}
--- mf/Makefile.var 1998/04/24 15:38:29 1.1
+++ mf/Makefile.var 1998/04/24 15:43:39
@@ -172,6 +172,7 @@
config/mf.mipsos4 \
config/mf.mipsos5 \
config/mf.ncr \
+ config/mf.netbsd131 \
config/mf.nextstep2 \
config/mf.nextstep3 \
config/mf.osf1 \
@@ -214,6 +215,7 @@
config/os-mipsos4.h \
config/os-mipsos5.h \
config/os-ncr.h \
+ config/os-netbsd131.h \
config/os-nextstep2.h \
config/os-nextstep3.h \
config/os-osf1.h \
--- Makefile.local 1998/04/24 15:38:29 1.1
+++ Makefile.local 1998/04/24 15:43:39
@@ -8,7 +8,9 @@
# BIN_DIR variable, you would uncomment the following line
# or add your own line.
#
-#BIN_DIR = /usr/bin
+BIN_DIR= ${PREFIX}/bin
+
+CLIENT= ${RDIST6_NAME}
#
# Add any local definitions you want pass to the compiler to DEFS_LOCAL
@@ -28,6 +30,7 @@
#
#OPT = -O
#OPT =
+OPT= -O
#
# You may want to use your own C Compiler (such as GCC) by enabling
@@ -45,8 +48,8 @@
#
# Site specific Man Page configuration.
#
-#MAN_1_DIR = /usr/local/man/man1
-#MAN_8_DIR = /usr/local/man/man8
+MAN_1_DIR = ${PREFIX}/man/man1
+MAN_8_DIR = ${PREFIX}/man/man8
#MAN_OWNER = bin
#MAN_GROUP = bin
#MAN_MODE = 644
|