home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / misc / volume41 / wwfs / part18 < prev    next >
Encoding:
Text File  |  1994-01-17  |  88.8 KB  |  2,976 lines

  1. Newsgroups: comp.sources.misc
  2. From: youki-k@is.aist-nara.ac.jp (Youki Kadobayashi)
  3. Subject: v41i103:  wwfs - WorldWide File System, Part18/22
  4. Message-ID: <1994Jan17.202522.20511@sparky.sterling.com>
  5. X-Md4-Signature: 6db4256a3643bc73b76da3896a133086
  6. Sender: kent@sparky.sterling.com (Kent Landfield)
  7. Organization: Nara Institute of Science and Technology, Japan
  8. Date: Mon, 17 Jan 1994 20:25:22 GMT
  9. Approved: kent@sparky.sterling.com
  10.  
  11. Submitted-by: youki-k@is.aist-nara.ac.jp (Youki Kadobayashi)
  12. Posting-number: Volume 41, Issue 103
  13. Archive-name: wwfs/part18
  14. Environment: UNIX, inet
  15.  
  16. #! /bin/sh
  17. # This is a shell archive.  Remove anything before this line, then feed it
  18. # into a shell via "sh file" or similar.  To overwrite existing files,
  19. # type "sh file -c".
  20. # Contents:  Makefile.com Makefile.top config/misc-hpux.h
  21. #   config/mtab_aix.c config/mtab_bsd.c config/mtab_ultrix.c
  22. #   config/os-aux.h config/os-dgux.h config/os-irix3.h
  23. #   config/os-newsos4.h config/os-osf1.h config/os-riscos4.h
  24. #   config/os-sos4.h config/os-xinu43.h csd/pol.c csd/thrd.c
  25. #   csd/trace.c gtr/dig.pl gtr/gtr.txt libww/libww.h
  26. #   mosaic/urlrename.pl rpc/nfs_prot_svc.c
  27. # Wrapped by kent@sparky on Sun Jan 16 17:48:39 1994
  28. PATH=/bin:/usr/bin:/usr/ucb:/usr/local/bin:/usr/lbin:$PATH ; export PATH
  29. echo If this archive is complete, you will see the following message:
  30. echo '          "shar: End of archive 18 (of 22)."'
  31. if test -f 'Makefile.com' -a "${1}" != "-c" ; then 
  32.   echo shar: Will not clobber existing file \"'Makefile.com'\"
  33. else
  34.   echo shar: Extracting \"'Makefile.com'\" \(3634 characters\)
  35.   sed "s/^X//" >'Makefile.com' <<'END_OF_FILE'
  36. X#
  37. X# Makefile.com for Worldwide File System.
  38. X#
  39. X# Author:    Youki Kadobayashi, Osaka University, Japan
  40. X#        E-mail: <youki@wide.ad.jp>
  41. X#
  42. X# 
  43. X# WorldWide File System
  44. X# Copyright (c) 1992,1993 Youki Kadobayashi
  45. X# Copyright (c) 1992,1993 Osaka University
  46. X# All rights reserved.
  47. X#
  48. X# Permission to use, copy, modify and distribute this software and its
  49. X# documentation is hereby granted, provided that the following conditions
  50. X# are met:
  51. X# 1. Both the copyright notice and this permission notice appear in
  52. X#    all copies of the software, derivative works or modified versions,
  53. X#    and any portions thereof, and that both notices appear in
  54. X#    supporting documentation.
  55. X# 2. All advertising materials mentioning features or use of this software
  56. X#    must display the following acknowledgement:
  57. X#      This product includes software developed by the Osaka University
  58. X#      and its contributors.
  59. X# 3. Neither the name of the University nor the names of its contributors
  60. X#    may be used to endorse or promote products derived from this software
  61. X#    without specific prior written permission.
  62. X#
  63. X# THIS SOFTWARE IS PROVIDED BY THE DEVELOPER ``AS IS'' AND OSAKA
  64. X# UNIVERSITY DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY DAMAGES
  65. X# WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
  66. X#
  67. X# Osaka University requests users of this software to return to
  68. X#
  69. X#  Youki Kadobayashi
  70. X#  Department of Information and Computer Sciences
  71. X#  Osaka University, Toyonaka 560, Osaka, Japan
  72. X#
  73. X# any improvements or extensions that they make and grant Osaka
  74. X# University the rights to redistribute these changes.
  75. X
  76. X# $Header: Makefile.com[109.2] Thu Dec 16 20:38:07 1993 youki-k@is.aist-nara.ac.jp saved $
  77. X#
  78. X
  79. X#
  80. X# -------- Users may care to override these values --------
  81. X#
  82. X# Any of these values can be overridden by redefining them
  83. X# in a file called config/Makefile.local or config/Makefile.local.foo
  84. X# (where "foo" is the OS name)
  85. X#
  86. X
  87. X# Full pathname of where to install wwmount, wwumount
  88. XETCDIR = /usr/local/etc
  89. X
  90. X# Full pathname of where to install libraries (e.g., libww.a)
  91. XLIBDIR= /usr/local/lib
  92. X
  93. X# Full pathname of where to install header files (e.g., libww.h)
  94. XINCDIR= /usr/local/include
  95. X
  96. X# Installed files are owned by this group.
  97. XGROUP = daemon
  98. X
  99. X# How to install binaries
  100. XINSTBIN = install -o wwfs -g $(GROUP) -c -m 755
  101. X# How to install header files, documents, libraries etc.
  102. XINSTALL = install -o wwfs -g $(GROUP) -c -m 644
  103. X
  104. X# Your favorite C compiler
  105. XCC = cc
  106. X
  107. X# Use -O for production use; use -g otherwise.
  108. XCCOPTS = -O
  109. X
  110. X# This space for rent :-)
  111. XDEBUG =
  112. X
  113. X# Define RPCINC if you have RPC header files in non-standard places
  114. XRPCINC =
  115. X
  116. X# Define RPCGEN as the name of your "rpcgen" program
  117. XRPCGEN = rpcgen
  118. X
  119. X# Your friendly printer
  120. XPRINTER=ls4pa
  121. X
  122. X# For old makes
  123. XSHELL = /bin/sh
  124. X
  125. X# -------- YOU SHOULD NOT NEED TO CHANGE ANYTHING BELOW THIS LINE --------
  126. X
  127. XOS_HDR = os-$(OS).h
  128. XOSDEF = -DOS_HDR=\"$(OS_HDR)\"
  129. XCFLAGS = $(CCOPTS) $(DEBUG) $(OSDEF) $(RPCINC) -I../rpc -I../config -I../include -I.
  130. X
  131. XSTAGE=        beta
  132. XGEN=        109
  133. XREV=        4
  134. XVERSION=    $(STAGE)-$(GEN).$(REV)
  135. X
  136. Xbaseline::
  137. X    -save -f -lock -q -m "$(STAGE)$(GEN) baseline" \
  138. X    -setvnum $(GEN).$(REV) `/bin/csh -c "echo *.[chlyx] *.{sh,pl,el,tcl,conf,vol,txt,tex,ps,eps} Makefile* README*; cat AtFS-files"`
  139. X
  140. Xcopyright::
  141. X    -vattr copyright="^$(TOP)/$(STAGE)/Copyright" `vl -lastsaved`
  142. X    -vattr copyright_el="^$(TOP)/$(STAGE)/Copyright.el" `vl -lastsaved`
  143. X    -vattr copyright_mk="^$(TOP)/$(STAGE)/Copyright.mk" `vl -lastsaved`
  144. X
  145. Xversion::
  146. X    -save -lock -q `/bin/csh -c "echo *.[chlyx] *.{sh,pl,el,tcl,conf,vol,txt,tex,ps,eps} Makefile* README*; cat AtFS-files"`
  147. X
  148. Xprint::
  149. X    vgrind -t $(FILE) | lpr -P$(PRINTER)
  150. X
  151. Xclean::
  152. X    -rm -f *~ *.o
  153. X
  154. END_OF_FILE
  155.   if test 3634 -ne `wc -c <'Makefile.com'`; then
  156.     echo shar: \"'Makefile.com'\" unpacked with wrong size!
  157.   fi
  158.   # end of 'Makefile.com'
  159. fi
  160. if test -f 'Makefile.top' -a "${1}" != "-c" ; then 
  161.   echo shar: Will not clobber existing file \"'Makefile.top'\"
  162. else
  163.   echo shar: Extracting \"'Makefile.top'\" \(3511 characters\)
  164.   sed "s/^X//" >'Makefile.top' <<'END_OF_FILE'
  165. X#
  166. X# Makefile.top for Worldwide File System.
  167. X#
  168. X# Author:    Youki Kadobayashi, Osaka University, Japan
  169. X#        E-mail: <youki@wide.ad.jp>
  170. X#
  171. X# 
  172. X# WorldWide File System
  173. X# Copyright (c) 1992,1993 Youki Kadobayashi
  174. X# Copyright (c) 1992,1993 Osaka University
  175. X# All rights reserved.
  176. X#
  177. X# Permission to use, copy, modify and distribute this software and its
  178. X# documentation is hereby granted, provided that the following conditions
  179. X# are met:
  180. X# 1. Both the copyright notice and this permission notice appear in
  181. X#    all copies of the software, derivative works or modified versions,
  182. X#    and any portions thereof, and that both notices appear in
  183. X#    supporting documentation.
  184. X# 2. All advertising materials mentioning features or use of this software
  185. X#    must display the following acknowledgement:
  186. X#      This product includes software developed by the Osaka University
  187. X#      and its contributors.
  188. X# 3. Neither the name of the University nor the names of its contributors
  189. X#    may be used to endorse or promote products derived from this software
  190. X#    without specific prior written permission.
  191. X#
  192. X# THIS SOFTWARE IS PROVIDED BY THE DEVELOPER ``AS IS'' AND OSAKA
  193. X# UNIVERSITY DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY DAMAGES
  194. X# WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
  195. X#
  196. X# Osaka University requests users of this software to return to
  197. X#
  198. X#  Youki Kadobayashi
  199. X#  Department of Information and Computer Sciences
  200. X#  Osaka University, Toyonaka 560, Osaka, Japan
  201. X#
  202. X# any improvements or extensions that they make and grant Osaka
  203. X# University the rights to redistribute these changes.
  204. X
  205. X# $Header: Makefile.top[109.0] Wed Nov 24 03:46:29 1993 youki-k@is.aist-nara.ac.jp saved $
  206. X#
  207. X
  208. X# -------- Users may care to override these values --------
  209. X
  210. X# Machine architecture
  211. XARCH = `PATH=$${PATH}:. /bin/sh $(TOP)/config/arch.sh`
  212. X
  213. X# OS Name
  214. XOS = `PATH=$${PATH}:. /bin/sh $(TOP)/config/os-type.sh`
  215. X
  216. X# version of make
  217. XMake = make
  218. XMAK  = $(Make) Make="$(Make)"
  219. XMKARGS = -f $(TOP)/Makefile.com
  220. XSHELL = /bin/sh
  221. X# for HP-UX with bash
  222. X# SHELL = /bin/bash
  223. X
  224. X# -------- You should leave the rest alone! --------
  225. X
  226. XOS_SUPPORTED = \
  227. X    bsd386 bsd44 hpux irix4 newsos4 next riscos4 sos4 u4_2 \
  228. X    uniosb luna2M luna88k osf1
  229. XCHECK_OS = \
  230. X    case " $(OS_SUPPORTED) " in *" $${OS} "*) ;; \
  231. X    *) case "$${OS}" in unknown);; *) echo "Unknown OS '$${OS}'";; esac; \
  232. X       echo "OS should be one of $(OS_SUPPORTED)"; \
  233. X       exit 1;; \
  234. X    esac
  235. X
  236. X# definition of Makefile inheritance mechanism
  237. X
  238. Xall clean dist baseline copyright version install install-server install-client alpha beta csd doc libc libww rpc wwget wwmount wwumount index: FRC
  239. X    @CF="$(TOP)/config" OS="$(OS)" ARCH="$(ARCH)" MKARGS="$(MKARGS)"; \
  240. X    $(CHECK_OS); \
  241. X    case "`echo M?kefile.build`" in \
  242. X    Makefile.build) MKARGS="$${MKARGS} -f Makefile.build";; \
  243. X    esac; \
  244. X    case "`echo $${CF}/M?kefile.config`" in \
  245. X    $${CF}/Makefile.config) MKARGS="$${MKARGS} -f $${CF}/Makefile.config";; \
  246. X    esac; \
  247. X    case "`echo $${CF}/M?kefile.$${OS}`" in \
  248. X    $${CF}/Makefile.$${OS}) MKARGS="$${MKARGS} -f $${CF}/Makefile.$${OS}";; \
  249. X    esac; \
  250. X    case "`echo $${CF}/M?kefile.local`" in \
  251. X    $${CF}/Makefile.local) MKARGS="$${MKARGS} -f $${CF}/Makefile.local";; \
  252. X    esac; \
  253. X    case "`echo $${CF}/M?kefile.local.$${OS}`" in \
  254. X    $${CF}/Makefile.local.$${OS}) MKARGS="$${MKARGS} -f $${CF}/Makefile.local.$${OS}";; \
  255. X    esac; \
  256. X    case "`echo $${CF}/c?d.conf`" in \
  257. X    $${CF}/csd.conf) MKARGS="$${MKARGS} -f $${CF}/csd.conf";; \
  258. X    esac; \
  259. X    echo "make $${MKARGS} ARCH=$${ARCH} OS=$${OS} $@"; \
  260. X    $(MAK) $${MKARGS} ARCH=$${ARCH} OS=$${OS} $@
  261. X
  262. XFRC:
  263. END_OF_FILE
  264.   if test 3511 -ne `wc -c <'Makefile.top'`; then
  265.     echo shar: \"'Makefile.top'\" unpacked with wrong size!
  266.   fi
  267.   # end of 'Makefile.top'
  268. fi
  269. if test -f 'config/misc-hpux.h' -a "${1}" != "-c" ; then 
  270.   echo shar: Will not clobber existing file \"'config/misc-hpux.h'\"
  271. else
  272.   echo shar: Extracting \"'config/misc-hpux.h'\" \(3404 characters\)
  273.   sed "s/^X//" >'config/misc-hpux.h' <<'END_OF_FILE'
  274. X/*
  275. X * Copyright (c) 1989 Jan-Simon Pendry
  276. X * Copyright (c) 1989 Imperial College of Science, Technology & Medicine
  277. X * Copyright (c) 1989 The Regents of the University of California.
  278. X * All rights reserved.
  279. X *
  280. X * This code is derived from software contributed to Berkeley by
  281. X * Jan-Simon Pendry at Imperial College, London.
  282. X *
  283. X * Redistribution and use in source and binary forms, with or without
  284. X * modification, are permitted provided that the following conditions
  285. X * are met:
  286. X * 1. Redistributions of source code must retain the above copyright
  287. X *    notice, this list of conditions and the following disclaimer.
  288. X * 2. Redistributions in binary form must reproduce the above copyright
  289. X *    notice, this list of conditions and the following disclaimer in the
  290. X *    documentation and/or other materials provided with the distribution.
  291. X * 3. All advertising materials mentioning features or use of this software
  292. X *    must display the following acknowledgement:
  293. X *      This product includes software developed by the University of
  294. X *      California, Berkeley and its contributors.
  295. X * 4. Neither the name of the University nor the names of its contributors
  296. X *    may be used to endorse or promote products derived from this software
  297. X *    without specific prior written permission.
  298. X *
  299. X * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  300. X * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  301. X * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  302. X * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  303. X * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  304. X * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  305. X * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  306. X * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  307. X * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  308. X * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  309. X * SUCH DAMAGE.
  310. X *
  311. X *    %W% (Berkeley) %G%
  312. X *
  313. X * $Id: misc-hpux.h,v 5.2.2.1 1992/02/09 15:10:24 jsp beta $
  314. X *
  315. X */
  316. X
  317. X/*
  318. X * These definitions are from <nfs/nfs.h>
  319. X * Unfortunately, that file cannot be included
  320. X * because it contains lots of structure definitions
  321. X * that are not wanted (they produce name clashes).
  322. X * Isn't HP-UX wonderful!
  323. X */
  324. X
  325. X/*
  326. X * HP-UX specific definitions
  327. X */
  328. Xstruct nfs_args {
  329. X    struct sockaddr_in    *addr;        /* file server address */
  330. X    fhandle_t        *fh;        /* File handle to be mounted */
  331. X    int            flags;        /* flags */
  332. X    int            wsize;        /* write size in bytes */
  333. X    int            rsize;        /* read size in bytes */
  334. X    int            timeo;        /* initial timeout in .1 secs */
  335. X    int            retrans;    /* times to retry send */
  336. X    char            *hostname;    /* server's name */
  337. X#ifdef __hp9000s700 /* XXX for HPUX 8.0 */
  338. X    char            *fsname;    /* server's filesystem name */
  339. X#endif
  340. X};
  341. X
  342. X/*
  343. X * NFS mount option flags
  344. X */
  345. X#define    NFSMNT_SOFT    0x001    /* soft mount (hard is default) */
  346. X#define    NFSMNT_WSIZE    0x002    /* set write size */
  347. X#define    NFSMNT_RSIZE    0x004    /* set read size */
  348. X#define    NFSMNT_TIMEO    0x008    /* set initial timeout */
  349. X#define    NFSMNT_RETRANS    0x010    /* set number of request retrys */
  350. X#define    NFSMNT_HOSTNAME    0x020    /* set hostname for error printf */
  351. X#define    NFSMNT_INT    0x040    /* set option to have interruptable mounts */
  352. X#define    NFSMNT_NODEVS   0x080   /* turn off device file access (default on) */
  353. END_OF_FILE
  354.   if test 3404 -ne `wc -c <'config/misc-hpux.h'`; then
  355.     echo shar: \"'config/misc-hpux.h'\" unpacked with wrong size!
  356.   fi
  357.   # end of 'config/misc-hpux.h'
  358. fi
  359. if test -f 'config/mtab_aix.c' -a "${1}" != "-c" ; then 
  360.   echo shar: Will not clobber existing file \"'config/mtab_aix.c'\"
  361. else
  362.   echo shar: Extracting \"'config/mtab_aix.c'\" \(3882 characters\)
  363.   sed "s/^X//" >'config/mtab_aix.c' <<'END_OF_FILE'
  364. X/*
  365. X * Copyright (c) 1990 Jan-Simon Pendry
  366. X * Copyright (c) 1990 Imperial College of Science, Technology & Medicine
  367. X * Copyright (c) 1990 The Regents of the University of California.
  368. X * All rights reserved.
  369. X *
  370. X * This code is derived from software contributed to Berkeley by
  371. X * Jan-Simon Pendry at Imperial College, London.
  372. X *
  373. X * Redistribution and use in source and binary forms, with or without
  374. X * modification, are permitted provided that the following conditions
  375. X * are met:
  376. X * 1. Redistributions of source code must retain the above copyright
  377. X *    notice, this list of conditions and the following disclaimer.
  378. X * 2. Redistributions in binary form must reproduce the above copyright
  379. X *    notice, this list of conditions and the following disclaimer in the
  380. X *    documentation and/or other materials provided with the distribution.
  381. X * 3. All advertising materials mentioning features or use of this software
  382. X *    must display the following acknowledgement:
  383. X *      This product includes software developed by the University of
  384. X *      California, Berkeley and its contributors.
  385. X * 4. Neither the name of the University nor the names of its contributors
  386. X *    may be used to endorse or promote products derived from this software
  387. X *    without specific prior written permission.
  388. X *
  389. X * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  390. X * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  391. X * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  392. X * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  393. X * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  394. X * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  395. X * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  396. X * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  397. X * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  398. X * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  399. X * SUCH DAMAGE.
  400. X *
  401. X *    %W% (Berkeley) %G%
  402. X *
  403. X * $Id: mtab_aix.c,v 5.2.2.1 1992/02/09 15:10:07 jsp beta $
  404. X *
  405. X */
  406. X
  407. X#include "am.h"
  408. X
  409. X#ifdef READ_MTAB_AIX3_STYLE
  410. X
  411. X#include <sys/mntctl.h>
  412. X#include <sys/vmount.h>
  413. X
  414. Xstatic struct mntent *mnt_dup(mp)
  415. Xstruct vmount *mp;
  416. X{
  417. X    struct mntent *new_mp = ALLOC(mntent);
  418. X
  419. X    char *ty;
  420. X    new_mp->mnt_fsname = strdup(vmt2dataptr(mp, VMT_OBJECT));
  421. X    new_mp->mnt_dir = strdup(vmt2dataptr(mp, VMT_STUB));
  422. X    new_mp->mnt_opts = strdup(vmt2dataptr(mp, VMT_ARGS));
  423. X    switch (mp->vmt_gfstype) {
  424. X    case MNT_JFS:  ty = MTAB_TYPE_UFS; break;
  425. X    case MNT_NFS:
  426. X        ty = MTAB_TYPE_NFS;
  427. X        new_mp->mnt_fsname = str3cat(new_mp->mnt_fsname,
  428. X                vmt2dataptr(mp, VMT_HOSTNAME),
  429. X                ":", new_mp->mnt_fsname);
  430. X        break;
  431. X    default:  ty = "unknown"; break;
  432. X    }
  433. X    new_mp->mnt_type = strdup(ty);
  434. X    new_mp->mnt_passno = mp->vmt_vfsnumber;
  435. X    new_mp->mnt_freq = 0;
  436. X
  437. X    return new_mp;
  438. X}
  439. X
  440. X/*
  441. X * Read a mount table into memory
  442. X */
  443. Xmntlist *read_mtab(fs)
  444. Xchar *fs;
  445. X{
  446. X    mntlist **mpp, *mhp;
  447. X
  448. X    int i;
  449. X    char *mntinfo = 0, *cp;
  450. X    struct vmount *vp;
  451. X    int ret;
  452. X
  453. X    /*
  454. X     * First figure out size of mount table
  455. X     * and allocate space for a copy...
  456. X     * Then get mount table for real.
  457. X     */
  458. X    ret = mntctl(MCTL_QUERY, sizeof(i), &i);
  459. X    if (ret == 0) {
  460. X        mntinfo = xmalloc(i);
  461. X        ret = mntctl(MCTL_QUERY, i, mntinfo);
  462. X    }
  463. X
  464. X    if (ret <= 0) {
  465. X        plog(XLOG_ERROR, "mntctl: %m");
  466. X        goto out;
  467. X    }
  468. X#ifdef DEBUG
  469. X    /*dlog("mntctl returns %d structures", ret);*/
  470. X#endif /* DEBUG */
  471. X
  472. X    mpp = &mhp;
  473. X    for (i = 0, cp = mntinfo; i < ret; i++, cp += vp->vmt_length) {
  474. X        vp = (struct vmount *) cp;
  475. X
  476. X        /*
  477. X         * Allocate a new slot
  478. X         */
  479. X        *mpp = ALLOC(mntlist);
  480. X
  481. X        /*
  482. X         * Copy the data returned by mntctl
  483. X         */
  484. X        (*mpp)->mnt = mnt_dup(vp);
  485. X
  486. X        /*
  487. X         * Move to next pointer
  488. X         */
  489. X        mpp = &(*mpp)->mnext;
  490. X    }
  491. X
  492. X    *mpp = 0;
  493. X
  494. Xout:
  495. X    if (mntinfo)
  496. X        free(mntinfo);
  497. X    return mhp;
  498. X}
  499. X
  500. X#endif /* READ_MTAB_AIX3_STYLE */
  501. END_OF_FILE
  502.   if test 3882 -ne `wc -c <'config/mtab_aix.c'`; then
  503.     echo shar: \"'config/mtab_aix.c'\" unpacked with wrong size!
  504.   fi
  505.   # end of 'config/mtab_aix.c'
  506. fi
  507. if test -f 'config/mtab_bsd.c' -a "${1}" != "-c" ; then 
  508.   echo shar: Will not clobber existing file \"'config/mtab_bsd.c'\"
  509. else
  510.   echo shar: Extracting \"'config/mtab_bsd.c'\" \(3342 characters\)
  511.   sed "s/^X//" >'config/mtab_bsd.c' <<'END_OF_FILE'
  512. X/*
  513. X * Copyright (c) 1990 Jan-Simon Pendry
  514. X * Copyright (c) 1990 Imperial College of Science, Technology & Medicine
  515. X * Copyright (c) 1990 The Regents of the University of California.
  516. X * All rights reserved.
  517. X *
  518. X * This code is derived from software contributed to Berkeley by
  519. X * Jan-Simon Pendry at Imperial College, London.
  520. X *
  521. X * Redistribution and use in source and binary forms, with or without
  522. X * modification, are permitted provided that the following conditions
  523. X * are met:
  524. X * 1. Redistributions of source code must retain the above copyright
  525. X *    notice, this list of conditions and the following disclaimer.
  526. X * 2. Redistributions in binary form must reproduce the above copyright
  527. X *    notice, this list of conditions and the following disclaimer in the
  528. X *    documentation and/or other materials provided with the distribution.
  529. X * 3. All advertising materials mentioning features or use of this software
  530. X *    must display the following acknowledgement:
  531. X *      This product includes software developed by the University of
  532. X *      California, Berkeley and its contributors.
  533. X * 4. Neither the name of the University nor the names of its contributors
  534. X *    may be used to endorse or promote products derived from this software
  535. X *    without specific prior written permission.
  536. X *
  537. X * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  538. X * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  539. X * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  540. X * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  541. X * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  542. X * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  543. X * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  544. X * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  545. X * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  546. X * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  547. X * SUCH DAMAGE.
  548. X *
  549. X *    %W% (Berkeley) %G%
  550. X *
  551. X * $Id: mtab_bsd.c,v 5.2.2.1 1992/02/09 15:10:13 jsp beta $
  552. X *
  553. X */
  554. X
  555. X#include "am.h"
  556. X
  557. X#ifdef READ_MTAB_BSD_STYLE
  558. X
  559. X#include <sys/mount.h>
  560. X
  561. Xstatic struct mntent *mnt_dup(mp)
  562. Xstruct statfs *mp;
  563. X{
  564. X    struct mntent *new_mp = ALLOC(mntent);
  565. X    char *ty;
  566. X
  567. X    new_mp->mnt_fsname = strdup(mp->f_mntfromname);
  568. X    new_mp->mnt_dir = strdup(mp->f_mntonname);
  569. X    switch (mp->f_type) {
  570. X    case MOUNT_UFS:  ty = MTAB_TYPE_UFS; break;
  571. X    case MOUNT_NFS:  ty = MTAB_TYPE_NFS; break;
  572. X    case MOUNT_MFS:  ty = MTAB_TYPE_MFS; break;
  573. X    default:  ty = "unknown"; break;
  574. X    }
  575. X    new_mp->mnt_type = strdup(ty);
  576. X    new_mp->mnt_opts = strdup("unset");
  577. X    new_mp->mnt_freq = 0;
  578. X    new_mp->mnt_passno = 0;
  579. X
  580. X    return new_mp;
  581. X}
  582. X
  583. X/*
  584. X * Read a mount table into memory
  585. X */
  586. Xmntlist *read_mtab(fs)
  587. Xchar *fs;
  588. X{
  589. X    mntlist **mpp, *mhp;
  590. X    struct statfs *mntbufp, *mntp;
  591. X
  592. X    int nloc = getmntinfo(&mntbufp, MNT_NOWAIT);
  593. X
  594. X    if (nloc == 0) {
  595. X        plog(XLOG_ERROR, "Can't read mount table");
  596. X        return 0;
  597. X    }
  598. X
  599. X    mpp = &mhp;
  600. X    for (mntp = mntbufp; mntp < mntbufp + nloc; mntp++) {
  601. X        /*
  602. X         * Allocate a new slot
  603. X         */
  604. X        *mpp = ALLOC(mntlist);
  605. X
  606. X        /*
  607. X         * Copy the data returned by getmntent
  608. X         */
  609. X        (*mpp)->mnt = mnt_dup(mntp);
  610. X
  611. X        /*
  612. X         * Move to next pointer
  613. X         */
  614. X        mpp = &(*mpp)->mnext;
  615. X    }
  616. X
  617. X    return mhp;
  618. X}
  619. X
  620. X#endif /* READ_MTAB_BSD_STYLE */
  621. END_OF_FILE
  622.   if test 3342 -ne `wc -c <'config/mtab_bsd.c'`; then
  623.     echo shar: \"'config/mtab_bsd.c'\" unpacked with wrong size!
  624.   fi
  625.   # end of 'config/mtab_bsd.c'
  626. fi
  627. if test -f 'config/mtab_ultrix.c' -a "${1}" != "-c" ; then 
  628.   echo shar: Will not clobber existing file \"'config/mtab_ultrix.c'\"
  629. else
  630.   echo shar: Extracting \"'config/mtab_ultrix.c'\" \(3549 characters\)
  631.   sed "s/^X//" >'config/mtab_ultrix.c' <<'END_OF_FILE'
  632. X/*
  633. X * Copyright (c) 1990 Jan-Simon Pendry
  634. X * Copyright (c) 1990 Imperial College of Science, Technology & Medicine
  635. X * Copyright (c) 1990 The Regents of the University of California.
  636. X * All rights reserved.
  637. X *
  638. X * This code is derived from software contributed to Berkeley by
  639. X * Jan-Simon Pendry at Imperial College, London.
  640. X *
  641. X * Redistribution and use in source and binary forms, with or without
  642. X * modification, are permitted provided that the following conditions
  643. X * are met:
  644. X * 1. Redistributions of source code must retain the above copyright
  645. X *    notice, this list of conditions and the following disclaimer.
  646. X * 2. Redistributions in binary form must reproduce the above copyright
  647. X *    notice, this list of conditions and the following disclaimer in the
  648. X *    documentation and/or other materials provided with the distribution.
  649. X * 3. All advertising materials mentioning features or use of this software
  650. X *    must display the following acknowledgement:
  651. X *      This product includes software developed by the University of
  652. X *      California, Berkeley and its contributors.
  653. X * 4. Neither the name of the University nor the names of its contributors
  654. X *    may be used to endorse or promote products derived from this software
  655. X *    without specific prior written permission.
  656. X *
  657. X * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  658. X * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  659. X * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  660. X * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  661. X * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  662. X * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  663. X * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  664. X * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  665. X * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  666. X * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  667. X * SUCH DAMAGE.
  668. X *
  669. X *    %W% (Berkeley) %G%
  670. X *
  671. X * $Id: mtab_ultrix.c,v 5.2.2.1 1992/02/09 15:10:50 jsp beta $
  672. X *
  673. X */
  674. X
  675. X#include "am.h"
  676. X
  677. X#ifdef READ_MTAB_ULTRIX_STYLE
  678. X
  679. X#include <sys/mount.h>
  680. X#include <sys/fs_types.h>
  681. X
  682. Xstatic struct mntent *mnt_dup(mp)
  683. Xstruct fs_data *mp;
  684. X{
  685. X    struct mntent *new_mp = ALLOC(mntent);
  686. X
  687. X    new_mp->mnt_fsname = strdup(mp->fd_devname);
  688. X    new_mp->mnt_dir = strdup(mp->fd_path);
  689. X        if (mp->fd_fstype >= GT_NUMTYPES)
  690. X                mp->fd_fstype = GT_UNKWN;
  691. X        else if (gt_names[mp->fd_fstype] == 0)
  692. X                mp->fd_fstype = GT_UNKWN;
  693. X        new_mp->mnt_type = strdup(gt_names[mp->fd_fstype]);
  694. X    new_mp->mnt_opts = strdup("unset");
  695. X
  696. X    new_mp->mnt_freq = 0;
  697. X    new_mp->mnt_passno = mp->fd_dev;
  698. X
  699. X    return new_mp;
  700. X}
  701. X
  702. X/*
  703. X * Read a mount table into memory
  704. X */
  705. Xmntlist *read_mtab(fs)
  706. Xchar *fs;
  707. X{
  708. X    mntlist **mpp, *mhp;
  709. X
  710. X/* From: Piete Brooks <pb@cl.cam.ac.uk> */
  711. X
  712. X    int loc=0;
  713. X#undef    NMOUNT
  714. X#define    NMOUNT    20
  715. X    struct fs_data mountbuffer[NMOUNT], *fs_data;
  716. X    int ret;
  717. X
  718. X    mpp = &mhp;
  719. X    while ((ret = getmountent(&loc, mountbuffer, NMOUNT)) > 0) {
  720. X            for (fs_data = mountbuffer; fs_data < &mountbuffer[ret]; fs_data++) {
  721. X            /*
  722. X             * Allocate a new slot
  723. X             */
  724. X            *mpp = ALLOC(mntlist);
  725. X
  726. X            /*
  727. X             * Copy the data returned by getmntent
  728. X             */
  729. X            (*mpp)->mnt = mnt_dup(fs_data);
  730. X
  731. X            /*
  732. X             * Move to next pointer
  733. X             */
  734. X            mpp = &(*mpp)->mnext;
  735. X        }
  736. X    }
  737. X    if (ret < 0) {
  738. X        plog(XLOG_ERROR, "getmountent: %m");
  739. X        return 0;
  740. X    }
  741. X    *mpp = 0;
  742. X
  743. X    return mhp;
  744. X}
  745. X
  746. X#endif /* READ_MTAB_ULTRIX_STYLE */
  747. END_OF_FILE
  748.   if test 3549 -ne `wc -c <'config/mtab_ultrix.c'`; then
  749.     echo shar: \"'config/mtab_ultrix.c'\" unpacked with wrong size!
  750.   fi
  751.   # end of 'config/mtab_ultrix.c'
  752. fi
  753. if test -f 'config/os-aux.h' -a "${1}" != "-c" ; then 
  754.   echo shar: Will not clobber existing file \"'config/os-aux.h'\"
  755. else
  756.   echo shar: Extracting \"'config/os-aux.h'\" \(3620 characters\)
  757.   sed "s/^X//" >'config/os-aux.h' <<'END_OF_FILE'
  758. X/*
  759. X * Copyright (c) 1989 Jan-Simon Pendry
  760. X * Copyright (c) 1989 Imperial College of Science, Technology & Medicine
  761. X * Copyright (c) 1989 The Regents of the University of California.
  762. X * All rights reserved.
  763. X *
  764. X * This code is derived from software contributed to Berkeley by
  765. X * Jan-Simon Pendry at Imperial College, London.
  766. X *
  767. X * Redistribution and use in source and binary forms, with or without
  768. X * modification, are permitted provided that the following conditions
  769. X * are met:
  770. X * 1. Redistributions of source code must retain the above copyright
  771. X *    notice, this list of conditions and the following disclaimer.
  772. X * 2. Redistributions in binary form must reproduce the above copyright
  773. X *    notice, this list of conditions and the following disclaimer in the
  774. X *    documentation and/or other materials provided with the distribution.
  775. X * 3. All advertising materials mentioning features or use of this software
  776. X *    must display the following acknowledgement:
  777. X *      This product includes software developed by the University of
  778. X *      California, Berkeley and its contributors.
  779. X * 4. Neither the name of the University nor the names of its contributors
  780. X *    may be used to endorse or promote products derived from this software
  781. X *    without specific prior written permission.
  782. X *
  783. X * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  784. X * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  785. X * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  786. X * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  787. X * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  788. X * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  789. X * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  790. X * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  791. X * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  792. X * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  793. X * SUCH DAMAGE.
  794. X *
  795. X *    %W% (Berkeley) %G%
  796. X *
  797. X * $Id: os-aux.h,v 5.2.2.1 1992/02/09 15:10:10 jsp beta $
  798. X *
  799. X * A/UX macII definitions for Amd (automounter)
  800. X * Contributed by Julian Onions <jpo@cs.nott.ac.uk>
  801. X */
  802. X
  803. X/*
  804. X * Does the compiler grok void *
  805. X */
  806. X#define    VOIDP
  807. X
  808. X/*
  809. X * Which version of the Sun RPC library we are using
  810. X * This is the implementation release number, not
  811. X * the protocol revision number.
  812. X */
  813. X#define    RPC_3
  814. X
  815. X/*
  816. X * Which version of the NFS interface are we using.
  817. X * This is the implementation release number, not
  818. X * the protocol revision number.
  819. X */
  820. X#define    NFS_3
  821. X
  822. X/*
  823. X * Byte ordering
  824. X */
  825. X#undef ARCH_ENDIAN
  826. X#define    ARCH_ENDIAN    "big"
  827. X
  828. X/*
  829. X * No support for ndbm
  830. X */
  831. X#undef OS_HAS_NDBM
  832. X
  833. X/*
  834. X * Name of filesystem types
  835. X */
  836. X#define    MOUNT_TYPE_UFS    MOUNT_UFS
  837. X#define MOUNT_TYPE_NFS MOUNT_NFS
  838. X
  839. X#undef MTAB_TYPE_UFS
  840. X#define    MTAB_TYPE_UFS    "5.2"
  841. X
  842. X#define SIGCHLD    SIGCLD
  843. X#define    SYS5_SIGNALS
  844. X
  845. X/*
  846. X * Use <fcntl.h> rather than <sys/file.h>
  847. X */
  848. X#define USE_FCNTL
  849. X
  850. X/*
  851. X * Use fcntl() rather than flock()
  852. X */
  853. X#define LOCK_FCNTL
  854. X
  855. X#ifdef __GNUC__
  856. X#define alloca(sz) __builtin_alloca(sz)
  857. X#endif
  858. X
  859. X#define    bzero(ptr, len)    memset(ptr, 0, len)
  860. X#define bcopy(from, to, len) memcpy(to, from, len)
  861. X#define getpagesize() (2048)
  862. X#undef MOUNT_TRAP
  863. X#define MOUNT_TRAP(type, mnt, flags, mnt_data) \
  864. X    fsmount(type, mnt->mnt_dir, flags, mnt_data)
  865. X#undef UNMOUNT_TRAP
  866. X#define    UNMOUNT_TRAP(mnt)    unmount(mnt->mnt_dir)
  867. X#define NFDS    30    /* conservative */
  868. X
  869. X/* not included in sys/param.h */
  870. X#include <sys/types.h>
  871. X/* not part of sys/time.h */
  872. X#include <time.h>
  873. X/* for NMOUNT */
  874. X#include <sys/config.h>
  875. END_OF_FILE
  876.   if test 3620 -ne `wc -c <'config/os-aux.h'`; then
  877.     echo shar: \"'config/os-aux.h'\" unpacked with wrong size!
  878.   fi
  879.   # end of 'config/os-aux.h'
  880. fi
  881. if test -f 'config/os-dgux.h' -a "${1}" != "-c" ; then 
  882.   echo shar: Will not clobber existing file \"'config/os-dgux.h'\"
  883. else
  884.   echo shar: Extracting \"'config/os-dgux.h'\" \(3663 characters\)
  885.   sed "s/^X//" >'config/os-dgux.h' <<'END_OF_FILE'
  886. X/*
  887. X * Copyright (c) 1990 Jan-Simon Pendry
  888. X * Copyright (c) 1990 Imperial College of Science, Technology & Medicine
  889. X * Copyright (c) 1990 The Regents of the University of California.
  890. X * All rights reserved.
  891. X *
  892. X * This code is derived from software contributed to Berkeley by
  893. X * Jan-Simon Pendry at Imperial College, London.
  894. X *
  895. X * Redistribution and use in source and binary forms, with or without
  896. X * modification, are permitted provided that the following conditions
  897. X * are met:
  898. X * 1. Redistributions of source code must retain the above copyright
  899. X *    notice, this list of conditions and the following disclaimer.
  900. X * 2. Redistributions in binary form must reproduce the above copyright
  901. X *    notice, this list of conditions and the following disclaimer in the
  902. X *    documentation and/or other materials provided with the distribution.
  903. X * 3. All advertising materials mentioning features or use of this software
  904. X *    must display the following acknowledgement:
  905. X *      This product includes software developed by the University of
  906. X *      California, Berkeley and its contributors.
  907. X * 4. Neither the name of the University nor the names of its contributors
  908. X *    may be used to endorse or promote products derived from this software
  909. X *    without specific prior written permission.
  910. X *
  911. X * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  912. X * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  913. X * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  914. X * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  915. X * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  916. X * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  917. X * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  918. X * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  919. X * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  920. X * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  921. X * SUCH DAMAGE.
  922. X *
  923. X *    %W% (Berkeley) %G%
  924. X *
  925. X * $Id: os-dgux.h,v 5.2.2.1 1992/02/09 15:10:18 jsp beta $
  926. X *
  927. X * dg/ux definitions for Amd (automounter)
  928. X */
  929. X
  930. X/*
  931. X * Does the compiler grok void *
  932. X */
  933. X#define VOIDP
  934. X
  935. X/*
  936. X * Which version of the Sun RPC library we are using
  937. X * This is the implementation release number, not
  938. X * the protocol revision number.
  939. X */
  940. X#define RPC_4
  941. X
  942. X/*
  943. X * Which version of the NFS interface are we using.
  944. X * This is the implementation release number, not
  945. X * the protocol revision number.
  946. X */
  947. X#define NFS_4
  948. X
  949. X/*
  950. X * Name of filesystem types
  951. X */
  952. X#define MOUNT_TYPE_NFS    "nfs"
  953. X#define MOUNT_TYPE_UFS    "dg/ux"
  954. X#undef MTAB_TYPE_UFS
  955. X#define MTAB_TYPE_UFS    "dg/ux"
  956. X
  957. X/*
  958. X * Need the following in more places than just NFS_HDR
  959. X */
  960. X#include <sys/dg_mount.h>
  961. X/*
  962. X * This is braindead
  963. X * dg/ux has nfs 4.0 but doesn't have the following options
  964. X */
  965. X#define NFSMNT_HOSTNAME 0x0
  966. X#define NFSMNT_INT 0x0
  967. X#define M_NEWTYPE 0
  968. X
  969. X/*
  970. X * DG have their own filesystem.
  971. X */
  972. X#define ufs_args dgux_args
  973. X
  974. X/*
  975. X * Byte ordering
  976. X */
  977. X
  978. X#undef ARCH_ENDIAN
  979. X#define ARCH_ENDIAN "big"
  980. X
  981. X#define _BSD_WAIT_FLAVOR
  982. X#define _BSD_TTY_FLAVOR
  983. X#define _BSD_SIGNAL_FLAVOR
  984. X#define _DGUX_SOURCE
  985. X
  986. X/*
  987. X * Use fcntl() rather than flock()
  988. X */
  989. X#define LOCK_FCNTL
  990. X
  991. X#define bzero(ptr, len) memset(ptr, 0, len)
  992. X#define bcopy(from, to, len) memcpy(to, from, len)
  993. X#undef MOUNT_TRAP
  994. X#define MOUNT_TRAP(type, mnt, flags, mnt_data) \
  995. X    ((struct nfs_args *)mnt_data)->version = !strcmp(type, MOUNT_TYPE_UFS)?\
  996. X         DG_MOUNT_DGUX_VERSION:DG_MOUNT_NFS_VERSION, \
  997. X    dg_mount(type, mnt->mnt_dir, flags, mnt_data)
  998. X#undef UNMOUNT_TRAP
  999. X#define UNMOUNT_TRAP(mnt)    umount(mnt->mnt_dir)
  1000. END_OF_FILE
  1001.   if test 3663 -ne `wc -c <'config/os-dgux.h'`; then
  1002.     echo shar: \"'config/os-dgux.h'\" unpacked with wrong size!
  1003.   fi
  1004.   # end of 'config/os-dgux.h'
  1005. fi
  1006. if test -f 'config/os-irix3.h' -a "${1}" != "-c" ; then 
  1007.   echo shar: Will not clobber existing file \"'config/os-irix3.h'\"
  1008. else
  1009.   echo shar: Extracting \"'config/os-irix3.h'\" \(3915 characters\)
  1010.   sed "s/^X//" >'config/os-irix3.h' <<'END_OF_FILE'
  1011. X/*
  1012. X * Copyright (c) 1990 Jan-Simon Pendry
  1013. X * Copyright (c) 1990 Imperial College of Science, Technology & Medicine
  1014. X * Copyright (c) 1990 The Regents of the University of California.
  1015. X * All rights reserved.
  1016. X *
  1017. X * This code is derived from software contributed to Berkeley by
  1018. X * Jan-Simon Pendry at Imperial College, London.
  1019. X *
  1020. X * Redistribution and use in source and binary forms, with or without
  1021. X * modification, are permitted provided that the following conditions
  1022. X * are met:
  1023. X * 1. Redistributions of source code must retain the above copyright
  1024. X *    notice, this list of conditions and the following disclaimer.
  1025. X * 2. Redistributions in binary form must reproduce the above copyright
  1026. X *    notice, this list of conditions and the following disclaimer in the
  1027. X *    documentation and/or other materials provided with the distribution.
  1028. X * 3. All advertising materials mentioning features or use of this software
  1029. X *    must display the following acknowledgement:
  1030. X *      This product includes software developed by the University of
  1031. X *      California, Berkeley and its contributors.
  1032. X * 4. Neither the name of the University nor the names of its contributors
  1033. X *    may be used to endorse or promote products derived from this software
  1034. X *    without specific prior written permission.
  1035. X *
  1036. X * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  1037. X * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  1038. X * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  1039. X * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  1040. X * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  1041. X * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  1042. X * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  1043. X * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  1044. X * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  1045. X * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  1046. X * SUCH DAMAGE.
  1047. X *
  1048. X *    %W% (Berkeley) %G%
  1049. X *
  1050. X * $Id: os-irix3.h,v 5.2 1992/05/31 16:40:22 jsp Exp $
  1051. X *
  1052. X * IRIX 3.3 definitions for Amd (automounter)
  1053. X * Contributed by Scott R. Presnell <srp@cgl.ucsf.edu>
  1054. X */
  1055. X
  1056. X/*
  1057. X * Does the compiler grok void *
  1058. X */
  1059. X#define VOIDP
  1060. X
  1061. X/*
  1062. X * Which version of the Sun RPC library we are using
  1063. X * This is the implementation release number, not
  1064. X * the protocol revision number.
  1065. X */
  1066. X#define RPC_3
  1067. X
  1068. X/*
  1069. X * Which version of the NFS interface are we using.
  1070. X * This is the implementation release number, not
  1071. X * the protocol revision number.
  1072. X */
  1073. X#define NFS_3
  1074. X
  1075. X/*
  1076. X * Byte ordering
  1077. X */
  1078. X#undef ARCH_ENDIAN
  1079. X#define ARCH_ENDIAN    "big"
  1080. X
  1081. X/*
  1082. X * Has support for syslog()
  1083. X */
  1084. X#define HAS_SYSLOG
  1085. X
  1086. X#define M_GRPID        MS_GRPID
  1087. X#define M_RDONLY    MS_RDONLY
  1088. X/*
  1089. X * Support for ndbm
  1090. X */
  1091. X#define OS_HAS_NDBM
  1092. X
  1093. X#define UPDATE_MTAB
  1094. X
  1095. X#undef    MTAB_TYPE_NFS
  1096. X#define MTAB_TYPE_NFS    "nfs"
  1097. X
  1098. X#undef    MTAB_TYPE_UFS
  1099. X#define MTAB_TYPE_UFS    "efs"
  1100. X
  1101. X#define NMOUNT    40    /* The std sun value */
  1102. X/*
  1103. X * Name of filesystem types
  1104. X */
  1105. X#define MOUNT_TYPE_UFS    sysfs(GETFSIND, FSID_EFS)
  1106. X#define MOUNT_TYPE_NFS    sysfs(GETFSIND, FSID_NFS)
  1107. X
  1108. X#define SYS5_SIGNALS
  1109. X
  1110. X/*
  1111. X * Use <fcntl.h> rather than <sys/file.h>
  1112. X */
  1113. X/*#define USE_FCNTL*/
  1114. X
  1115. X/*
  1116. X * Use fcntl() rather than flock()
  1117. X */
  1118. X/*#define LOCK_FCNTL*/
  1119. X
  1120. X#ifdef __GNUC__
  1121. X#define alloca(sz) __builtin_alloca(sz)
  1122. X#endif
  1123. X
  1124. X#define bzero(ptr, len) memset(ptr, 0, len)
  1125. X#define bcopy(from, to, len) memcpy(to, from, len)
  1126. X
  1127. X#undef MOUNT_TRAP
  1128. X#define MOUNT_TRAP(type, mnt, flags, mnt_data) \
  1129. X    irix_mount(mnt->mnt_fsname, mnt->mnt_dir,flags, type, mnt_data)
  1130. X#undef UNMOUNT_TRAP
  1131. X#define UNMOUNT_TRAP(mnt)    umount(mnt->mnt_dir)
  1132. X#define NFDS    30    /* conservative */
  1133. X
  1134. X#define NFS_HDR "misc-irix.h"
  1135. X#define UFS_HDR "misc-irix.h"
  1136. X
  1137. X/* not included in sys/param.h */
  1138. X#include <sys/types.h>
  1139. X
  1140. X#define MOUNT_HELPER_SOURCE "mount_irix.c"
  1141. X
  1142. X#define    MNTINFO_DEV    "fsid"
  1143. X#define    MNTINFO_PREF    "0x"
  1144. END_OF_FILE
  1145.   if test 3915 -ne `wc -c <'config/os-irix3.h'`; then
  1146.     echo shar: \"'config/os-irix3.h'\" unpacked with wrong size!
  1147.   fi
  1148.   # end of 'config/os-irix3.h'
  1149. fi
  1150. if test -f 'config/os-newsos4.h' -a "${1}" != "-c" ; then 
  1151.   echo shar: Will not clobber existing file \"'config/os-newsos4.h'\"
  1152. else
  1153.   echo shar: Extracting \"'config/os-newsos4.h'\" \(3531 characters\)
  1154.   sed "s/^X//" >'config/os-newsos4.h' <<'END_OF_FILE'
  1155. X/*
  1156. X * Copyright (c) 1989 Jan-Simon Pendry
  1157. X * Copyright (c) 1989 Imperial College of Science, Technology & Medicine
  1158. X * Copyright (c) 1989 The Regents of the University of California.
  1159. X * All rights reserved.
  1160. X *
  1161. X * This code is derived from software contributed to Berkeley by
  1162. X * Jan-Simon Pendry at Imperial College, London.
  1163. X *
  1164. X * Redistribution and use in source and binary forms, with or without
  1165. X * modification, are permitted provided that the following conditions
  1166. X * are met:
  1167. X * 1. Redistributions of source code must retain the above copyright
  1168. X *    notice, this list of conditions and the following disclaimer.
  1169. X * 2. Redistributions in binary form must reproduce the above copyright
  1170. X *    notice, this list of conditions and the following disclaimer in the
  1171. X *    documentation and/or other materials provided with the distribution.
  1172. X * 3. All advertising materials mentioning features or use of this software
  1173. X *    must display the following acknowledgement:
  1174. X *      This product includes software developed by the University of
  1175. X *      California, Berkeley and its contributors.
  1176. X * 4. Neither the name of the University nor the names of its contributors
  1177. X *    may be used to endorse or promote products derived from this software
  1178. X *    without specific prior written permission.
  1179. X *
  1180. X * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  1181. X * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  1182. X * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  1183. X * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  1184. X * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  1185. X * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  1186. X * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  1187. X * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  1188. X * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  1189. X * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  1190. X * SUCH DAMAGE.
  1191. X *
  1192. X *    %W% (Berkeley) %G%
  1193. X *
  1194. X * $Id$
  1195. X *
  1196. X * Sony NEWS-OS 4.[12] definitions for Amd (automounter)
  1197. X */
  1198. X
  1199. X/*
  1200. X * Does the compiler grok void *
  1201. X */
  1202. X#define    VOIDP
  1203. X
  1204. X/*
  1205. X * What type is free(void*) returning?
  1206. X */
  1207. X#undef FREE_RETURN_TYPE
  1208. X#define FREE_RETURN_TYPE    void
  1209. X
  1210. X/*
  1211. X * Which version of the Sun RPC library we are using
  1212. X * This is the implementation release number, not
  1213. X * the protocol revision number.
  1214. X */
  1215. X#define    RPC_4
  1216. X
  1217. X/*
  1218. X * Which version of the NFS interface are we using.
  1219. X * This is the implementation release number, not
  1220. X * the protocol revision number.
  1221. X */
  1222. X#define    NFS_4
  1223. X
  1224. X/*
  1225. X * Does this OS have NDBM support?
  1226. X */
  1227. X#define OS_HAS_NDBM
  1228. X
  1229. X/*
  1230. X * Byte ordering
  1231. X */
  1232. X#ifndef BYTE_ORDER
  1233. X#include <machine/endian.h>
  1234. X#endif /* BYTE_ORDER */
  1235. X
  1236. X#undef ARCH_ENDIAN
  1237. X#if BYTE_ORDER == LITTLE_ENDIAN
  1238. X#define ARCH_ENDIAN "little"
  1239. X#else
  1240. X#if BYTE_ORDER == BIG_ENDIAN
  1241. X#define ARCH_ENDIAN "big"
  1242. X#else
  1243. XXXX - Probably no hope of running Amd on this machine!
  1244. X#endif /* BIG */
  1245. X#endif /* LITTLE */
  1246. X
  1247. X/*
  1248. X * Name of filesystem types
  1249. X */
  1250. X#define MOUNT_TYPE_NFS    "nfs"
  1251. X#define MOUNT_TYPE_UFS    "4.2"
  1252. X
  1253. X/*
  1254. X * Type of a file handle
  1255. X */
  1256. X#undef NFS_FH_TYPE
  1257. X#define    NFS_FH_TYPE    caddr_t
  1258. X
  1259. X/*
  1260. X * Type of filesystem type
  1261. X */
  1262. X#undef MTYPE_TYPE
  1263. X#define    MTYPE_TYPE    char *
  1264. X
  1265. X/*
  1266. X * System Vr4 / SunOS 4.1 compatibility
  1267. X * - put dev= in the options list
  1268. X *
  1269. X * From: Brent Callaghan <brent@eng.sun.com>
  1270. X */
  1271. X#define    MNTINFO_DEV    "dev"
  1272. X#define MNTINFO_PREF    ""
  1273. X
  1274. X/*
  1275. X * prototype for index(), strdup() etc.
  1276. X */
  1277. X#include <strings.h>
  1278. END_OF_FILE
  1279.   if test 3531 -ne `wc -c <'config/os-newsos4.h'`; then
  1280.     echo shar: \"'config/os-newsos4.h'\" unpacked with wrong size!
  1281.   fi
  1282.   # end of 'config/os-newsos4.h'
  1283. fi
  1284. if test -f 'config/os-osf1.h' -a "${1}" != "-c" ; then 
  1285.   echo shar: Will not clobber existing file \"'config/os-osf1.h'\"
  1286. else
  1287.   echo shar: Extracting \"'config/os-osf1.h'\" \(3977 characters\)
  1288.   sed "s/^X//" >'config/os-osf1.h' <<'END_OF_FILE'
  1289. X/*
  1290. X * OSF/1 definitions for Amd (automounter)
  1291. X *
  1292. X * Copyright (c) 1990 Jan-Simon Pendry
  1293. X * Copyright (c) 1990 Imperial College of Science, Technology & Medicine
  1294. X * Copyright (c) 1990 The Regents of the University of California.
  1295. X * (c) Copyright 1990, OPEN SOFTWARE FOUNDATION, INC.
  1296. X * All rights reserved.
  1297. X *
  1298. X * This code is derived from software contributed to Berkeley by
  1299. X * Jan-Simon Pendry at Imperial College, London.
  1300. X *
  1301. X * Redistribution and use in source and binary forms are permitted provided
  1302. X * that: (1) source distributions retain this entire copyright notice and
  1303. X * comment, and (2) distributions including binaries display the following
  1304. X * acknowledgement:  ``This product includes software developed by the
  1305. X * University of California, Berkeley and its contributors'' in the
  1306. X * documentation or other materials provided with the distribution and in
  1307. X * all advertising materials mentioning features or use of this software.
  1308. X * Neither the name of the University nor the names of its contributors may
  1309. X * be used to endorse or promote products derived from this software without
  1310. X * specific prior written permission.
  1311. X * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
  1312. X * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
  1313. X * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  1314. X *
  1315. X * $Id: os-osf1.h,v 5.2.2.1 1992/02/09 15:10:35 jsp beta $
  1316. X *
  1317. X *    %W% (Berkeley) %G%
  1318. X */
  1319. X
  1320. X/*
  1321. X * Does the compiler grok void *
  1322. X */
  1323. X#define    VOIDP
  1324. X
  1325. X/*
  1326. X * Which version of the Sun RPC library we are using
  1327. X * This is the implementation release number, not
  1328. X * the protocol revision number.
  1329. X */
  1330. X#define    RPC_4
  1331. X
  1332. X/*
  1333. X * Which version of the NFS interface are we using.
  1334. X * This is the implementation release number, not
  1335. X * the protocol revision number.
  1336. X */
  1337. X#define    NFS_44
  1338. X
  1339. X/*
  1340. X * Support NFS over TCP?
  1341. X */
  1342. X/*#define HAS_TCP_NFS*/
  1343. X
  1344. X/*
  1345. X * Does this OS have NDBM support?
  1346. X */
  1347. X#define OS_HAS_NDBM
  1348. X
  1349. X/*
  1350. X * The mount table is obtained from the kernel
  1351. X */
  1352. X#undef    UPDATE_MTAB
  1353. X
  1354. X/*
  1355. X * No mntent info on OSF/1
  1356. X */
  1357. X#undef    MNTENT_HDR
  1358. X
  1359. X/*
  1360. X * Name of filesystem types
  1361. X */
  1362. X#define    MOUNT_TYPE_NFS    MOUNT_NFS
  1363. X#define    MOUNT_TYPE_UFS    MOUNT_UFS
  1364. X#undef MTAB_TYPE_UFS
  1365. X#define    MTAB_TYPE_UFS    "ufs"
  1366. X#define    MTAB_TYPE_MFS    "mfs"
  1367. X
  1368. X/*
  1369. X * How to unmount filesystems
  1370. X */
  1371. X#undef UNMOUNT_TRAP
  1372. X#undef NEED_UMOUNT_FS
  1373. X#define NEED_UMOUNT_OSF
  1374. X#undef UMOUNT_FS
  1375. X#define    UMOUNT_FS(dir)    umount_fs(dir)
  1376. X
  1377. X/*
  1378. X * Byte ordering
  1379. X */
  1380. X#ifndef BYTE_ORDER
  1381. X#include <machine/endian.h>
  1382. X#endif /* BYTE_ORDER */
  1383. X
  1384. X#undef ARCH_ENDIAN
  1385. X#if BYTE_ORDER == LITTLE_ENDIAN
  1386. X#define ARCH_ENDIAN "little"
  1387. X#else
  1388. X#if BYTE_ORDER == BIG_ENDIAN
  1389. X#define ARCH_ENDIAN "big"
  1390. X#else
  1391. XXXX - Probably no hope of running Amd on this machine!
  1392. X#endif /* BIG */
  1393. X#endif /* LITTLE */
  1394. X
  1395. X/*
  1396. X * Miscellaneous OSF/1 bits
  1397. X */
  1398. X/*#define MISC_RPC*/
  1399. X#define    NEED_MNTOPT_PARSER
  1400. X#define    SHORT_MOUNT_NAME
  1401. X
  1402. X#define    MNTMAXSTR       128
  1403. X
  1404. X#define    MNTTYPE_UFS    "ufs"        /* Un*x file system */
  1405. X#define    MNTTYPE_NFS    "nfs"        /* network file system */
  1406. X#define    MNTTYPE_MFS    "mfs"        /* memory file system */
  1407. X#define    MNTTYPE_IGNORE    "ignore"    /* No type specified, ignore this entry */
  1408. X
  1409. X#define    MNTOPT_SOFT    "soft"        /* soft mount */
  1410. X#define    MNTOPT_INTR    "intr"        /* interrupts allowed */
  1411. X#define MNTOPT_NOCONN    "noconn"    /* accept any responder */
  1412. X        
  1413. Xstruct mntent {
  1414. X    char    *mnt_fsname;    /* name of mounted file system */
  1415. X    char    *mnt_dir;    /* file system path prefix */
  1416. X    char    *mnt_type;    /* MNTTYPE_* */
  1417. X    char    *mnt_opts;    /* MNTOPT* */
  1418. X    int    mnt_freq;    /* dump frequency, in days */
  1419. X    int    mnt_passno;    /* pass number on parallel fsck */
  1420. X};
  1421. X
  1422. X/*
  1423. X * Type of a file handle
  1424. X */
  1425. X#undef NFS_FH_TYPE
  1426. X#define    NFS_FH_TYPE    nfsv2fh_t *
  1427. X
  1428. X/*
  1429. X * How to get a mount list
  1430. X */
  1431. X#undef    READ_MTAB_FROM_FILE
  1432. X#define    READ_MTAB_BSD_STYLE
  1433. X
  1434. X/*
  1435. X * The data for the mount syscall needs the path in addition to the
  1436. X * host name since that is the only source of information about the
  1437. X * mounted filesystem.
  1438. X */
  1439. X#define    NFS_ARGS_NEEDS_PATH
  1440. X
  1441. X/*
  1442. X * 4.4 has RE support built in
  1443. X */
  1444. X#undef RE_HDR
  1445. X#define RE_HDR <regexp.h>
  1446. END_OF_FILE
  1447.   if test 3977 -ne `wc -c <'config/os-osf1.h'`; then
  1448.     echo shar: \"'config/os-osf1.h'\" unpacked with wrong size!
  1449.   fi
  1450.   # end of 'config/os-osf1.h'
  1451. fi
  1452. if test -f 'config/os-riscos4.h' -a "${1}" != "-c" ; then 
  1453.   echo shar: Will not clobber existing file \"'config/os-riscos4.h'\"
  1454. else
  1455.   echo shar: Extracting \"'config/os-riscos4.h'\" \(3461 characters\)
  1456.   sed "s/^X//" >'config/os-riscos4.h' <<'END_OF_FILE'
  1457. X/*
  1458. X * Copyright (c) 1989 Jan-Simon Pendry
  1459. X * Copyright (c) 1989 Imperial College of Science, Technology & Medicine
  1460. X * Copyright (c) 1989 The Regents of the University of California.
  1461. X * All rights reserved.
  1462. X *
  1463. X * This code is derived from software contributed to Berkeley by
  1464. X * Jan-Simon Pendry at Imperial College, London.
  1465. X *
  1466. X * Redistribution and use in source and binary forms, with or without
  1467. X * modification, are permitted provided that the following conditions
  1468. X * are met:
  1469. X * 1. Redistributions of source code must retain the above copyright
  1470. X *    notice, this list of conditions and the following disclaimer.
  1471. X * 2. Redistributions in binary form must reproduce the above copyright
  1472. X *    notice, this list of conditions and the following disclaimer in the
  1473. X *    documentation and/or other materials provided with the distribution.
  1474. X * 3. All advertising materials mentioning features or use of this software
  1475. X *    must display the following acknowledgement:
  1476. X *      This product includes software developed by the University of
  1477. X *      California, Berkeley and its contributors.
  1478. X * 4. Neither the name of the University nor the names of its contributors
  1479. X *    may be used to endorse or promote products derived from this software
  1480. X *    without specific prior written permission.
  1481. X *
  1482. X * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  1483. X * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  1484. X * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  1485. X * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  1486. X * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  1487. X * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  1488. X * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  1489. X * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  1490. X * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  1491. X * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  1492. X * SUCH DAMAGE.
  1493. X *
  1494. X *    %W% (Berkeley) %G%
  1495. X *
  1496. X * $Id: os-sos4.h,v 5.2.2.1 1992/02/09 15:10:41 jsp beta $
  1497. X *
  1498. X * RISC/os 4.x definitions for Amd (automounter)
  1499. X */
  1500. X
  1501. X/*
  1502. X * Does the compiler grok void *
  1503. X */
  1504. X#define    VOIDP
  1505. X
  1506. X/*
  1507. X * What type is free(void*) returning?
  1508. X */
  1509. X#undef FREE_RETURN_TYPE
  1510. X#define FREE_RETURN_TYPE    void
  1511. X
  1512. X/*
  1513. X * Which version of the Sun RPC library we are using
  1514. X * This is the implementation release number, not
  1515. X * the protocol revision number.
  1516. X */
  1517. X#define    RPC_4
  1518. X
  1519. X/*
  1520. X * Which version of the NFS interface are we using.
  1521. X * This is the implementation release number, not
  1522. X * the protocol revision number.
  1523. X */
  1524. X#define    NFS_4
  1525. X
  1526. X/*
  1527. X * Does this OS have NDBM support?
  1528. X */
  1529. X#define OS_HAS_NDBM
  1530. X
  1531. X/*
  1532. X * Byte ordering
  1533. X */
  1534. X/* some versions of RISC/os does not have <machine/endian.h>, so.. */
  1535. X#undef ARCH_ENDIAN
  1536. X#if defined(MIPSEB)
  1537. X#define    ARCH_ENDIAN    "big"
  1538. X#endif
  1539. X#if defined(MIPSEL)
  1540. X#define ARCH_ENDIAN    "little"
  1541. X#endif
  1542. X
  1543. X/*
  1544. X * Name of filesystem types
  1545. X */
  1546. X#define MOUNT_TYPE_NFS    "nfs"
  1547. X#define MOUNT_TYPE_UFS    "4.2"
  1548. X
  1549. X/*
  1550. X * Type of a file handle
  1551. X */
  1552. X#undef NFS_FH_TYPE
  1553. X#define    NFS_FH_TYPE    caddr_t
  1554. X
  1555. X/*
  1556. X * Type of filesystem type
  1557. X */
  1558. X#undef MTYPE_TYPE
  1559. X#define    MTYPE_TYPE    char *
  1560. X
  1561. X/*
  1562. X * System Vr4 / SunOS 4.1 compatibility
  1563. X * - put dev= in the options list
  1564. X *
  1565. X * From: Brent Callaghan <brent@eng.sun.com>
  1566. X */
  1567. X#define    MNTINFO_DEV    "dev"
  1568. X#define MNTINFO_PREF    ""
  1569. X
  1570. X/*
  1571. X * prototype for index(), strdup() etc.
  1572. X */
  1573. X#include <strings.h>
  1574. END_OF_FILE
  1575.   if test 3461 -ne `wc -c <'config/os-riscos4.h'`; then
  1576.     echo shar: \"'config/os-riscos4.h'\" unpacked with wrong size!
  1577.   fi
  1578.   # end of 'config/os-riscos4.h'
  1579. fi
  1580. if test -f 'config/os-sos4.h' -a "${1}" != "-c" ; then 
  1581.   echo shar: Will not clobber existing file \"'config/os-sos4.h'\"
  1582. else
  1583.   echo shar: Extracting \"'config/os-sos4.h'\" \(3431 characters\)
  1584.   sed "s/^X//" >'config/os-sos4.h' <<'END_OF_FILE'
  1585. X/*
  1586. X * Copyright (c) 1989 Jan-Simon Pendry
  1587. X * Copyright (c) 1989 Imperial College of Science, Technology & Medicine
  1588. X * Copyright (c) 1989 The Regents of the University of California.
  1589. X * All rights reserved.
  1590. X *
  1591. X * This code is derived from software contributed to Berkeley by
  1592. X * Jan-Simon Pendry at Imperial College, London.
  1593. X *
  1594. X * Redistribution and use in source and binary forms, with or without
  1595. X * modification, are permitted provided that the following conditions
  1596. X * are met:
  1597. X * 1. Redistributions of source code must retain the above copyright
  1598. X *    notice, this list of conditions and the following disclaimer.
  1599. X * 2. Redistributions in binary form must reproduce the above copyright
  1600. X *    notice, this list of conditions and the following disclaimer in the
  1601. X *    documentation and/or other materials provided with the distribution.
  1602. X * 3. All advertising materials mentioning features or use of this software
  1603. X *    must display the following acknowledgement:
  1604. X *      This product includes software developed by the University of
  1605. X *      California, Berkeley and its contributors.
  1606. X * 4. Neither the name of the University nor the names of its contributors
  1607. X *    may be used to endorse or promote products derived from this software
  1608. X *    without specific prior written permission.
  1609. X *
  1610. X * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  1611. X * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  1612. X * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  1613. X * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  1614. X * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  1615. X * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  1616. X * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  1617. X * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  1618. X * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  1619. X * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  1620. X * SUCH DAMAGE.
  1621. X *
  1622. X *    %W% (Berkeley) %G%
  1623. X *
  1624. X * $Id: os-sos4.h,v 5.2.2.1 1992/02/09 15:10:41 jsp beta $
  1625. X *
  1626. X * SunOS 4.0 definitions for Amd (automounter)
  1627. X */
  1628. X
  1629. X/*
  1630. X * Does the compiler grok void *
  1631. X */
  1632. X#define    VOIDP
  1633. X
  1634. X/*
  1635. X * What type is free(void*) returning?
  1636. X */
  1637. X#undef FREE_RETURN_TYPE
  1638. X#define FREE_RETURN_TYPE    int
  1639. X
  1640. X/*
  1641. X * Which version of the Sun RPC library we are using
  1642. X * This is the implementation release number, not
  1643. X * the protocol revision number.
  1644. X */
  1645. X#define    RPC_4
  1646. X
  1647. X/*
  1648. X * Which version of the NFS interface are we using.
  1649. X * This is the implementation release number, not
  1650. X * the protocol revision number.
  1651. X */
  1652. X#define    NFS_4
  1653. X
  1654. X/*
  1655. X * Does this OS have NDBM support?
  1656. X */
  1657. X#define OS_HAS_NDBM
  1658. X
  1659. X/*
  1660. X * Byte ordering
  1661. X */
  1662. X#undef ARCH_ENDIAN
  1663. X#if defined(mc68010) || defined(mc68020) || defined(sparc)
  1664. X#define    ARCH_ENDIAN    "big"
  1665. X#endif
  1666. X#if defined(i386)
  1667. X#define ARCH_ENDIAN    "little"
  1668. X#endif
  1669. X
  1670. X/*
  1671. X * Name of filesystem types
  1672. X */
  1673. X#define MOUNT_TYPE_NFS    "nfs"
  1674. X#define MOUNT_TYPE_UFS    "4.2"
  1675. X
  1676. X/*
  1677. X * Type of a file handle
  1678. X */
  1679. X#undef NFS_FH_TYPE
  1680. X#define    NFS_FH_TYPE    caddr_t
  1681. X
  1682. X/*
  1683. X * Type of filesystem type
  1684. X */
  1685. X#undef MTYPE_TYPE
  1686. X#define    MTYPE_TYPE    char *
  1687. X
  1688. X/*
  1689. X * Add support for SunOS 4 automounter files
  1690. X */
  1691. X#define    SUNOS4_COMPAT
  1692. X
  1693. X/*
  1694. X * System Vr4 / SunOS 4.1 compatibility
  1695. X * - put dev= in the options list
  1696. X *
  1697. X * From: Brent Callaghan <brent@eng.sun.com>
  1698. X */
  1699. X#define    MNTINFO_DEV    "dev"
  1700. X#define MNTINFO_PREF    ""
  1701. END_OF_FILE
  1702.   if test 3431 -ne `wc -c <'config/os-sos4.h'`; then
  1703.     echo shar: \"'config/os-sos4.h'\" unpacked with wrong size!
  1704.   fi
  1705.   # end of 'config/os-sos4.h'
  1706. fi
  1707. if test -f 'config/os-xinu43.h' -a "${1}" != "-c" ; then 
  1708.   echo shar: Will not clobber existing file \"'config/os-xinu43.h'\"
  1709. else
  1710.   echo shar: Extracting \"'config/os-xinu43.h'\" \(3544 characters\)
  1711.   sed "s/^X//" >'config/os-xinu43.h' <<'END_OF_FILE'
  1712. X/*
  1713. X * Copyright (c) 1989 Jan-Simon Pendry
  1714. X * Copyright (c) 1989 Imperial College of Science, Technology & Medicine
  1715. X * Copyright (c) 1989 The Regents of the University of California.
  1716. X * All rights reserved.
  1717. X *
  1718. X * This code is derived from software contributed to Berkeley by
  1719. X * Jan-Simon Pendry at Imperial College, London.
  1720. X *
  1721. X * Redistribution and use in source and binary forms, with or without
  1722. X * modification, are permitted provided that the following conditions
  1723. X * are met:
  1724. X * 1. Redistributions of source code must retain the above copyright
  1725. X *    notice, this list of conditions and the following disclaimer.
  1726. X * 2. Redistributions in binary form must reproduce the above copyright
  1727. X *    notice, this list of conditions and the following disclaimer in the
  1728. X *    documentation and/or other materials provided with the distribution.
  1729. X * 3. All advertising materials mentioning features or use of this software
  1730. X *    must display the following acknowledgement:
  1731. X *      This product includes software developed by the University of
  1732. X *      California, Berkeley and its contributors.
  1733. X * 4. Neither the name of the University nor the names of its contributors
  1734. X *    may be used to endorse or promote products derived from this software
  1735. X *    without specific prior written permission.
  1736. X *
  1737. X * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  1738. X * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  1739. X * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  1740. X * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  1741. X * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  1742. X * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  1743. X * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  1744. X * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  1745. X * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  1746. X * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  1747. X * SUCH DAMAGE.
  1748. X *
  1749. X *    %W% (Berkeley) %G%
  1750. X *
  1751. X * $Id: os-xinu43.h,v 5.2.2.1 1992/02/09 15:10:58 jsp beta $
  1752. X *
  1753. X * mt Xinu 4.3 (MORE/bsd) definitions for Amd (automounter)
  1754. X * Should work on both Vax and HP ...
  1755. X */
  1756. X
  1757. X/*
  1758. X * Does the compiler grok void *
  1759. X */
  1760. X#ifdef __GNUC__
  1761. X#define    VOIDP
  1762. X#endif
  1763. X
  1764. X/*
  1765. X * Which version of the Sun RPC library we are using
  1766. X * This is the implementation release number, not
  1767. X * the protocol revision number.
  1768. X */
  1769. X#define    RPC_4
  1770. X
  1771. X/*
  1772. X * mt Xinu have a compatibility problem
  1773. X * with getreq vs. getreqset.  On SunOS
  1774. X * getreqset takes a pointer to an fd_set,
  1775. X * whereas on MORE/bsd, getreq takes a
  1776. X * fd_set directly (cf. an integer on SunOS).
  1777. X */
  1778. X#define    svc_getreqset(p)    svc_getreq(*p)
  1779. X
  1780. X/*
  1781. X * Which version of the NFS interface are we using.
  1782. X * This is the implementation release number, not
  1783. X * the protocol revision number.
  1784. X */
  1785. X#define    NFS_4
  1786. X
  1787. X/*
  1788. X * Name of filesystem types
  1789. X */
  1790. X#define    MOUNT_TYPE_NFS    "nfs"
  1791. X#define    MOUNT_TYPE_UFS    "ufs"
  1792. X#undef MTAB_TYPE_UFS
  1793. X#define    MTAB_TYPE_UFS    "ufs"
  1794. X
  1795. X/*
  1796. X * Byte ordering
  1797. X */
  1798. X#ifndef BYTE_ORDER
  1799. X#include <machine/endian.h>
  1800. X#endif /* BYTE_ORDER */
  1801. X
  1802. X#undef ARCH_ENDIAN
  1803. X#if BYTE_ORDER == LITTLE_ENDIAN
  1804. X#define ARCH_ENDIAN "little"
  1805. X#else
  1806. X#if BYTE_ORDER == BIG_ENDIAN
  1807. X#define ARCH_ENDIAN "big"
  1808. X#else
  1809. XXXX - Probably no hope of running Amd on this machine!
  1810. X#endif /* BIG */
  1811. X#endif /* LITTLE */
  1812. X
  1813. X/*
  1814. X * Type of a file handle
  1815. X */
  1816. X#undef NFS_FH_TYPE
  1817. X#define NFS_FH_TYPE     caddr_t
  1818. X
  1819. X/*
  1820. X * Type of filesystem type
  1821. X */
  1822. X#undef MTYPE_TYPE
  1823. X#define    MTYPE_TYPE    char *
  1824. END_OF_FILE
  1825.   if test 3544 -ne `wc -c <'config/os-xinu43.h'`; then
  1826.     echo shar: \"'config/os-xinu43.h'\" unpacked with wrong size!
  1827.   fi
  1828.   # end of 'config/os-xinu43.h'
  1829. fi
  1830. if test -f 'csd/pol.c' -a "${1}" != "-c" ; then 
  1831.   echo shar: Will not clobber existing file \"'csd/pol.c'\"
  1832. else
  1833.   echo shar: Extracting \"'csd/pol.c'\" \(3700 characters\)
  1834.   sed "s/^X//" >'csd/pol.c' <<'END_OF_FILE'
  1835. X/* 
  1836. X * WorldWide File System
  1837. X * Copyright (c) 1992,1993 Youki Kadobayashi
  1838. X * Copyright (c) 1992,1993 Osaka University
  1839. X * All rights reserved.
  1840. X *
  1841. X * Permission to use, copy, modify and distribute this software and its
  1842. X * documentation is hereby granted, provided that the following conditions
  1843. X * are met:
  1844. X * 1. Both the copyright notice and this permission notice appear in
  1845. X *    all copies of the software, derivative works or modified versions,
  1846. X *    and any portions thereof, and that both notices appear in
  1847. X *    supporting documentation.
  1848. X * 2. All advertising materials mentioning features or use of this software
  1849. X *    must display the following acknowledgement:
  1850. X *      This product includes software developed by the Osaka University
  1851. X *      and its contributors.
  1852. X * 3. Neither the name of the University nor the names of its contributors
  1853. X *    may be used to endorse or promote products derived from this software
  1854. X *    without specific prior written permission.
  1855. X *
  1856. X * THIS SOFTWARE IS PROVIDED BY THE DEVELOPER ``AS IS'' AND OSAKA
  1857. X * UNIVERSITY DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY DAMAGES
  1858. X * WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
  1859. X *
  1860. X * Osaka University requests users of this software to return to
  1861. X *
  1862. X *  Youki Kadobayashi
  1863. X *  Department of Information and Computer Sciences
  1864. X *  Osaka University, Toyonaka 560, Osaka, Japan
  1865. X *
  1866. X * any improvements or extensions that they make and grant Osaka
  1867. X * University the rights to redistribute these changes.
  1868. X */
  1869. Xstatic char *AtFSid = "$Header: pol.c[109.0] Wed Nov 24 03:47:15 1993 youki-k@is.aist-nara.ac.jp saved $";
  1870. X
  1871. X#include "wfs.h"
  1872. X#include "util.h"
  1873. X#include "global.h"
  1874. X
  1875. X/*
  1876. X * Policy-based protocol selection. Work in progress.
  1877. X *
  1878. X * Appropriate protocol will be selected from protocol set, based on
  1879. X * the following four constraints:
  1880. X *
  1881. X * - Volume constraints. Protocols may be narrowed due to security concern,
  1882. X *   server load, or purpose of the volume.
  1883. X * - Session constraints (or server constraints). Protocol may be narrowed
  1884. X *   for better user response. This is effective particularly if there are
  1885. X *   existing connection to a server serving the volume.
  1886. X * - Cluster-site constraints. Site manager can specify certain protocol set
  1887. X *   to gain better security and/or performance.
  1888. X * - User constraints. User or user agent may prefer particular protcol set
  1889. X *   from others for some reason, such as provision of better semantics
  1890. X *   for the application in use.
  1891. X *
  1892. X * For more detailed discussion please expect my upcoming paper.
  1893. X * I haven't implemented this model so far because I don't need it right now.
  1894. X * It must be useful however, if you want to implement WAIS-FS or Archie-FS
  1895. X * or NNTP-FS or TCP-NFS...
  1896. X */
  1897. Xwf_proto *
  1898. Xpol_select_proto(volp)
  1899. Xwf_vol *volp;
  1900. X{
  1901. X    switch (volp->id) {
  1902. X    case WF_ROOT_VOL_ID:
  1903. X        return &proto_root;
  1904. X#if 0
  1905. X    case WF_HOST_VOL_ID:
  1906. X        return &proto_host;
  1907. X    case WF_CWD_VOL_ID:
  1908. X        return &proto_cwd;
  1909. X#endif
  1910. X    case WF_FH_VOL_ID:
  1911. X        return &proto_fh;
  1912. X    }
  1913. X    if (volp->flag & WF_VOL_DIRECTFILE) {
  1914. X        return &proto_ufs;
  1915. X    } else {
  1916. X        return &proto_ftp;    /* XXX */
  1917. X    }
  1918. X}
  1919. X
  1920. X/*
  1921. X * Policy-based server selection. Work in progress.
  1922. X *
  1923. X * A file server may be selected from given set of file servers, with
  1924. X * the following considerations for each server in choice:
  1925. X *
  1926. X * - Reliability of the candidate.
  1927. X * - Mean RTT between the candidate and the cluster server.
  1928. X * - Average load of the candidate.
  1929. X * - Policy; such as the number of connections the candidate permit.
  1930. X * - Protocol set the candidate can speak.
  1931. X */
  1932. Xwf_srvq *
  1933. Xpol_select_srv(volp)
  1934. Xwf_vol *volp;
  1935. X{
  1936. X    wf_srvq *q;
  1937. X    ITER(q, wf_srvq, &volp->srvq->q) {
  1938. X        if (q->srv->flag == 0)
  1939. X            return q;
  1940. X    }
  1941. X    q = NEXT(wf_srvq, volp->srvq);    /* firewall */
  1942. X    return q;
  1943. X}
  1944. END_OF_FILE
  1945.   if test 3700 -ne `wc -c <'csd/pol.c'`; then
  1946.     echo shar: \"'csd/pol.c'\" unpacked with wrong size!
  1947.   fi
  1948.   # end of 'csd/pol.c'
  1949. fi
  1950. if test -f 'csd/thrd.c' -a "${1}" != "-c" ; then 
  1951.   echo shar: Will not clobber existing file \"'csd/thrd.c'\"
  1952. else
  1953.   echo shar: Extracting \"'csd/thrd.c'\" \(3584 characters\)
  1954.   sed "s/^X//" >'csd/thrd.c' <<'END_OF_FILE'
  1955. X/* 
  1956. X * WorldWide File System
  1957. X * Copyright (c) 1992,1993 Youki Kadobayashi
  1958. X * Copyright (c) 1992,1993 Osaka University
  1959. X * All rights reserved.
  1960. X *
  1961. X * Permission to use, copy, modify and distribute this software and its
  1962. X * documentation is hereby granted, provided that the following conditions
  1963. X * are met:
  1964. X * 1. Both the copyright notice and this permission notice appear in
  1965. X *    all copies of the software, derivative works or modified versions,
  1966. X *    and any portions thereof, and that both notices appear in
  1967. X *    supporting documentation.
  1968. X * 2. All advertising materials mentioning features or use of this software
  1969. X *    must display the following acknowledgement:
  1970. X *      This product includes software developed by the Osaka University
  1971. X *      and its contributors.
  1972. X * 3. Neither the name of the University nor the names of its contributors
  1973. X *    may be used to endorse or promote products derived from this software
  1974. X *    without specific prior written permission.
  1975. X *
  1976. X * THIS SOFTWARE IS PROVIDED BY THE DEVELOPER ``AS IS'' AND OSAKA
  1977. X * UNIVERSITY DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY DAMAGES
  1978. X * WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
  1979. X *
  1980. X * Osaka University requests users of this software to return to
  1981. X *
  1982. X *  Youki Kadobayashi
  1983. X *  Department of Information and Computer Sciences
  1984. X *  Osaka University, Toyonaka 560, Osaka, Japan
  1985. X *
  1986. X * any improvements or extensions that they make and grant Osaka
  1987. X * University the rights to redistribute these changes.
  1988. X */
  1989. X/* thread status manager */
  1990. Xstatic char *AtFSid = "$Header: thrd.c[109.0] Wed Nov 24 03:47:17 1993 youki-k@is.aist-nara.ac.jp saved $";
  1991. X
  1992. X#include "wfs.h"
  1993. X#include "util.h"
  1994. X#include "global.h"
  1995. X
  1996. Xextern qelem thrd_head;
  1997. Xqelem thrd_head = { &thrd_head, &thrd_head };
  1998. Xstatic void *thrd_callout;
  1999. X
  2000. Xwf_thrd *
  2001. Xthrd_alloc()
  2002. X{
  2003. X    wf_thrd *thrdp;
  2004. X
  2005. X    thrdp = ALLOC(wf_thrd);
  2006. X    return thrdp;
  2007. X}
  2008. X
  2009. Xvoid
  2010. Xthrd_watch(thrdp)
  2011. Xwf_thrd *thrdp;
  2012. X{
  2013. X    q_insert(thrdp, &thrd_head);
  2014. X}
  2015. X
  2016. Xvoid
  2017. Xthrd_ignore(thrdp)
  2018. Xwf_thrd *thrdp;
  2019. X{
  2020. X    q_remove(thrdp);
  2021. X}
  2022. X
  2023. Xvoid
  2024. Xthrd_free(thrdp)
  2025. Xwf_thrd *thrdp;
  2026. X{
  2027. X    if (NEXT(wf_thrd, thrdp)) q_remove(thrdp);
  2028. X    if (thrdp->rqstp) FREE(thrdp->rqstp);
  2029. X    FREE(thrdp);
  2030. X}
  2031. X
  2032. Xvoid
  2033. Xthrd_srvfailure(srvp)
  2034. Xwf_srv *srvp;
  2035. X{
  2036. X    /* server failure */
  2037. X    wf_thrd *p, *p2;
  2038. X
  2039. X    ITER2(p, p2, wf_thrd, &thrd_head) {
  2040. X        if (p->cp && p->cp->srv == srvp) {
  2041. X            (*p->give_up)(p->closure);
  2042. X        }
  2043. X    }
  2044. X}
  2045. X
  2046. Xstatic void
  2047. Xthrd_gc()
  2048. X{
  2049. X    wf_thrd *p, *p2;
  2050. X
  2051. X    ITER2(p, p2, wf_thrd, &thrd_head) {
  2052. X        if (p->flag & WF_THREAD_ERROR) {
  2053. X            (*p->give_up)(p->closure);
  2054. X            p->flag &= ~WF_THREAD_ERROR;    /* called only once */
  2055. X        } else if ((p->flag & WF_THREAD_RISKY)
  2056. X               && p->idle > WF_THREAD_TTL) {
  2057. X            if (p->cp)
  2058. X                srv_flag(p->cp->srv, WF_SRV_TIMEOUT);
  2059. X            (*p->give_up)(p->closure);
  2060. X            p->flag &= ~WF_THREAD_RISKY;    /* called only once */
  2061. X        }
  2062. X        if (p->flag & WF_THREAD_RISKY)
  2063. X            p->idle += 60;
  2064. X    }
  2065. X    thrd_callout = timeout_set(gettime()+60, thrd_gc, 0);
  2066. X}
  2067. X
  2068. Xvoid
  2069. Xthrd_start()
  2070. X{
  2071. X    thrd_callout = timeout_set(gettime()+60, thrd_gc, 0);
  2072. X}
  2073. X
  2074. Xvoid
  2075. Xthrd_stop()
  2076. X{
  2077. X    wf_thrd *p;
  2078. X
  2079. X    ITER(p, wf_thrd, &thrd_head) {
  2080. X        (*p->give_up)(p->closure);
  2081. X        p->flag &= ~(WF_THREAD_ERROR|WF_THREAD_RISKY);
  2082. X            /* called only once */
  2083. X    }
  2084. X}
  2085. X
  2086. Xvoid
  2087. Xthrd_inspect(reqp)
  2088. Xwf_req *reqp;
  2089. X{
  2090. X    wf_thrd *p;
  2091. X
  2092. X    ITER(p, wf_thrd, &thrd_head) {
  2093. X        req_send(reqp, "thread %lx: vol= %s, dir= %s\n",
  2094. X             p, PROT(p->child_volp->name), PROT(p->dirp->name));
  2095. X        req_send(reqp, "\tstep= %d, flag= %d, fh= {%lx, %lx, %lx, %lx}\n",
  2096. X             p->step, p->flag,
  2097. X             p->fhp->parent_vol, p->fhp->dir_id,
  2098. X             p->fhp->child_vol, p->fhp->file_id);
  2099. X        req_send(reqp, "\tfname= %s, idle= %d, conn= %lx\n",
  2100. X             PROT(p->fname), p->idle, p->cp);
  2101. X    }
  2102. X}
  2103. END_OF_FILE
  2104.   if test 3584 -ne `wc -c <'csd/thrd.c'`; then
  2105.     echo shar: \"'csd/thrd.c'\" unpacked with wrong size!
  2106.   fi
  2107.   # end of 'csd/thrd.c'
  2108. fi
  2109. if test -f 'csd/trace.c' -a "${1}" != "-c" ; then 
  2110.   echo shar: Will not clobber existing file \"'csd/trace.c'\"
  2111. else
  2112.   echo shar: Extracting \"'csd/trace.c'\" \(3710 characters\)
  2113.   sed "s/^X//" >'csd/trace.c' <<'END_OF_FILE'
  2114. X/* 
  2115. X * WorldWide File System
  2116. X * Copyright (c) 1992,1993 Youki Kadobayashi
  2117. X * Copyright (c) 1992,1993 Osaka University
  2118. X * All rights reserved.
  2119. X *
  2120. X * Permission to use, copy, modify and distribute this software and its
  2121. X * documentation is hereby granted, provided that the following conditions
  2122. X * are met:
  2123. X * 1. Both the copyright notice and this permission notice appear in
  2124. X *    all copies of the software, derivative works or modified versions,
  2125. X *    and any portions thereof, and that both notices appear in
  2126. X *    supporting documentation.
  2127. X * 2. All advertising materials mentioning features or use of this software
  2128. X *    must display the following acknowledgement:
  2129. X *      This product includes software developed by the Osaka University
  2130. X *      and its contributors.
  2131. X * 3. Neither the name of the University nor the names of its contributors
  2132. X *    may be used to endorse or promote products derived from this software
  2133. X *    without specific prior written permission.
  2134. X *
  2135. X * THIS SOFTWARE IS PROVIDED BY THE DEVELOPER ``AS IS'' AND OSAKA
  2136. X * UNIVERSITY DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY DAMAGES
  2137. X * WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
  2138. X *
  2139. X * Osaka University requests users of this software to return to
  2140. X *
  2141. X *  Youki Kadobayashi
  2142. X *  Department of Information and Computer Sciences
  2143. X *  Osaka University, Toyonaka 560, Osaka, Japan
  2144. X *
  2145. X * any improvements or extensions that they make and grant Osaka
  2146. X * University the rights to redistribute these changes.
  2147. X */
  2148. Xstatic char *AtFSid = "$Header: trace.c[109.0] Wed Nov 24 03:47:18 1993 youki-k@is.aist-nara.ac.jp saved $";
  2149. X
  2150. X#include <stdio.h>
  2151. X#include "wfs.h"
  2152. X#include "global.h"
  2153. X#include "util.h"
  2154. X
  2155. Xextern qelem trace_head;
  2156. Xqelem trace_head = { &trace_head, &trace_head };    /* chain of wf_trace */
  2157. Xstatic void *trace_callout;
  2158. X
  2159. Xstatic int idle = 0;
  2160. Xstatic FILE *fp;
  2161. Xstatic int closed = 1;
  2162. X
  2163. Xvoid
  2164. Xtrace_event(handle, tracep)
  2165. Xvoid *handle;
  2166. Xwf_trace *tracep;
  2167. X{
  2168. X    /* use casted pointer to discriminate sessions. */
  2169. X    tracep->cookie = (long) handle;
  2170. X    q_insert(tracep, LAST(wf_trace, &trace_head));
  2171. X    idle = 0;
  2172. X}
  2173. X
  2174. Xstatic void
  2175. Xtrace_open()
  2176. X{
  2177. X    char path[MAXPATHLEN];
  2178. X
  2179. X    sprintf(path, "%s/log/trace%s", cs_topdir, cs_date);
  2180. X    fp = fopen(path, "a+");
  2181. X    if (fp == NULL) {
  2182. X        dlog("cannot write to trace file \"%s\"", path);
  2183. X    } else {
  2184. X        closed = 0;
  2185. X    }
  2186. X}
  2187. X
  2188. Xstatic void
  2189. Xtrace_close()
  2190. X{
  2191. X    if (!closed) {
  2192. X        fclose(fp);
  2193. X        closed = 1;
  2194. X    }
  2195. X}
  2196. X
  2197. Xstatic void
  2198. Xtrace_write()
  2199. X{
  2200. X#define TRACE_SIZE (sizeof (wf_trace) - sizeof (qelem))
  2201. X    wf_trace *tracep;
  2202. X    char *p, *buf;
  2203. X    int count = 0;
  2204. X    static int maxcount = NFS_MAXDATA / TRACE_SIZE;
  2205. X
  2206. X    /*
  2207. X     * open file if necessary
  2208. X     */
  2209. X    if (! MORE(&trace_head)) return;
  2210. X    if (closed)
  2211. X        trace_open();
  2212. X    if (fp == NULL) return;
  2213. X
  2214. X    /*
  2215. X     * write data
  2216. X     */
  2217. X    p = buf = so_getbuf(fileno(fp));    /* of size NFS_MAXDATA */
  2218. X    ITER(tracep, wf_trace, &trace_head) {
  2219. X        bcopy(&tracep->cookie, p, TRACE_SIZE);
  2220. X        p += TRACE_SIZE;
  2221. X        ++count;
  2222. X        if (count >= maxcount) {
  2223. X            fwrite(buf, TRACE_SIZE, count, fp);
  2224. X            p = buf;
  2225. X            count = 0;
  2226. X        }
  2227. X    }
  2228. X    if (count) {
  2229. X        fwrite(buf, TRACE_SIZE, count, fp);
  2230. X    }
  2231. X
  2232. X    /*
  2233. X     * forget data
  2234. X     */
  2235. X    q_allfree(&trace_head);
  2236. X}
  2237. X
  2238. X/*
  2239. X * automagically close trace file if no activity has been observed recently.
  2240. X */
  2241. Xstatic void
  2242. Xtrace_gc()
  2243. X{
  2244. X    trace_write();
  2245. X    if (!closed) {
  2246. X        idle += 60;
  2247. X        if (idle > 120) {
  2248. X            trace_close();
  2249. X        }
  2250. X    }
  2251. X    trace_callout = timeout_set(gettime()+60, trace_gc, 0);
  2252. X}
  2253. X
  2254. X/* forcibly flush trace file and execute shell script. */
  2255. Xvoid
  2256. Xtrace_report()
  2257. X{
  2258. X    char path[MAXPATHLEN];
  2259. X
  2260. X    trace_write();
  2261. X    trace_close();
  2262. X    sprintf(path, "%s/bin/report.sh %s/log/trace%s %s.%s",
  2263. X        cs_topdir,
  2264. X        cs_topdir, cs_date, cs_hostname, cs_domain);
  2265. X    unix_command(path);
  2266. X}
  2267. X
  2268. Xvoid
  2269. Xtrace_start()
  2270. X{
  2271. X    trace_callout = timeout_set(gettime()+60, trace_gc, 0);
  2272. X}
  2273. X
  2274. END_OF_FILE
  2275.   if test 3710 -ne `wc -c <'csd/trace.c'`; then
  2276.     echo shar: \"'csd/trace.c'\" unpacked with wrong size!
  2277.   fi
  2278.   # end of 'csd/trace.c'
  2279. fi
  2280. if test -f 'gtr/dig.pl' -a "${1}" != "-c" ; then 
  2281.   echo shar: Will not clobber existing file \"'gtr/dig.pl'\"
  2282. else
  2283.   echo shar: Extracting \"'gtr/dig.pl'\" \(1182 characters\)
  2284.   sed "s/^X//" >'gtr/dig.pl' <<'END_OF_FILE'
  2285. X#!/usr/local/bin/perl
  2286. X#
  2287. X# Domain Internet Groper, written in Perl.  5 minutes hack.
  2288. X# Usage: dig.pl [-t type] [-c class] hostname
  2289. X# NOTE:    Trailing dot is necessary -- domainname attached otherwise.
  2290. X#    Type and class argument must be uppercase.
  2291. X#
  2292. X# Author: Youki Kadobayashi <youki@wide.ad.jp>
  2293. X# This file is part of WWFS.
  2294. X#
  2295. X
  2296. Xrequire 'resolv.pl';
  2297. Xrequire 'getopts.pl';
  2298. Xdo Getopts('c:t:');
  2299. X
  2300. X(@ARGV == 1) || die "$0: 1 args.";
  2301. X
  2302. X# $res'options |= &RES_DEBUG;
  2303. X# $res'options |= &RES_USEVC;
  2304. X
  2305. X$ns = &res_open;
  2306. X$q = &res_mkquery($ARGV[0],
  2307. X    $opt_t ? $opt_t : "ANY",
  2308. X    $opt_c ? $opt_c : "IN");
  2309. X@resp = &res_send($ns, $q);
  2310. X
  2311. Xprint "; Perl DiG\n";
  2312. Xprint ";; QUESTIONS:\n";
  2313. Xprint ";;\t", @resp[3],
  2314. X    ", type = ", &res'qtype_numtostr($resp[4]),
  2315. X    ", class = ", &res'qclass_numtostr($resp[5]), "\n";
  2316. X
  2317. Xprint "\n;; ANSWERS:\n";
  2318. X&print_records($resp[6], $resp[7]);
  2319. Xprint "\n;; AUTHORITY RECORDS:\n";
  2320. X&print_records($resp[8], $resp[9]);
  2321. Xprint "\n;; ADDITIONAL RECORDS:\n";
  2322. X&print_records($resp[10], $resp[11]);
  2323. X
  2324. Xsub print_records {
  2325. X    local ($from, $to) = @_;
  2326. X
  2327. X    for ($i = $from; $i < $to; $i += 5) {
  2328. X        print $resp[$i], "\t", $resp[$i+1], "\t",  $resp[$i+2], "\t", $resp[$i+3], "\t", $resp[$i+4], "\n";
  2329. X    }
  2330. X}
  2331. X
  2332. END_OF_FILE
  2333.   if test 1182 -ne `wc -c <'gtr/dig.pl'`; then
  2334.     echo shar: \"'gtr/dig.pl'\" unpacked with wrong size!
  2335.   fi
  2336.   chmod +x 'gtr/dig.pl'
  2337.   # end of 'gtr/dig.pl'
  2338. fi
  2339. if test -f 'gtr/gtr.txt' -a "${1}" != "-c" ; then 
  2340.   echo shar: Will not clobber existing file \"'gtr/gtr.txt'\"
  2341. else
  2342.   echo shar: Extracting \"'gtr/gtr.txt'\" \(3815 characters\)
  2343.   sed "s/^X//" >'gtr/gtr.txt' <<'END_OF_FILE'
  2344. X#
  2345. X# gtr.txt: GTR-based server selection table.
  2346. X#
  2347. X
  2348. X#
  2349. X# JP: Japan
  2350. X#
  2351. X133.4           255.255.0.0     Japan-WIDE-JP
  2352. X133.4.1.0    255.255.255.224    Fujisawa-WIDE-JP
  2353. X133.4.3.0    255.255.255.224    Tokyo-WIDE-JP
  2354. X133.4.8.0    255.255.255.224    Kyoto-WIDE-JP
  2355. X133.4.11.0    255.255.255.224    Fujisawa-WIDE-JP
  2356. X133.4.14.0    255.255.255.224    Fukuoka-WIDE-JP
  2357. X131.113        Fujisawa-WIDE-JP
  2358. X133.27        Fujisawa-WIDE-JP
  2359. X129.249        Fujisawa-WIDE-JP
  2360. X133.107        Fujisawa-WIDE-JP
  2361. X133.196        Fujisawa-WIDE-JP
  2362. X133.160        Fujisawa-WIDE-JP
  2363. X133.152        Fujisawa-WIDE-JP
  2364. X133.229        Fujisawa-WIDE-JP
  2365. X192.51.51    Fujisawa-WIDE-JP
  2366. X150.61        Fujisawa-WIDE-JP
  2367. X133.179        Fujisawa-WIDE-JP
  2368. X136.198        Fujisawa-WIDE-JP
  2369. X192.47.168    Fujisawa-WIDE-JP
  2370. X192.50.240    Fujisawa-WIDE-JP
  2371. X133.235        Tokyo-WIDE-JP
  2372. X130.153        Tokyo-WIDE-JP
  2373. X133.147        Tokyo-WIDE-JP
  2374. X192.26.9    Tokyo-WIDE-JP
  2375. X133.139        Tokyo-WIDE-JP
  2376. X133.137        Tokyo-WIDE-JP
  2377. X133.2        Tokyo-WIDE-JP
  2378. X133.143        Tokyo-WIDE-JP
  2379. X133.43        Tokyo-WIDE-JP
  2380. X192.135.93    Tokyo-WIDE-JP
  2381. X133.9        Tokyo-WIDE-JP
  2382. X133.26        Tokyo-WIDE-JP
  2383. X133.156        Tokyo-WIDE-JP
  2384. X162.213        Tokyo-WIDE-JP
  2385. X192.31.197    Tokyo-WIDE-JP
  2386. X133.144        Tokyo-WIDE-JP
  2387. X133.138        Tokyo-WIDE-JP
  2388. X157.18        Tokyo-WIDE-JP
  2389. X130.69        Tokyo-WIDE-JP
  2390. X157.2        Tokyo-WIDE-JP
  2391. X133.72        Tokyo-WIDE-JP
  2392. X163.142        Tokyo-WIDE-JP
  2393. X131.112        Tokyo-WIDE-JP
  2394. X192.26.91    Tokyo-WIDE-JP
  2395. X150.65        Tokyo-WIDE-JP
  2396. X133.194        Tokyo-WIDE-JP
  2397. X133.14        Tokyo-WIDE-JP
  2398. X133.20        Tokyo-WIDE-JP
  2399. X192.47.52    Tokyo-WIDE-JP
  2400. X133.12        Tokyo-WIDE-JP
  2401. X192.156.220    Tokyo-WIDE-JP
  2402. X133.233        Tokyo-WIDE-JP
  2403. X133.166        Tokyo-WIDE-JP
  2404. X133.112        Tokyo-WIDE-JP
  2405. X133.123        Tokyo-WIDE-JP
  2406. X192.218.88    Tokyo-WIDE-JP
  2407. X133.140        Tokyo-WIDE-JP
  2408. X133.227        Tokyo-WIDE-JP
  2409. X155.160        Tokyo-WIDE-JP
  2410. X150.88        Tokyo-WIDE-JP
  2411. X133.99        Tokyo-WIDE-JP
  2412. X192.51.48    Tokyo-WIDE-JP
  2413. X192.50.188    Tokyo-WIDE-JP
  2414. X202.17.180    Tokyo-WIDE-JP
  2415. X192.50.17    Tokyo-WIDE-JP
  2416. X133.11        Tokyo-TISN-JP
  2417. X157.82        Tokyo-UTnet-JP
  2418. X192.41.197    Tokyo-TIX-JP
  2419. X192.31.121    Tokyo-TRAIN-JP
  2420. X133.82        Tokyo-TRAIN-JP
  2421. X192.244.176    Tokyo-IIJ-JP
  2422. X150.80        Sendai-WIDE-JP
  2423. X130.34        Sendai-WIDE-JP
  2424. X192.51.251    Sapporo-WIDE-JP
  2425. X133.50        Sapporo-WIDE-JP
  2426. X133.87        Sapporo-WIDE-JP
  2427. X192.50.101    Sapporo-WIDE-JP
  2428. X163.130        Sapporo-WIDE-JP
  2429. X192.51.160    Sapporo-WIDE-JP
  2430. X192.51.252    Sapporo-WIDE-JP
  2431. X133.232        Sapporo-WIDE-JP
  2432. X192.51.254    Sapporo-WIDE-JP
  2433. X202.13.62    Sapporo-WIDE-JP
  2434. X163.221        Nara-WIDE-JP
  2435. X192.218.128    Nara-WIDE-JP
  2436. X133.1        255.255.0.0    Osaka-WIDE-JP
  2437. X192.47.241    Nara-WIDE-JP
  2438. X133.18        Kyoto-WIDE-JP
  2439. X133.83        Kyoto-WIDE-JP
  2440. X133.210        Kyoto-WIDE-JP
  2441. X133.186        Kyoto-WIDE-JP
  2442. X192.51.37    Kyoto-WIDE-JP
  2443. X130.54        Kyoto-WIDE-JP
  2444. X133.3        Kyoto-WIDE-JP
  2445. X192.50.8    Kyoto-WIDE-JP
  2446. X133.155        Osaka-WIDE-JP
  2447. X133.30        Osaka-WIDE-JP
  2448. X132.182        Osaka-WIDE-JP
  2449. X133.243        Osaka-WIDE-JP
  2450. X133.1.12    255.255.255.0    Osaka.Toyonaka-WIDE-JP
  2451. X133.1.4        255.255.255.0    Osaka.Suita-WIDE-JP
  2452. X133.125        Fukuoka-WIDE-JP
  2453. X133.5        Fukuoka-WIDE-JP
  2454. X131.206        Fukuoka-WIDE-JP
  2455. X133.130        Fukuoka-WIDE-JP
  2456. X133.37        Fukuoka-WIDE-JP
  2457. X133.17        Fukuoka-WIDE-JP
  2458. X133.94        Fukuoka-WIDE-JP
  2459. X150.43        Fukuoka-WIDE-JP
  2460. X133.22        Fukuoka-WIDE-JP
  2461. X#
  2462. X# US: United States
  2463. X#
  2464. X128.174        Illinois-XXX-US        # uiuc.edu
  2465. X128.146        Ohio-XXX-US        # ohio-state.edu
  2466. X128.196        Arizona-XXX-US        # arizona.edu
  2467. X35        Michigan-XXX-US        # umich.edu
  2468. X141.211        Michigan-XXX-US        # umich.edu
  2469. X129.79        Indiana-XXX-US        # indiana.edu
  2470. X128.32        California-XXX-US    # berkeley.edu
  2471. X128.114        California-XXX-US    # ucsc.edu
  2472. X128.200        California-XXX-US    # uci.edu
  2473. X128.54        California-XXX-US    # ucsd.edu
  2474. X132.239        California-XXX-US    # ucsd.edu
  2475. X36        California-XXX-US    # stanford.edu
  2476. X128.9        California-XXX-US    # isi.edu
  2477. X26        California-XXX-US    # isi.edu
  2478. X128.125        California-XXX-US    # usc.edu
  2479. X128.223        Oregon-XXX-US        # uoregon.edu
  2480. X#
  2481. X# US unresolved (where is it?)
  2482. X#
  2483. X128.210        XXX-XXX-US        # purdue.edu
  2484. X128.59        NY-XXX-US        # columbia.edu
  2485. X198.41.0    XXX-XXX-US        # internic.net
  2486. X128.252        XXX-XXX-US        # wustl.edu
  2487. X16        XXX-XXX-US        # dec.com
  2488. X18        XXX-XXX-US        # mit.edu
  2489. X128.52        XXX-XXX-US        # mit.edu
  2490. X128.2        XXX-XXX-US        # cmu.edu
  2491. X198.112.44    XXX-XXX-US        # x.org
  2492. X152.2        XXX-XXX-US        # unc.edu
  2493. END_OF_FILE
  2494.   if test 3815 -ne `wc -c <'gtr/gtr.txt'`; then
  2495.     echo shar: \"'gtr/gtr.txt'\" unpacked with wrong size!
  2496.   fi
  2497.   # end of 'gtr/gtr.txt'
  2498. fi
  2499. if test -f 'libww/libww.h' -a "${1}" != "-c" ; then 
  2500.   echo shar: Will not clobber existing file \"'libww/libww.h'\"
  2501. else
  2502.   echo shar: Extracting \"'libww/libww.h'\" \(3524 characters\)
  2503.   sed "s/^X//" >'libww/libww.h' <<'END_OF_FILE'
  2504. X/* $Header: libww.h[109.0] Wed Nov 24 03:49:15 1993 youki-k@is.aist-nara.ac.jp saved $ */
  2505. X/* 
  2506. X * WorldWide File System
  2507. X * Copyright (c) 1992,1993 Youki Kadobayashi
  2508. X * Copyright (c) 1992,1993 Osaka University
  2509. X * All rights reserved.
  2510. X *
  2511. X * Permission to use, copy, modify and distribute this software and its
  2512. X * documentation is hereby granted, provided that the following conditions
  2513. X * are met:
  2514. X * 1. Both the copyright notice and this permission notice appear in
  2515. X *    all copies of the software, derivative works or modified versions,
  2516. X *    and any portions thereof, and that both notices appear in
  2517. X *    supporting documentation.
  2518. X * 2. All advertising materials mentioning features or use of this software
  2519. X *    must display the following acknowledgement:
  2520. X *      This product includes software developed by the Osaka University
  2521. X *      and its contributors.
  2522. X * 3. Neither the name of the University nor the names of its contributors
  2523. X *    may be used to endorse or promote products derived from this software
  2524. X *    without specific prior written permission.
  2525. X *
  2526. X * THIS SOFTWARE IS PROVIDED BY THE DEVELOPER ``AS IS'' AND OSAKA
  2527. X * UNIVERSITY DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY DAMAGES
  2528. X * WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
  2529. X *
  2530. X * Osaka University requests users of this software to return to
  2531. X *
  2532. X *  Youki Kadobayashi
  2533. X *  Department of Information and Computer Sciences
  2534. X *  Osaka University, Toyonaka 560, Osaka, Japan
  2535. X *
  2536. X * any improvements or extensions that they make and grant Osaka
  2537. X * University the rights to redistribute these changes.
  2538. X */
  2539. X/*
  2540. X * libww: WWFS Application Programming Interface.
  2541. X * This file is part of WWFS, the WorldWide File System.
  2542. X *
  2543. X * You do not want to include this file if you have spliced libc routines
  2544. X * in libc_wwfs.a and you are planning to link your program with it.
  2545. X */
  2546. X
  2547. X#ifndef    __LIBWW_H__
  2548. X#define    __LIBWW_H__    1
  2549. X
  2550. X#define    UIP_BLOCK    1    /* arg: (int *), on=1, off=0. default=off */
  2551. X#define    UIP_PROGRESS    2    /* arg: (int *), on=1, off=0. default=off */
  2552. X
  2553. X#ifdef    LIBWW            /* libww itself */
  2554. X
  2555. X#ifdef    RENAME_LIBC        /* If renamesym works */
  2556. X#define    ww_open        open
  2557. X#define    ww_fopen    fopen
  2558. X#define    ww_opendir    opendir
  2559. X#else    /* RENAME_LIBC */    /* If renamesym doesn't work */
  2560. X#define    Open    open
  2561. X#define    Fopen    fopen
  2562. X#define    Opendir    opendir
  2563. X#endif    /* RENAME_LIBC */
  2564. X
  2565. X#else    /* LIBWW */        /* libww clients */
  2566. X/*
  2567. X * the following definitions is only useful if libc splicing hack
  2568. X * does not work.
  2569. X */
  2570. X#define    open    ww_open
  2571. X#define    fopen    ww_fopen
  2572. X#define    opendir    ww_opendir
  2573. X
  2574. Xextern    int    ww_errno;
  2575. X#endif    /* LIBWW */
  2576. X
  2577. X#ifndef __CEXTRACT__
  2578. X#if __STDC__
  2579. X
  2580. Xextern char * ww_path ( char *path );
  2581. Xextern char * ww_localpath ( char *path );
  2582. Xextern int ww_control ( int optname, void *optval );
  2583. Xextern int ww_get ( char *subpath );
  2584. Xextern int ww_nfsget ( char *path );
  2585. X#ifndef LIBWW
  2586. Xextern int ww_open ( char *path, int flags, ... );
  2587. X#endif
  2588. X#ifdef FILE
  2589. Xextern FILE * ww_fopen (char *filename, char *mode);
  2590. X#endif
  2591. X#ifdef DIR
  2592. Xextern DIR * ww_opendir (char *filename);
  2593. X#endif
  2594. X
  2595. X#else /* __STDC__ */
  2596. X
  2597. Xextern char * ww_path (/* char *path */);
  2598. Xextern char * ww_localpath (/* char *path */);
  2599. Xextern int ww_control (/* int optname, void *optval */);
  2600. Xextern int ww_get (/* char *subpath */);
  2601. Xextern int ww_nfsget (/* char *path */);
  2602. Xextern int ww_open (/* char *path, int flags, ... */);
  2603. X#ifdef FILE
  2604. Xextern FILE * ww_fopen (/* char *filename, char *mode */);
  2605. X#endif
  2606. X#ifdef DIR
  2607. Xextern DIR * ww_opendir (/* char *filename */);
  2608. X#endif
  2609. X
  2610. X#endif /* __STDC__ */
  2611. X#endif /* __CEXTRACT__ */
  2612. X
  2613. X#endif    /* !__LIBWW_H__ */
  2614. X
  2615. END_OF_FILE
  2616.   if test 3524 -ne `wc -c <'libww/libww.h'`; then
  2617.     echo shar: \"'libww/libww.h'\" unpacked with wrong size!
  2618.   fi
  2619.   # end of 'libww/libww.h'
  2620. fi
  2621. if test -f 'mosaic/urlrename.pl' -a "${1}" != "-c" ; then 
  2622.   echo shar: Will not clobber existing file \"'mosaic/urlrename.pl'\"
  2623. else
  2624.   echo shar: Extracting \"'mosaic/urlrename.pl'\" \(3576 characters\)
  2625.   sed "s/^X//" >'mosaic/urlrename.pl' <<'END_OF_FILE'
  2626. X#!/usr/local/bin/perl
  2627. X#
  2628. X$usg = "urlrename: Rename URLs using perl expression.
  2629. X             Intended as a postprocessing filter for \"htget.pl\".
  2630. X
  2631. XUsage:    urlrename [-d <dir>] [-pr] <perl expression> <files...>
  2632. X    -d <dir>    -- directory to save renamed pages
  2633. X    -p        -- pipe. take filenames from standard input
  2634. X    -r        -- recursively process files.
  2635. X    -v        -- verbose.
  2636. XExample: urlrename -r 's|http://info.cern.ch:80|wwfs:/cern-web|' .
  2637. X";
  2638. X# Author: Youki Kadobayashi <youki@wide.ad.jp>
  2639. X#
  2640. X
  2641. Xrequire '/etc/csd.pl';
  2642. Xunshift(@INC, "$WWFSDIR/lib");
  2643. Xrequire 'url.pl';
  2644. Xrequire 'dirutil.pl';
  2645. Xrequire 'find.pl';
  2646. X
  2647. Xrequire 'getopts.pl';
  2648. Xdo Getopts('d:prv');
  2649. X$prefix = $opt_d ? $opt_d : "../url_renamed";
  2650. Xif ($opt_r && $opt_d !~ m|^/|) {
  2651. X    die "Directory for -d must be absolute path if using -r option.\n";
  2652. X}
  2653. X
  2654. Xif ($#ARGV < $[) {
  2655. X    die $usg;
  2656. X}
  2657. X
  2658. X$/ = '>';    # input record separator
  2659. X$expr = shift @ARGV;
  2660. Xif ($opt_r) {
  2661. X    die $usg if $opt_p;
  2662. X
  2663. X    foreach $file (@ARGV) {
  2664. X        &find($file);
  2665. X    }
  2666. X} else {
  2667. X    if ($opt_p) { chop ($_ = <STDIN>); push (@ARGV, $_); }
  2668. X    foreach $file (@ARGV) {
  2669. X        ($dir, $file) = &basename($file);
  2670. X        &urlrename($dir, $dir, $file);
  2671. X        if ($opt_p) { chop ($_ = <STDIN>); push (@ARGV, $_); }
  2672. X    }
  2673. X}
  2674. X
  2675. Xsub wanted {
  2676. X    return 1 unless (-f $_);
  2677. X    if (/^.*\.html$/) {
  2678. X        print STDERR "urlrename: $name\n" if $opt_v;
  2679. X        &urlrename(".", $dir, $_);
  2680. X    } elsif ($_ eq ".url") {
  2681. X        open(URL, $_);
  2682. X        $url = <URL>;
  2683. X        close(URL);
  2684. X
  2685. X        # keep new URL...
  2686. X        eval "\$url =~ $expr";
  2687. X        &mkdirhier("$prefix/$dir") || die "mkdir: $!\n";
  2688. X        open(URL, "> $prefix/$dir/.url") || die "new url: $!\n";
  2689. X        print URL $url;
  2690. X        close(URL);
  2691. X    } else {
  2692. X        print STDERR "mv: $name to $prefix/$name\n" if $opt_v;
  2693. X        rename($_, "$prefix/$name");
  2694. X    }
  2695. X    1;
  2696. X}
  2697. X
  2698. Xsub urlrename {
  2699. X    local ($reldir, $dir, $file) = @_;
  2700. X    local ($here, $header, $url, $trailer,
  2701. X           $type,$host,$port,$path,$req,
  2702. X           $thistype,$thishost, $thisport,$thispath);
  2703. X    # finddir goes mad if $_ gets modified
  2704. X    local ($_);
  2705. X
  2706. X    open(URL, "$reldir/.url") || die "$file: cannot map to url\n";
  2707. X    chop ($here = <URL>);
  2708. X    close(URL);
  2709. X    ($thistype,$thishost, $thisport, $thispath, $thisreq) =
  2710. X        &url'parse(undef,undef,undef,undef,$here);
  2711. X
  2712. X    &mkdirhier("$prefix/$dir") || die "mkdir: $!\n";
  2713. X    open(OUT, ">$prefix/$dir/$file") || die "$prefix/$dir/$file: $!\n";
  2714. X    select(OUT);
  2715. X    open(IN, "$reldir/$file") || die "$dir/$file: $!\n";
  2716. X    while (<IN>) {
  2717. X        if (/(<a[^>]*href\s*=\s*")([^"]+)("[^>]*>)/i) {
  2718. X            $header = $` . $1;
  2719. X            $url = $2;
  2720. X            $trailer = $3;
  2721. X
  2722. X            if ($url =~ m|/|) {
  2723. X                ($type,$host,$port,$path,$req) =
  2724. X                    &url'parse($thistype,$thishost,
  2725. X                        $thisport,$thispath,$url);
  2726. X                $url = "$type:";
  2727. X                $url .= "//$host" if (defined $host);
  2728. X                $url .= ":$port" if (defined $port);
  2729. X                $url .= $req;
  2730. X                if (eval "\$url =~ $expr" && $req =~ /\/$/) {
  2731. X                    $url .= "urlget_dir.html";
  2732. X                }
  2733. X                die $@ if $@;
  2734. X            }
  2735. X            print $header, $url, $trailer;
  2736. X            next;
  2737. X        }
  2738. X        if (/(<img[^>]*src\s*=\s*")([^"]+)("[^>]*>)/i) {
  2739. X            $header = $` . $1;
  2740. X            $url = $2;
  2741. X            $trailer = $3;
  2742. X
  2743. X            if ($url =~ m|/|) {
  2744. X                ($type,$host,$port,$path,$req) =
  2745. X                    &url'parse($thistype,$thishost,
  2746. X                           $thisport,$thispath,$url);
  2747. X                $url = "$type:";
  2748. X                $url .= "//$host" if (defined $host);
  2749. X                $url .= ":$port" if (defined $port);
  2750. X                $url .= $req;
  2751. X                eval "\$url =~ $expr";
  2752. X                die $@ if $@;
  2753. X            }
  2754. X            print $header, $url, $trailer;
  2755. X            next;
  2756. X        }
  2757. X        if (/<ISINDEX>/i) {
  2758. X            $header = $`;
  2759. X            # libhtmlw/HTMLformat.c told me...
  2760. X            print $header, "<ISINDEX ACTION=\"$here\">";
  2761. X            next;
  2762. X        }
  2763. X        print $_;
  2764. X    }
  2765. X    close(IN);
  2766. X    close(OUT);
  2767. X}
  2768. X
  2769. X# Local Variables:
  2770. X# mode: cperl
  2771. X# cperl-indent-level: 8
  2772. X# cperl-continued-statement-offset: 8
  2773. X# End:
  2774. END_OF_FILE
  2775.   if test 3576 -ne `wc -c <'mosaic/urlrename.pl'`; then
  2776.     echo shar: \"'mosaic/urlrename.pl'\" unpacked with wrong size!
  2777.   fi
  2778.   chmod +x 'mosaic/urlrename.pl'
  2779.   # end of 'mosaic/urlrename.pl'
  2780. fi
  2781. if test -f 'rpc/nfs_prot_svc.c' -a "${1}" != "-c" ; then 
  2782.   echo shar: Will not clobber existing file \"'rpc/nfs_prot_svc.c'\"
  2783. else
  2784.   echo shar: Extracting \"'rpc/nfs_prot_svc.c'\" \(3815 characters\)
  2785.   sed "s/^X//" >'rpc/nfs_prot_svc.c' <<'END_OF_FILE'
  2786. X/*
  2787. X * Please do not edit this file.
  2788. X * It was generated using rpcgen.
  2789. X */
  2790. X
  2791. X#include <stdio.h>
  2792. X#include <rpc/rpc.h>
  2793. X#include "util.h"
  2794. X#include "nfs_prot.h"
  2795. X#ifndef NFS_FH_DEFINED    /* nfs_fh has been declared in cs_prot.h */
  2796. X#define NFS_FH_DEFINED
  2797. X#endif
  2798. X
  2799. Xvoid
  2800. Xnfs_program_2(rqstp, transp)
  2801. X    struct svc_req *rqstp;
  2802. X    register SVCXPRT *transp;
  2803. X{
  2804. X    union {
  2805. X        nfs_fh nfsproc_getattr_2_arg;
  2806. X        sattrargs nfsproc_setattr_2_arg;
  2807. X        diropargs nfsproc_lookup_2_arg;
  2808. X        nfs_fh nfsproc_readlink_2_arg;
  2809. X        readargs nfsproc_read_2_arg;
  2810. X        writeargs nfsproc_write_2_arg;
  2811. X        createargs nfsproc_create_2_arg;
  2812. X        diropargs nfsproc_remove_2_arg;
  2813. X        renameargs nfsproc_rename_2_arg;
  2814. X        linkargs nfsproc_link_2_arg;
  2815. X        symlinkargs nfsproc_symlink_2_arg;
  2816. X        createargs nfsproc_mkdir_2_arg;
  2817. X        diropargs nfsproc_rmdir_2_arg;
  2818. X        readdirargs nfsproc_readdir_2_arg;
  2819. X        nfs_fh nfsproc_statfs_2_arg;
  2820. X    } argument;
  2821. X    char *result;
  2822. X    bool_t (*xdr_argument)(), (*xdr_result)();
  2823. X    char *(*local)();
  2824. X
  2825. X    switch (rqstp->rq_proc) {
  2826. X    case NFSPROC_NULL:
  2827. X        xdr_argument = xdr_void;
  2828. X        xdr_result = xdr_void;
  2829. X        local = (char *(*)()) nfsproc_null_2;
  2830. X        break;
  2831. X
  2832. X    case NFSPROC_GETATTR:
  2833. X        xdr_argument = xdr_nfs_fh;
  2834. X        xdr_result = xdr_attrstat;
  2835. X        local = (char *(*)()) nfsproc_getattr_2;
  2836. X        break;
  2837. X
  2838. X    case NFSPROC_SETATTR:
  2839. X        xdr_argument = xdr_sattrargs;
  2840. X        xdr_result = xdr_attrstat;
  2841. X        local = (char *(*)()) nfsproc_setattr_2;
  2842. X        break;
  2843. X
  2844. X    case NFSPROC_ROOT:
  2845. X        xdr_argument = xdr_void;
  2846. X        xdr_result = xdr_void;
  2847. X        local = (char *(*)()) nfsproc_root_2;
  2848. X        break;
  2849. X
  2850. X    case NFSPROC_LOOKUP:
  2851. X        xdr_argument = xdr_diropargs;
  2852. X        xdr_result = xdr_diropres;
  2853. X        local = (char *(*)()) nfsproc_lookup_2;
  2854. X        break;
  2855. X
  2856. X    case NFSPROC_READLINK:
  2857. X        xdr_argument = xdr_nfs_fh;
  2858. X        xdr_result = xdr_readlinkres;
  2859. X        local = (char *(*)()) nfsproc_readlink_2;
  2860. X        break;
  2861. X
  2862. X    case NFSPROC_READ:
  2863. X        xdr_argument = xdr_readargs;
  2864. X        xdr_result = xdr_readres;
  2865. X        local = (char *(*)()) nfsproc_read_2;
  2866. X        break;
  2867. X
  2868. X    case NFSPROC_WRITECACHE:
  2869. X        xdr_argument = xdr_void;
  2870. X        xdr_result = xdr_void;
  2871. X        local = (char *(*)()) nfsproc_writecache_2;
  2872. X        break;
  2873. X
  2874. X    case NFSPROC_WRITE:
  2875. X        xdr_argument = xdr_writeargs;
  2876. X        xdr_result = xdr_attrstat;
  2877. X        local = (char *(*)()) nfsproc_write_2;
  2878. X        break;
  2879. X
  2880. X    case NFSPROC_CREATE:
  2881. X        xdr_argument = xdr_createargs;
  2882. X        xdr_result = xdr_diropres;
  2883. X        local = (char *(*)()) nfsproc_create_2;
  2884. X        break;
  2885. X
  2886. X    case NFSPROC_REMOVE:
  2887. X        xdr_argument = xdr_diropargs;
  2888. X        xdr_result = xdr_nfsstat;
  2889. X        local = (char *(*)()) nfsproc_remove_2;
  2890. X        break;
  2891. X
  2892. X    case NFSPROC_RENAME:
  2893. X        xdr_argument = xdr_renameargs;
  2894. X        xdr_result = xdr_nfsstat;
  2895. X        local = (char *(*)()) nfsproc_rename_2;
  2896. X        break;
  2897. X
  2898. X    case NFSPROC_LINK:
  2899. X        xdr_argument = xdr_linkargs;
  2900. X        xdr_result = xdr_nfsstat;
  2901. X        local = (char *(*)()) nfsproc_link_2;
  2902. X        break;
  2903. X
  2904. X    case NFSPROC_SYMLINK:
  2905. X        xdr_argument = xdr_symlinkargs;
  2906. X        xdr_result = xdr_nfsstat;
  2907. X        local = (char *(*)()) nfsproc_symlink_2;
  2908. X        break;
  2909. X
  2910. X    case NFSPROC_MKDIR:
  2911. X        xdr_argument = xdr_createargs;
  2912. X        xdr_result = xdr_diropres;
  2913. X        local = (char *(*)()) nfsproc_mkdir_2;
  2914. X        break;
  2915. X
  2916. X    case NFSPROC_RMDIR:
  2917. X        xdr_argument = xdr_diropargs;
  2918. X        xdr_result = xdr_nfsstat;
  2919. X        local = (char *(*)()) nfsproc_rmdir_2;
  2920. X        break;
  2921. X
  2922. X    case NFSPROC_READDIR:
  2923. X        xdr_argument = xdr_readdirargs;
  2924. X        xdr_result = xdr_readdirres;
  2925. X        local = (char *(*)()) nfsproc_readdir_2;
  2926. X        break;
  2927. X
  2928. X    case NFSPROC_STATFS:
  2929. X        xdr_argument = xdr_nfs_fh;
  2930. X        xdr_result = xdr_statfsres;
  2931. X        local = (char *(*)()) nfsproc_statfs_2;
  2932. X        break;
  2933. X
  2934. X    default:
  2935. X        svcerr_noproc(transp);
  2936. X        return;
  2937. X    }
  2938. X    bzero((char *)&argument, sizeof(argument));
  2939. X    if (!svc_getargs(transp, xdr_argument, &argument)) {
  2940. X        svcerr_decode(transp);
  2941. X        return;
  2942. X    }
  2943. X    result = (*local)(&argument, rqstp);
  2944. X    if (result != NULL && !svc_sendreply(transp, xdr_result, result)) {
  2945. X        svcerr_systemerr(transp);
  2946. X    }
  2947. X    if (!svc_freeargs(transp, xdr_argument, &argument)) {
  2948. X        dlog( "unable to free arguments");
  2949. X        csd_abort(1);
  2950. X    }
  2951. X    return;
  2952. X}
  2953. END_OF_FILE
  2954.   if test 3815 -ne `wc -c <'rpc/nfs_prot_svc.c'`; then
  2955.     echo shar: \"'rpc/nfs_prot_svc.c'\" unpacked with wrong size!
  2956.   fi
  2957.   # end of 'rpc/nfs_prot_svc.c'
  2958. fi
  2959. echo shar: End of archive 18 \(of 22\).
  2960. cp /dev/null ark18isdone
  2961. MISSING=""
  2962. for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 ; do
  2963.     if test ! -f ark${I}isdone ; then
  2964.     MISSING="${MISSING} ${I}"
  2965.     fi
  2966. done
  2967. if test "${MISSING}" = "" ; then
  2968.     echo You have unpacked all 22 archives.
  2969.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  2970. else
  2971.     echo You still must unpack the following archives:
  2972.     echo "        " ${MISSING}
  2973. fi
  2974. exit 0
  2975. exit 0 # Just in case...
  2976.