├── usr ├── src │ ├── sun │ │ ├── sys │ │ │ ├── rpc │ │ │ ├── conf │ │ │ │ ├── devices.vax │ │ │ │ └── param.c │ │ │ ├── h │ │ │ │ ├── seg.h │ │ │ │ ├── timeb.h │ │ │ │ ├── un.h │ │ │ │ ├── msgbuf.h │ │ │ │ ├── times.h │ │ │ │ ├── clist.h │ │ │ │ ├── domain.h │ │ │ │ ├── vmparam.h │ │ │ │ ├── uio.h │ │ │ │ ├── vcmd.h │ │ │ │ ├── vm.h │ │ │ │ ├── dk.h │ │ │ │ ├── vadvise.h │ │ │ │ ├── bk.h │ │ │ │ ├── vlimit.h │ │ │ │ ├── callout.h │ │ │ │ ├── kernel.h │ │ │ │ ├── mman.h │ │ │ │ ├── dmap.h │ │ │ │ ├── ttydev.h │ │ │ │ ├── dnlc.h │ │ │ │ ├── reboot.h │ │ │ │ ├── vtimes.h │ │ │ │ ├── stat.h │ │ │ │ ├── pathname.h │ │ │ │ ├── types.h │ │ │ │ ├── acct.h │ │ │ │ ├── des.h │ │ │ │ ├── text.h │ │ │ │ ├── ttychars.h │ │ │ │ ├── time.h │ │ │ │ ├── conf.h │ │ │ │ ├── unpcb.h │ │ │ │ ├── dkbad.h │ │ │ │ ├── vmsystm.h │ │ │ │ ├── cmap.h │ │ │ │ ├── map.h │ │ │ │ └── resource.h │ │ │ ├── netinet │ │ │ │ ├── udp.h │ │ │ │ ├── tcp_debug.h │ │ │ │ ├── udp_var.h │ │ │ │ ├── in_systm.h │ │ │ │ ├── tcpip.h │ │ │ │ ├── icmp_var.h │ │ │ │ ├── tcp_seq.h │ │ │ │ ├── tcp.h │ │ │ │ ├── in_pcb.h │ │ │ │ └── tcp_fsm.h │ │ │ ├── netpup │ │ │ │ ├── ether.h │ │ │ │ ├── pup.c │ │ │ │ ├── pup_proto.c │ │ │ │ ├── pup.h │ │ │ │ └── raw_ether.c │ │ │ ├── ufs │ │ │ │ └── mount.h │ │ │ ├── net │ │ │ │ ├── af.h │ │ │ │ ├── af.c │ │ │ │ ├── netisr.h │ │ │ │ ├── raw_cb.h │ │ │ │ └── route.h │ │ │ ├── vax │ │ │ │ ├── reg.h │ │ │ │ └── param.h │ │ │ ├── sys │ │ │ │ ├── uipc_pipe.c │ │ │ │ ├── uipc_proto.c │ │ │ │ ├── vm_mon.c │ │ │ │ ├── tty_tty.c │ │ │ │ ├── kern_proc.c │ │ │ │ └── vfs_dev.c │ │ │ ├── nfs │ │ │ │ ├── nfs_clnt.h │ │ │ │ └── rnode.h │ │ │ └── vaxif │ │ │ │ ├── if_il.h │ │ │ │ └── if_ecreg.h │ │ └── doc │ │ │ ├── c0.cover.pdf │ │ │ ├── c7.yp.spec.pdf │ │ │ ├── c1.nfs.intro.pdf │ │ │ ├── c2.net.svcs.pdf │ │ │ ├── c3.rpc.prog.pdf │ │ │ ├── c4.xdr.spec.pdf │ │ │ ├── c5.rpc.spec.pdf │ │ │ ├── c6.nfs.spec.pdf │ │ │ ├── c8.ipc.prim.pdf │ │ │ ├── c9.net.impl.pdf │ │ │ ├── sysadmin.doc.pdf │ │ │ ├── mkfile │ │ │ ├── READ_ME │ │ │ ├── sunhead.ms │ │ │ └── c0.cover │ ├── include │ │ ├── setjmp.h │ │ ├── lastlog.h │ │ ├── grp.h │ │ ├── varargs.h │ │ ├── arpa │ │ │ ├── inet.h │ │ │ ├── tftp.h │ │ │ └── ftp.h │ │ ├── mtab.h │ │ ├── ar.h │ │ ├── rpcsvc │ │ │ ├── netwall.h │ │ │ ├── rusers.h │ │ │ ├── yppasswd.h │ │ │ ├── mount.h │ │ │ ├── rstat.h │ │ │ └── ypclnt.h │ │ ├── strings.h │ │ ├── pwd.h │ │ ├── utmp.h │ │ ├── struct.h │ │ ├── assert.h │ │ ├── time.h │ │ ├── vfont.h │ │ ├── math.h │ │ ├── pascal │ │ │ ├── unixio.h │ │ │ └── unixio.i │ │ ├── sgtty.h │ │ ├── dbm.h │ │ ├── ranlib.h │ │ ├── disktab.h │ │ ├── mp.h │ │ ├── ctype.h │ │ ├── fcntl.h │ │ ├── stdio.h │ │ ├── fstab.h │ │ ├── nlist.h │ │ ├── dumprestor.h │ │ ├── netdb.h │ │ ├── mntent.h │ │ └── stab.h │ ├── lib │ │ └── libc │ │ │ ├── rpc │ │ │ ├── unifdef.sh │ │ │ ├── svc_auth.h │ │ │ ├── types.h │ │ │ ├── rpc.h │ │ │ ├── auth_unix.h │ │ │ ├── pmap_clnt.h │ │ │ ├── disclaimer │ │ │ ├── pmap_getmaps.c │ │ │ ├── pmap_getport.c │ │ │ ├── clnt_simple.c │ │ │ └── xdr_reference.c │ │ │ ├── sys │ │ │ ├── getfh.c │ │ │ ├── fstatfs.c │ │ │ ├── statfs.c │ │ │ ├── unmount.c │ │ │ ├── getdirentries.c │ │ │ ├── nfssvc.c │ │ │ ├── nfsmount.c │ │ │ ├── async_daemon.c │ │ │ ├── setdomainname.c │ │ │ ├── getdomainname.c │ │ │ └── SYS.h │ │ │ ├── rpcsvc │ │ │ ├── netwall.h │ │ │ ├── rusers.h │ │ │ ├── yppasswd.h │ │ │ ├── yppasswdxdr.c │ │ │ ├── mount.h │ │ │ ├── Makefile │ │ │ ├── rstat.h │ │ │ ├── ypprot_err.c │ │ │ ├── ypclnt.h │ │ │ ├── rusersxdr.c │ │ │ └── yp_match.c │ │ │ ├── gen │ │ │ ├── telldir.c │ │ │ ├── closedir.c │ │ │ ├── seekdir.c │ │ │ ├── readdir.c │ │ │ ├── opendir.c │ │ │ └── Makefile │ │ │ ├── net │ │ │ └── Makefile │ │ │ ├── vax │ │ │ └── Makefile │ │ │ └── Makefile │ ├── usr.lib │ │ └── libdbm │ │ │ ├── Makefile │ │ │ └── dbm.h │ ├── ucb │ │ └── netstat │ │ │ ├── Makefile │ │ │ └── host.c │ ├── Makefile │ ├── bin │ │ └── domainname.c │ ├── etc │ │ ├── biod.c │ │ ├── yp │ │ │ └── stdhosts.c │ │ ├── dump │ │ │ └── dumprestor.h │ │ └── fsck │ │ │ └── Makefile │ └── usr.etc │ │ └── rpc.rwalld.c └── man │ ├── man8 │ ├── rstatd.8c │ ├── rwalld.8c │ ├── fsirand.8 │ ├── mountd.8c │ ├── rpcinfo.8 │ ├── nfsd.8c │ ├── portmap.8c │ ├── showmount.8 │ ├── ypmake.8 │ ├── ypwhich.8 │ ├── yppasswdd.8c │ └── nfsstat.8 │ ├── man1 │ ├── domainname.1 │ ├── rwall.1 │ └── yppasswd.1 │ ├── man2 │ ├── nfssvc.2 │ ├── unmount.2 │ ├── statfs.2 │ ├── getdomainname.2 │ └── nfsmount.2 │ ├── man5 │ ├── netgroup.5 │ ├── exports.5 │ ├── rmtab.5 │ ├── servers.5 │ └── group.5 │ └── man3 │ └── getnetgrent.3n ├── TIMESTAMP ├── release.pdf ├── README.md ├── nfs.2.0.src.txt ├── mkfile └── samples ├── servers ├── services └── rc.local /usr/src/sun/sys/rpc: -------------------------------------------------------------------------------- 1 | ../../lib/libc/rpc -------------------------------------------------------------------------------- /TIMESTAMP: -------------------------------------------------------------------------------- 1 | 1-2 2 | 4-20 3 | 22-29 4 | 32-38 5 | 41 6 | -------------------------------------------------------------------------------- /release.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rsc/nfs/main/release.pdf -------------------------------------------------------------------------------- /usr/src/include/setjmp.h: -------------------------------------------------------------------------------- 1 | /* setjmp.h 4.1 83/05/03 */ 2 | 3 | typedef int jmp_buf[10]; 4 | -------------------------------------------------------------------------------- /usr/src/sun/doc/c0.cover.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rsc/nfs/main/usr/src/sun/doc/c0.cover.pdf -------------------------------------------------------------------------------- /usr/src/sun/doc/c7.yp.spec.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rsc/nfs/main/usr/src/sun/doc/c7.yp.spec.pdf -------------------------------------------------------------------------------- /usr/src/sun/doc/c1.nfs.intro.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rsc/nfs/main/usr/src/sun/doc/c1.nfs.intro.pdf -------------------------------------------------------------------------------- /usr/src/sun/doc/c2.net.svcs.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rsc/nfs/main/usr/src/sun/doc/c2.net.svcs.pdf -------------------------------------------------------------------------------- /usr/src/sun/doc/c3.rpc.prog.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rsc/nfs/main/usr/src/sun/doc/c3.rpc.prog.pdf -------------------------------------------------------------------------------- /usr/src/sun/doc/c4.xdr.spec.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rsc/nfs/main/usr/src/sun/doc/c4.xdr.spec.pdf -------------------------------------------------------------------------------- /usr/src/sun/doc/c5.rpc.spec.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rsc/nfs/main/usr/src/sun/doc/c5.rpc.spec.pdf -------------------------------------------------------------------------------- /usr/src/sun/doc/c6.nfs.spec.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rsc/nfs/main/usr/src/sun/doc/c6.nfs.spec.pdf -------------------------------------------------------------------------------- /usr/src/sun/doc/c8.ipc.prim.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rsc/nfs/main/usr/src/sun/doc/c8.ipc.prim.pdf -------------------------------------------------------------------------------- /usr/src/sun/doc/c9.net.impl.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rsc/nfs/main/usr/src/sun/doc/c9.net.impl.pdf -------------------------------------------------------------------------------- /usr/src/sun/doc/sysadmin.doc.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rsc/nfs/main/usr/src/sun/doc/sysadmin.doc.pdf -------------------------------------------------------------------------------- /usr/src/sun/sys/conf/devices.vax: -------------------------------------------------------------------------------- 1 | hp 0 2 | up 2 3 | hk 3 4 | rk 3 5 | ra 9 6 | rb 11 7 | rx 12 8 | rl 14 9 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | NFS Release 2.0 \ 2 | December 16, 1985 3 | 4 | Downloaded from . 5 | -------------------------------------------------------------------------------- /usr/src/lib/libc/rpc/unifdef.sh: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | # 3 | # @(#)unifdef.sh 1.1 85/05/30 SMI; 4 | # 5 | unifdef $* 6 | exit 0 7 | -------------------------------------------------------------------------------- /usr/src/lib/libc/sys/getfh.c: -------------------------------------------------------------------------------- 1 | /* @(#)getfh.c 1.1 85/05/30 SMI */ 2 | 3 | #include "SYS.h" 4 | 5 | SYSCALL(getfh) 6 | RET 7 | -------------------------------------------------------------------------------- /usr/src/lib/libc/sys/fstatfs.c: -------------------------------------------------------------------------------- 1 | /* @(#)fstatfs.c 1.1 85/05/30 SMI */ 2 | 3 | #include "SYS.h" 4 | 5 | SYSCALL(fstatfs) 6 | RET 7 | -------------------------------------------------------------------------------- /usr/src/lib/libc/sys/statfs.c: -------------------------------------------------------------------------------- 1 | /* @(#)statfs.c 1.1 85/05/30 SMI */ 2 | 3 | #include "SYS.h" 4 | 5 | SYSCALL(statfs) 6 | RET 7 | -------------------------------------------------------------------------------- /usr/src/lib/libc/sys/unmount.c: -------------------------------------------------------------------------------- 1 | /* @(#)unmount.c 1.1 85/05/30 SMI */ 2 | 3 | #include "SYS.h" 4 | 5 | SYSCALL(unmount) 6 | RET 7 | -------------------------------------------------------------------------------- /usr/src/lib/libc/sys/getdirentries.c: -------------------------------------------------------------------------------- 1 | /* @(#)getdirentries.c 1.1 85/05/30 SMI */ 2 | 3 | #include "SYS.h" 4 | 5 | SYSCALL(getdirentries) 6 | RET 7 | -------------------------------------------------------------------------------- /usr/src/lib/libc/sys/nfssvc.c: -------------------------------------------------------------------------------- 1 | /* @(#)nfssvc.c 1.1 85/05/30 SMI; from UCB 4.1 82/12/04 */ 2 | 3 | #include "SYS.h" 4 | 5 | SYSCALL(nfssvc) 6 | RET 7 | -------------------------------------------------------------------------------- /usr/src/lib/libc/sys/nfsmount.c: -------------------------------------------------------------------------------- 1 | /* @(#)nfsmount.c 1.1 85/05/30 SMI; from UCB 4.1 82/12/04 */ 2 | 3 | #include "SYS.h" 4 | 5 | SYSCALL(nfsmount) 6 | RET 7 | -------------------------------------------------------------------------------- /usr/src/lib/libc/sys/async_daemon.c: -------------------------------------------------------------------------------- 1 | /* @(#)async_daemon.c 1.1 85/05/30 SMI; from UCB 4.1 82/12/04 */ 2 | 3 | #include "SYS.h" 4 | 5 | SYSCALL(async_daemon) 6 | RET 7 | -------------------------------------------------------------------------------- /usr/src/include/lastlog.h: -------------------------------------------------------------------------------- 1 | /* lastlog.h 4.2 83/05/22 */ 2 | 3 | struct lastlog { 4 | time_t ll_time; 5 | char ll_line[8]; 6 | char ll_host[16]; /* same as in utmp */ 7 | }; 8 | -------------------------------------------------------------------------------- /usr/src/lib/libc/sys/setdomainname.c: -------------------------------------------------------------------------------- 1 | /* @(#)setdomainname.c 1.1 85/05/30 SMI */ 2 | 3 | #include "SYS.h" 4 | 5 | SYSCALL(setdomainname) 6 | RET /* setdomainname(name, len) */ 7 | -------------------------------------------------------------------------------- /usr/src/lib/libc/sys/getdomainname.c: -------------------------------------------------------------------------------- 1 | /* @(#)getdomainname.c 1.1 85/05/30 SMI */ 2 | 3 | #include "SYS.h" 4 | 5 | SYSCALL(getdomainname) 6 | RET /* len = getdomainname(buf, buflen) */ 7 | -------------------------------------------------------------------------------- /nfs.2.0.src.txt: -------------------------------------------------------------------------------- 1 | Notes for NFS Release 2.0 2 | December 16, 1985 3 | 4 | The 2.0 release is the first release of Sun's implementation 5 | of the Network File System (NFS) to non-Sun developers. 6 | -------------------------------------------------------------------------------- /usr/src/sun/sys/h/seg.h: -------------------------------------------------------------------------------- 1 | /* @(#)seg.h 1.1 85/05/30 SMI; from UCB 4.2 81/02/19 */ 2 | 3 | /* 4 | * Mapper addresses and bits 5 | */ 6 | 7 | #define RO PG_URKR /* access abilities */ 8 | #define RW PG_UW 9 | -------------------------------------------------------------------------------- /usr/src/include/grp.h: -------------------------------------------------------------------------------- 1 | /* grp.h 4.1 83/05/03 */ 2 | 3 | struct group { /* see getgrent(3) */ 4 | char *gr_name; 5 | char *gr_passwd; 6 | int gr_gid; 7 | char **gr_mem; 8 | }; 9 | 10 | struct group *getgrent(), *getgrgid(), *getgrnam(); 11 | -------------------------------------------------------------------------------- /mkfile: -------------------------------------------------------------------------------- 1 | ALL=release.pdf 2 | 3 | all:V: $ALL 4 | 5 | %.pdf: %.ms 6 | cat $stem.ms | pic | tbl | eqn | troff -ms usr/src/sun/doc/sunhead.ms - | dpost >$stem.ps 7 | ps2pdf $stem.ps $stem.pdf 8 | rm $stem.ps 9 | 10 | clean:V: 11 | rm -f *.ps *.pdf 12 | -------------------------------------------------------------------------------- /usr/src/include/varargs.h: -------------------------------------------------------------------------------- 1 | /* varargs.h 4.1 83/05/03 */ 2 | 3 | typedef char *va_list; 4 | # define va_dcl int va_alist; 5 | # define va_start(list) list = (char *) &va_alist 6 | # define va_end(list) 7 | # define va_arg(list,mode) ((mode *)(list += sizeof(mode)))[-1] 8 | -------------------------------------------------------------------------------- /usr/src/include/arpa/inet.h: -------------------------------------------------------------------------------- 1 | /* inet.h 4.1 83/05/28 */ 2 | 3 | /* 4 | * External definitions for 5 | * functions in inet(3N) 6 | */ 7 | struct in_addr inet_addr(); 8 | char *inet_ntoa(); 9 | struct in_addr inet_makeaddr(); 10 | unsigned long inet_network(); 11 | -------------------------------------------------------------------------------- /usr/src/sun/sys/h/timeb.h: -------------------------------------------------------------------------------- 1 | /* @(#)timeb.h 1.1 85/05/30 SMI; from UCB 4.2 81/02/19 */ 2 | 3 | /* 4 | * Structure returned by ftime system call 5 | */ 6 | struct timeb 7 | { 8 | time_t time; 9 | unsigned short millitm; 10 | short timezone; 11 | short dstflag; 12 | }; 13 | -------------------------------------------------------------------------------- /usr/src/include/mtab.h: -------------------------------------------------------------------------------- 1 | /* mtab.h 4.4 83/05/28 */ 2 | 3 | /* 4 | * Mounted device accounting file. 5 | */ 6 | struct mtab { 7 | char m_path[32]; /* mounted on pathname */ 8 | char m_dname[32]; /* block device pathname */ 9 | char m_type[4]; /* read-only, quotas */ 10 | }; 11 | -------------------------------------------------------------------------------- /usr/src/lib/libc/rpc/svc_auth.h: -------------------------------------------------------------------------------- 1 | /* @(#)svc_auth.h 1.1 85/05/30 SMI */ 2 | 3 | /* 4 | * svc_auth.h, Service side of rpc authentication. 5 | * 6 | * Copyright (C) 1984, Sun Microsystems, Inc. 7 | */ 8 | 9 | 10 | /* 11 | * Server side authenticator 12 | */ 13 | extern enum auth_stat _authenticate(); 14 | -------------------------------------------------------------------------------- /usr/src/sun/sys/h/un.h: -------------------------------------------------------------------------------- 1 | /* @(#)un.h 1.1 85/05/30 SMI; from UCB 5.3 83/06/13 */ 2 | 3 | /* 4 | * Definitions for UNIX IPC domain. 5 | */ 6 | struct sockaddr_un { 7 | short sun_family; /* AF_UNIX */ 8 | char sun_path[109]; /* path name (gag) */ 9 | }; 10 | 11 | #ifdef KERNEL 12 | int unp_discard(); 13 | #endif 14 | -------------------------------------------------------------------------------- /usr/src/include/ar.h: -------------------------------------------------------------------------------- 1 | /* ar.h 4.1 83/05/03 */ 2 | 3 | #define ARMAG "!\n" 4 | #define SARMAG 8 5 | 6 | #define ARFMAG "`\n" 7 | 8 | struct ar_hdr { 9 | char ar_name[16]; 10 | char ar_date[12]; 11 | char ar_uid[6]; 12 | char ar_gid[6]; 13 | char ar_mode[8]; 14 | char ar_size[10]; 15 | char ar_fmag[2]; 16 | }; 17 | -------------------------------------------------------------------------------- /usr/src/sun/sys/h/msgbuf.h: -------------------------------------------------------------------------------- 1 | /* @(#)msgbuf.h 1.1 85/05/30 SMI; from UCB 4.3 81/08/30 */ 2 | 3 | #define MSG_MAGIC 0x063060 4 | #define MSG_BSIZE (2048 - 2 * sizeof (long)) 5 | struct msgbuf { 6 | long msg_magic; 7 | long msg_bufx; 8 | char msg_bufc[MSG_BSIZE]; 9 | }; 10 | #ifdef KERNEL 11 | struct msgbuf msgbuf; 12 | #endif 13 | -------------------------------------------------------------------------------- /usr/src/include/rpcsvc/netwall.h: -------------------------------------------------------------------------------- 1 | /* @(#)netwall.h 1.1 85/05/30 Copyr 1984 Sun Micro */ 2 | 3 | /* 4 | * Copyright (c) 1984 by Sun Microsystems, Inc. 5 | */ 6 | 7 | #define WALLPROG 100008 8 | #define WALLPROC_CONSOLE 1 9 | #define WALLPROC_WALL 2 10 | #define WALLVERS_ORIG 1 11 | #define WALLVERS 1 12 | 13 | int xdr_path(); 14 | -------------------------------------------------------------------------------- /usr/src/lib/libc/rpcsvc/netwall.h: -------------------------------------------------------------------------------- 1 | /* @(#)netwall.h 1.1 85/05/30 Copyr 1984 Sun Micro */ 2 | 3 | /* 4 | * Copyright (c) 1984 by Sun Microsystems, Inc. 5 | */ 6 | 7 | #define WALLPROG 100008 8 | #define WALLPROC_CONSOLE 1 9 | #define WALLPROC_WALL 2 10 | #define WALLVERS_ORIG 1 11 | #define WALLVERS 1 12 | 13 | int xdr_path(); 14 | -------------------------------------------------------------------------------- /usr/src/include/strings.h: -------------------------------------------------------------------------------- 1 | /* string.h 4.1 83/05/26 */ 2 | 3 | /* 4 | * External function definitions 5 | * for routines described in string(3). 6 | */ 7 | char *strcat(); 8 | char *strncat(); 9 | int strcmp(); 10 | int strncmp(); 11 | char *strcpy(); 12 | char *strncpy(); 13 | int strlen(); 14 | char *index(); 15 | char *rindex(); 16 | -------------------------------------------------------------------------------- /usr/src/include/pwd.h: -------------------------------------------------------------------------------- 1 | /* pwd.h 4.1 83/05/03 */ 2 | 3 | struct passwd { /* see getpwent(3) */ 4 | char *pw_name; 5 | char *pw_passwd; 6 | int pw_uid; 7 | int pw_gid; 8 | int pw_quota; 9 | char *pw_comment; 10 | char *pw_gecos; 11 | char *pw_dir; 12 | char *pw_shell; 13 | }; 14 | 15 | struct passwd *getpwent(), *getpwuid(), *getpwnam(); 16 | -------------------------------------------------------------------------------- /usr/src/include/utmp.h: -------------------------------------------------------------------------------- 1 | /* utmp.h 4.2 83/05/22 */ 2 | 3 | /* 4 | * Structure of utmp and wtmp files. 5 | * 6 | * Assuming the number 8 is unwise. 7 | */ 8 | struct utmp { 9 | char ut_line[8]; /* tty name */ 10 | char ut_name[8]; /* user id */ 11 | char ut_host[16]; /* host name, if remote */ 12 | long ut_time; /* time on */ 13 | }; 14 | -------------------------------------------------------------------------------- /usr/src/usr.lib/libdbm/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # @(#)Makefile 1.1 85/05/31 SMI; from UCB 4.1 83/06/27 3 | # 4 | CFLAGS=-O 5 | 6 | libdbm.a: dbm.o 7 | mv dbm.o libdbm.a 8 | 9 | dbm.o : dbm.h 10 | 11 | install: 12 | install -c -m 644 libdbm.a $(DESTDIR)/usr/lib 13 | install -c -m 644 dbm.h $(DESTDIR)/usr/include 14 | 15 | clean: 16 | rm -f libdbm.a 17 | -------------------------------------------------------------------------------- /usr/src/include/struct.h: -------------------------------------------------------------------------------- 1 | /* struct.h 4.1 83/05/03 */ 2 | 3 | /* 4 | * access to information relating to the fields of a structure 5 | */ 6 | 7 | #define fldoff(str, fld) ((int)&(((struct str *)0)->fld)) 8 | #define fldsiz(str, fld) (sizeof(((struct str *)0)->fld)) 9 | #define strbase(str, ptr, fld) ((struct str *)((char *)(ptr)-fldoff(str, fld))) 10 | -------------------------------------------------------------------------------- /usr/src/sun/sys/h/times.h: -------------------------------------------------------------------------------- 1 | /* @(#)times.h 1.1 85/05/30 SMI; from UCB 4.2 81/02/19 */ 2 | 3 | /* 4 | * Structure returned by times() 5 | */ 6 | struct tms { 7 | time_t tms_utime; /* user time */ 8 | time_t tms_stime; /* system time */ 9 | time_t tms_cutime; /* user time, children */ 10 | time_t tms_cstime; /* system time, children */ 11 | }; 12 | -------------------------------------------------------------------------------- /usr/src/ucb/netstat/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # @(#)Makefile 1.1 85/05/30 SMI; from UCB 4.4 12/18/82 3 | # 4 | OBJS= host.o inet.o if.o main.o mbuf.o route.o 5 | CFLAGS=-O 6 | DESTDIR= 7 | 8 | netstat: ${OBJS} 9 | ${CC} ${OBJS} -o netstat 10 | 11 | install: netstat 12 | install -s netstat ${DESTDIR}/usr/ucb 13 | 14 | clean: 15 | rm -f netstat *.o core a.out errs 16 | -------------------------------------------------------------------------------- /usr/src/sun/sys/h/clist.h: -------------------------------------------------------------------------------- 1 | /* @(#)clist.h 1.1 85/05/30 SMI; from UCB 4.4 81/03/09 */ 2 | 3 | /* 4 | * Raw structures for the character list routines. 5 | */ 6 | struct cblock { 7 | struct cblock *c_next; 8 | char c_info[CBSIZE]; 9 | }; 10 | #ifdef KERNEL 11 | struct cblock *cfree; 12 | int nclist; 13 | struct cblock *cfreelist; 14 | int cfreecount; 15 | #endif 16 | -------------------------------------------------------------------------------- /usr/src/sun/sys/netinet/udp.h: -------------------------------------------------------------------------------- 1 | /* @(#)udp.h 1.1 85/05/30 SMI; from UCB 4.3 81/11/18 */ 2 | 3 | /* 4 | * Udp protocol header. 5 | * Per RFC 768, September, 1981. 6 | */ 7 | struct udphdr { 8 | u_short uh_sport; /* source port */ 9 | u_short uh_dport; /* destination port */ 10 | short uh_ulen; /* udp length */ 11 | u_short uh_sum; /* udp checksum */ 12 | }; 13 | -------------------------------------------------------------------------------- /usr/src/sun/sys/netpup/ether.h: -------------------------------------------------------------------------------- 1 | /* @(#)ether.h 1.1 85/05/30 SMI; from UCB 1.1 85/05/30 */ 2 | 3 | /* 4 | * Sockaddr for raw 3Mb/s interface. 5 | * 6 | * The network is needed to locate an interface on output. 7 | */ 8 | struct sockaddr_en { 9 | short sen_family; 10 | short sen_zero1; 11 | u_int sen_net; 12 | u_char sen_host; 13 | u_char sen_zero2[5]; 14 | }; 15 | -------------------------------------------------------------------------------- /usr/src/lib/libc/gen/telldir.c: -------------------------------------------------------------------------------- 1 | #ifndef lint 2 | static char sccsid[] = "@(#)telldir.c 1.1 85/05/30 SMI"; 3 | #endif 4 | 5 | #include 6 | #include 7 | 8 | /* 9 | * return a pointer into a directory 10 | */ 11 | long 12 | telldir(dirp) 13 | register DIR *dirp; 14 | { 15 | 16 | return((dirp->dd_bbase * dirp->dd_bsize) + dirp->dd_entno); 17 | } 18 | -------------------------------------------------------------------------------- /usr/src/sun/sys/h/domain.h: -------------------------------------------------------------------------------- 1 | /* @(#)domain.h 1.1 85/05/30 SMI; from UCB 5.2 82/08/01 */ 2 | 3 | /* 4 | * Structure per communications domain. 5 | */ 6 | struct domain { 7 | int dom_family; /* AF_xxx */ 8 | char *dom_name; 9 | struct protosw *dom_protosw, *dom_protoswNPROTOSW; 10 | struct domain *dom_next; 11 | }; 12 | 13 | #ifdef KERNEL 14 | struct domain *domains; 15 | #endif 16 | -------------------------------------------------------------------------------- /usr/src/include/assert.h: -------------------------------------------------------------------------------- 1 | /* assert.h 4.1 83/05/03 */ 2 | 3 | # ifndef NDEBUG 4 | # define _assert(ex) {if (!(ex)){fprintf(stderr,"Assertion failed: file %s, line %d\n", __FILE__, __LINE__);exit(1);}} 5 | # define assert(ex) {if (!(ex)){fprintf(stderr,"Assertion failed: file %s, line %d\n", __FILE__, __LINE__);exit(1);}} 6 | # else 7 | # define _assert(ex) ; 8 | # define assert(ex) ; 9 | # endif 10 | -------------------------------------------------------------------------------- /usr/src/sun/sys/h/vmparam.h: -------------------------------------------------------------------------------- 1 | /* @(#)vmparam.h 1.1 85/05/30 SMI; from UCB 4.13 82/12/17 */ 2 | 3 | /* 4 | * Machine dependent constants 5 | */ 6 | #ifdef KERNEL 7 | #include "../machine/vmparam.h" 8 | #else 9 | #include 10 | #endif 11 | 12 | #if defined(KERNEL) && !defined(LOCORE) 13 | int klseql; 14 | int klsdist; 15 | int klin; 16 | int kltxt; 17 | int klout; 18 | #endif 19 | -------------------------------------------------------------------------------- /usr/src/lib/libc/gen/closedir.c: -------------------------------------------------------------------------------- 1 | #ifndef lint 2 | static char sccsid[] = "@(#)closedir.c 1.1 85/05/30 SMI"; 3 | #endif 4 | 5 | #include 6 | #include 7 | 8 | /* 9 | * close a directory. 10 | */ 11 | void 12 | closedir(dirp) 13 | register DIR *dirp; 14 | { 15 | close(dirp->dd_fd); 16 | dirp->dd_fd = -1; 17 | dirp->dd_loc = 0; 18 | free(dirp->dd_buf); 19 | free(dirp); 20 | } 21 | -------------------------------------------------------------------------------- /usr/src/sun/sys/h/uio.h: -------------------------------------------------------------------------------- 1 | /* @(#)uio.h 1.1 85/05/30 SMI; from UCB 4.1 82/09/04 */ 2 | 3 | struct iovec { 4 | caddr_t iov_base; 5 | int iov_len; 6 | }; 7 | 8 | struct uio { 9 | struct iovec *uio_iov; 10 | int uio_iovcnt; 11 | int uio_offset; 12 | int uio_seg; 13 | int uio_resid; 14 | }; 15 | 16 | enum uio_rw { UIO_READ, UIO_WRITE }; 17 | 18 | /* 19 | * segments 20 | */ 21 | #define UIOSEG_USER 0 22 | #define UIOSEG_KERNEL 1 23 | -------------------------------------------------------------------------------- /usr/src/include/rpcsvc/rusers.h: -------------------------------------------------------------------------------- 1 | /* @(#)rusers.h 1.1 85/05/30 SMI */ 2 | 3 | /* 4 | * Copyright (c) 1984 by Sun Microsystems, Inc. 5 | */ 6 | 7 | #define RUSERSPROC_NUM 1 8 | #define RUSERSPROC_NAMES 2 9 | #define RUSERSPROC_ALLNAMES 3 10 | #define RUSERSPROG 100002 11 | #define RUSERSVERS 1 12 | 13 | #define MAXUSERS 100 14 | 15 | struct utmparr { 16 | struct utmp **uta_arr; 17 | int uta_cnt 18 | }; 19 | 20 | int xdr_utmparr(); 21 | -------------------------------------------------------------------------------- /usr/src/include/time.h: -------------------------------------------------------------------------------- 1 | /* @(#)time.h 1.1 84/12/20 SMI; not from UCB */ 2 | 3 | /* 4 | * Structure returned by gmtime and localtime calls (see ctime(3)). 5 | */ 6 | struct tm { 7 | int tm_sec; 8 | int tm_min; 9 | int tm_hour; 10 | int tm_mday; 11 | int tm_mon; 12 | int tm_year; 13 | int tm_wday; 14 | int tm_yday; 15 | int tm_isdst; 16 | }; 17 | 18 | extern struct tm *gmtime(), *localtime(); 19 | extern char *asctime(), *ctime(); 20 | -------------------------------------------------------------------------------- /usr/src/lib/libc/rpcsvc/rusers.h: -------------------------------------------------------------------------------- 1 | /* @(#)rusers.h 1.1 85/05/30 SMI */ 2 | 3 | /* 4 | * Copyright (c) 1984 by Sun Microsystems, Inc. 5 | */ 6 | 7 | #define RUSERSPROC_NUM 1 8 | #define RUSERSPROC_NAMES 2 9 | #define RUSERSPROC_ALLNAMES 3 10 | #define RUSERSPROG 100002 11 | #define RUSERSVERS 1 12 | 13 | #define MAXUSERS 100 14 | 15 | struct utmparr { 16 | struct utmp **uta_arr; 17 | int uta_cnt 18 | }; 19 | 20 | int xdr_utmparr(); 21 | -------------------------------------------------------------------------------- /usr/src/include/rpcsvc/yppasswd.h: -------------------------------------------------------------------------------- 1 | /* @(#)yppasswd.h 1.1 85/05/30 SMI */ 2 | 3 | /* 4 | * Copyright (c) 1985 by Sun Microsystems, Inc. 5 | */ 6 | 7 | #define YPPASSWDPROG 100009 8 | #define YPPASSWDPROC_UPDATE 1 9 | #define YPPASSWDVERS_ORIG 1 10 | #define YPPASSWDVERS 1 11 | 12 | struct yppasswd { 13 | char *oldpass; /* old (unencrypted) password */ 14 | struct passwd newpw; /* new pw structure */ 15 | }; 16 | 17 | int xdr_yppasswd(); 18 | -------------------------------------------------------------------------------- /usr/src/lib/libc/rpcsvc/yppasswd.h: -------------------------------------------------------------------------------- 1 | /* @(#)yppasswd.h 1.1 85/05/30 SMI */ 2 | 3 | /* 4 | * Copyright (c) 1985 by Sun Microsystems, Inc. 5 | */ 6 | 7 | #define YPPASSWDPROG 100009 8 | #define YPPASSWDPROC_UPDATE 1 9 | #define YPPASSWDVERS_ORIG 1 10 | #define YPPASSWDVERS 1 11 | 12 | struct yppasswd { 13 | char *oldpass; /* old (unencrypted) password */ 14 | struct passwd newpw; /* new pw structure */ 15 | }; 16 | 17 | int xdr_yppasswd(); 18 | -------------------------------------------------------------------------------- /usr/src/include/vfont.h: -------------------------------------------------------------------------------- 1 | /* vfont.h 4.1 83/05/03 */ 2 | 3 | /* 4 | * The structures header and dispatch define the format of a font file. 5 | * 6 | * See vfont(5) for more details. 7 | */ 8 | struct header { 9 | short magic; 10 | unsigned short size; 11 | short maxx; 12 | short maxy; 13 | short xtend; 14 | }; 15 | 16 | struct dispatch { 17 | unsigned short addr; 18 | short nbytes; 19 | char up,down,left,right; 20 | short width; 21 | }; 22 | -------------------------------------------------------------------------------- /usr/src/sun/sys/h/vcmd.h: -------------------------------------------------------------------------------- 1 | /* @(#)vcmd.h 1.1 85/05/30 SMI; from UCB 4.4 83/04/05 */ 2 | 3 | #ifndef _IOCTL_ 4 | #include 5 | #endif 6 | 7 | #define VPRINT 0100 8 | #define VPLOT 0200 9 | #define VPRINTPLOT 0400 10 | #define VPC_TERMCOM 0040 11 | #define VPC_FFCOM 0020 12 | #define VPC_EOTCOM 0010 13 | #define VPC_CLRCOM 0004 14 | #define VPC_RESET 0002 15 | 16 | #define VGETSTATE _IOR(v, 0, int) 17 | #define VSETSTATE _IOW(v, 1, int) 18 | -------------------------------------------------------------------------------- /usr/src/include/math.h: -------------------------------------------------------------------------------- 1 | /* math.h 4.1 83/05/03 */ 2 | 3 | extern double fabs(), floor(), ceil(), fmod(), ldexp(), frexp(); 4 | extern double sqrt(), hypot(), atof(); 5 | extern double sin(), cos(), tan(), asin(), acos(), atan(), atan2(); 6 | extern double exp(), log(), log10(), pow(); 7 | extern double sinh(), cosh(), tanh(); 8 | extern double gamma(); 9 | extern double j0(), j1(), jn(), y0(), y1(), yn(); 10 | 11 | #define HUGE 1.701411733192644270e38 12 | -------------------------------------------------------------------------------- /samples/servers: -------------------------------------------------------------------------------- 1 | ftp tcp /usr/etc/in.ftpd 2 | telnet tcp /usr/etc/in.telnetd 3 | shell tcp /etc/in.rshd 4 | login tcp /etc/in.rlogind 5 | exec tcp /usr/etc/in.rexecd 6 | tftp udp /usr/etc/in.tftpd 7 | syslog udp /usr/etc/in.syslog 8 | comsat udp /usr/etc/in.comsat 9 | talk udp /usr/etc/in.talkd 10 | time tcp /usr/etc/in.timed 11 | rpc udp /usr/etc/rpc.rstatd 100001 1-2 12 | rpc udp /usr/etc/rpc.rwalld 100008 1 13 | rpc udp /usr/etc/rpc.mountd 100005 1 14 | -------------------------------------------------------------------------------- /usr/src/include/pascal/unixio.h: -------------------------------------------------------------------------------- 1 | (* Copyright (c) 1979 Regents of the University of California *) 2 | 3 | const 4 | sccsid = '@(#)unixio.h 1.1 6/17/81'; 5 | 6 | type 7 | fileptr = record 8 | cnt :integer 9 | end; 10 | 11 | function TELL( 12 | var fptr :text) 13 | {returns} :fileptr; 14 | 15 | external; 16 | 17 | procedure SEEK( 18 | var fptr :text; 19 | var cnt :fileptr); 20 | 21 | external; 22 | 23 | procedure APPEND( 24 | var fptr :text); 25 | 26 | external; 27 | -------------------------------------------------------------------------------- /usr/src/include/sgtty.h: -------------------------------------------------------------------------------- 1 | /* sgtty.h 4.1 83/05/03 */ 2 | 3 | /* 4 | * Structure for stty and gtty system calls. 5 | */ 6 | 7 | #ifndef _IOCTL_ 8 | #include 9 | #endif 10 | 11 | #ifndef _SGTTYB_ 12 | #define _SGTTYB_ 13 | struct sgttyb { 14 | char sg_ispeed; /* input speed */ 15 | char sg_ospeed; /* output speed */ 16 | char sg_erase; /* erase character */ 17 | char sg_kill; /* kill character */ 18 | short sg_flags; /* mode flags */ 19 | }; 20 | #endif 21 | -------------------------------------------------------------------------------- /usr/src/sun/doc/mkfile: -------------------------------------------------------------------------------- 1 | ALL=\ 2 | c0.cover.pdf \ 3 | c1.nfs.intro.pdf \ 4 | c2.net.svcs.pdf \ 5 | c3.rpc.prog.pdf \ 6 | c4.xdr.spec.pdf \ 7 | c5.rpc.spec.pdf \ 8 | c6.nfs.spec.pdf \ 9 | c7.yp.spec.pdf \ 10 | c8.ipc.prim.pdf \ 11 | c9.net.impl.pdf \ 12 | sysadmin.doc.pdf \ 13 | 14 | all:V: $ALL 15 | 16 | %.pdf: % 17 | cat $stem | pic | tbl | eqn | troff -ms sunhead.ms - | dpost >$stem.ps 18 | ps2pdf $stem.ps $stem.pdf 19 | rm $stem.ps 20 | 21 | clean:V: 22 | rm -f *.ps *.pdf 23 | -------------------------------------------------------------------------------- /usr/src/sun/sys/h/vm.h: -------------------------------------------------------------------------------- 1 | /* @(#)vm.h 1.1 85/05/30 SMI; from UCB 4.3 81/04/23 */ 2 | 3 | /* 4 | * #include "../h/vm.h" 5 | * or #include in a user program 6 | * is a quick way to include all the vm header files. 7 | */ 8 | #ifdef KERNEL 9 | #include "../h/vmparam.h" 10 | #include "../h/vmmac.h" 11 | #include "../h/vmmeter.h" 12 | #include "../h/vmsystm.h" 13 | #else 14 | #include 15 | #include 16 | #include 17 | #include 18 | #endif 19 | -------------------------------------------------------------------------------- /usr/src/sun/doc/READ_ME: -------------------------------------------------------------------------------- 1 | 2 | To troff the files in this directory, use: 3 | 4 | pic | tbl | eqn | troff -ms sunhead.ms - 5 | 6 | This assumes that troff is a front end that sets up ditroff. sunhead.ms 7 | requires more font positions than the standard troff allows. Font position 7 8 | is mapped to a constant width font and font position 6 is mapped to a bold 9 | constant width font. If you don't have these, you'll have to play with the 10 | mappings. 11 | 12 | The file sunhead.ms is a header file containing some definitions. 13 | 14 | 15 | -------------------------------------------------------------------------------- /usr/src/sun/sys/h/dk.h: -------------------------------------------------------------------------------- 1 | /* @(#)dk.h 1.1 85/05/30 SMI; from UCB 4.2 81/02/19 */ 2 | 3 | /* 4 | * Instrumentation 5 | */ 6 | #define CPUSTATES 4 7 | 8 | #define CP_USER 0 9 | #define CP_NICE 1 10 | #define CP_SYS 2 11 | #define CP_IDLE 3 12 | 13 | #define DK_NDRIVE 4 14 | 15 | #ifdef KERNEL 16 | long cp_time[CPUSTATES]; 17 | int dk_busy; 18 | long dk_time[DK_NDRIVE]; 19 | long dk_seek[DK_NDRIVE]; 20 | long dk_xfer[DK_NDRIVE]; 21 | long dk_wds[DK_NDRIVE]; 22 | long dk_bps[DK_NDRIVE]; 23 | 24 | long tk_nin; 25 | long tk_nout; 26 | #endif 27 | -------------------------------------------------------------------------------- /usr/src/sun/sys/h/vadvise.h: -------------------------------------------------------------------------------- 1 | /* @(#)vadvise.h 1.1 85/05/30 SMI; from UCB 4.1 83/02/10 */ 2 | 3 | /* 4 | * Parameters to vadvise() to tell system of particular paging 5 | * behaviour: 6 | * VA_NORM Normal strategy 7 | * VA_ANOM Sampling page behaviour is not a win, don't bother 8 | * Suitable during GCs in LISP, or sequential or random 9 | * page referencing. 10 | * VA_SEQL Sequential behaviour expected. 11 | * VA_FLUSH Invalidate all page table entries. 12 | */ 13 | #define VA_NORM 0 14 | #define VA_ANOM 1 15 | #define VA_SEQL 2 16 | #define VA_FLUSH 3 17 | -------------------------------------------------------------------------------- /usr/src/sun/sys/netinet/tcp_debug.h: -------------------------------------------------------------------------------- 1 | /* @(#)tcp_debug.h 1.1 85/05/30 SMI; from UCB 4.2 82/03/24 */ 2 | 3 | struct tcp_debug { 4 | n_time td_time; 5 | short td_act; 6 | short td_ostate; 7 | caddr_t td_tcb; 8 | struct tcpiphdr td_ti; 9 | short td_req; 10 | struct tcpcb td_cb; 11 | }; 12 | 13 | #define TA_INPUT 0 14 | #define TA_OUTPUT 1 15 | #define TA_USER 2 16 | #define TA_RESPOND 3 17 | #define TA_DROP 4 18 | 19 | #ifdef TANAMES 20 | char *tanames[] = 21 | { "input", "output", "user", "respond", "drop" }; 22 | #endif 23 | 24 | #define TCP_NDEBUG 100 25 | -------------------------------------------------------------------------------- /usr/src/lib/libc/rpc/types.h: -------------------------------------------------------------------------------- 1 | /* @(#)types.h 1.1 85/05/30 SMI */ 2 | 3 | /* 4 | * Rpc additions to 5 | */ 6 | 7 | #define bool_t int 8 | #define enum_t int 9 | #define FALSE (0==1) 10 | #define TRUE (1==1) 11 | #define __dontcare__ -1 12 | 13 | #ifndef KERNEL 14 | #define mem_alloc(bsize) malloc(bsize) 15 | #define mem_free(ptr, bsize) free(ptr) 16 | #ifndef major /* ouch! */ 17 | #include 18 | #endif 19 | #else 20 | #define mem_alloc(bsize) kmem_alloc(bsize) 21 | #define mem_free(ptr, bsize) kmem_free((ptr), (bsize)) 22 | #endif 23 | -------------------------------------------------------------------------------- /usr/src/include/dbm.h: -------------------------------------------------------------------------------- 1 | /* dbm.h 4.1 83/05/03 */ 2 | 3 | #define PBLKSIZ 1024 4 | #define DBLKSIZ 4096 5 | #define BYTESIZ 8 6 | #define NULL ((char *) 0) 7 | 8 | long bitno; 9 | long maxbno; 10 | long blkno; 11 | long hmask; 12 | 13 | char pagbuf[PBLKSIZ]; 14 | char dirbuf[DBLKSIZ]; 15 | 16 | int dirf; 17 | int pagf; 18 | int dbrdonly; 19 | 20 | typedef struct 21 | { 22 | char *dptr; 23 | int dsize; 24 | } datum; 25 | 26 | datum fetch(); 27 | datum makdatum(); 28 | datum firstkey(); 29 | datum nextkey(); 30 | datum firsthash(); 31 | long calchash(); 32 | long hashinc(); 33 | 34 | -------------------------------------------------------------------------------- /usr/src/Makefile: -------------------------------------------------------------------------------- 1 | # @(#)Makefile nfs.1.0 85/06/28 SAI; from 4.3 (Berkeley) 8/20/83 2 | # 3 | DESTDIR= 4 | CFLAGS= -O 5 | 6 | # Programs that live in subdirectories, and have makefiles of their own. 7 | # 8 | SUBDIR= lib usr.lib bin usr.bin etc ucb games local usr.etc 9 | 10 | all: ${SUBDIR} 11 | 12 | ${SUBDIR}: FRC 13 | cd $@; make ${MFLAGS} 14 | 15 | FRC: 16 | 17 | install: 18 | for i in ${SUBDIR}; do \ 19 | (cd $$i; make ${MFLAGS} DESTDIR=${DESTDIR} install); done 20 | 21 | clean: 22 | rm -f a.out core *.s *.o 23 | for i in ${SUBDIR}; do (cd $$i; make ${MFLAGS} clean); done 24 | -------------------------------------------------------------------------------- /usr/src/sun/sys/h/bk.h: -------------------------------------------------------------------------------- 1 | /* @(#)bk.h 1.1 85/05/30 SMI; from UCB 4.2 beta */ 2 | 3 | /* 4 | * Macro definition of bk.c/netinput(). 5 | * This is used to replace a call to 6 | * (*linesw[tp->t_line].l_rint)(c,tp); 7 | * with 8 | * 9 | * if (tp->t_line == NETLDISC) 10 | * BKINPUT(c, tp); 11 | * else 12 | * (*linesw[tp->t_line].l_rint)(c,tp); 13 | */ 14 | #define BKINPUT(c, tp) { \ 15 | if ((tp)->t_rec == 0) { \ 16 | *(tp)->t_cp++ = c; \ 17 | if (++(tp)->t_inbuf == 1024 || (c) == '\n') { \ 18 | (tp)->t_rec = 1; \ 19 | wakeup((caddr_t)&(tp)->t_rawq); \ 20 | } \ 21 | } \ 22 | } 23 | -------------------------------------------------------------------------------- /usr/src/sun/sys/h/vlimit.h: -------------------------------------------------------------------------------- 1 | /* @(#)vlimit.h 1.1 85/05/30 SMI; from UCB 4.3 81/04/13 */ 2 | 3 | /* 4 | * Limits for u.u_limit[i], per process, inherited. 5 | */ 6 | #define LIM_NORAISE 0 /* if <> 0, can't raise limits */ 7 | #define LIM_CPU 1 /* max secs cpu time */ 8 | #define LIM_FSIZE 2 /* max size of file created */ 9 | #define LIM_DATA 3 /* max growth of data space */ 10 | #define LIM_STACK 4 /* max growth of stack */ 11 | #define LIM_CORE 5 /* max size of ``core'' file */ 12 | #define LIM_MAXRSS 6 /* max desired data+stack core usage */ 13 | 14 | #define NLIMITS 6 15 | 16 | #define INFINITY 0x7fffffff 17 | -------------------------------------------------------------------------------- /usr/src/usr.lib/libdbm/dbm.h: -------------------------------------------------------------------------------- 1 | /* @(#)dbm.h 1.1 85/05/31 SMI; from UCB 4.1 83/06/27 */ 2 | 3 | #define PBLKSIZ 1024 4 | #define DBLKSIZ 4096 5 | #define BYTESIZ 8 6 | #define NULL ((char *) 0) 7 | 8 | long bitno; 9 | long maxbno; 10 | long blkno; 11 | long hmask; 12 | 13 | char pagbuf[PBLKSIZ]; 14 | char dirbuf[DBLKSIZ]; 15 | 16 | int dirf; 17 | int pagf; 18 | int dbrdonly; 19 | 20 | typedef struct 21 | { 22 | char *dptr; 23 | int dsize; 24 | } datum; 25 | 26 | datum fetch(); 27 | datum makdatum(); 28 | datum firstkey(); 29 | datum nextkey(); 30 | datum firsthash(); 31 | long calchash(); 32 | long hashinc(); 33 | 34 | -------------------------------------------------------------------------------- /usr/src/sun/sys/ufs/mount.h: -------------------------------------------------------------------------------- 1 | /* @(#)mount.h 1.1 85/05/30 SMI; from UCB 4.4 82/07/19 */ 2 | 3 | /* 4 | * Mount structure. 5 | * One allocated on every mount. 6 | * Used to find the super block. 7 | */ 8 | struct mount 9 | { 10 | struct vfs m_vfs; /* vfs structure for this filesystem */ 11 | dev_t m_dev; /* device mounted */ 12 | struct buf *m_bufp; /* pointer to superblock */ 13 | struct inode *m_qinod; /* QUOTA: pointer to quota file */ 14 | }; 15 | 16 | #ifdef KERNEL 17 | /* 18 | * mount table 19 | */ 20 | extern struct mount mount[NMOUNT]; 21 | 22 | /* 23 | * Operations 24 | */ 25 | struct mount *getmp(); 26 | #endif 27 | -------------------------------------------------------------------------------- /usr/src/lib/libc/net/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # @(#)Makefile 1.1 85/05/30 SMI; from UCB 4.4 6/10/83 3 | # 4 | 5 | OBJS= gethostent.o getnetent.o getprotoent.o getservent.o \ 6 | rcmd.o rexec.o ruserpass.o 7 | CFLAGS= -O 8 | 9 | .c.o: 10 | ${CC} -p -c ${CFLAGS} $*.c 11 | -ld -X -r $*.o 12 | mv a.out profiled/$*.o 13 | ${CC} ${CFLAGS} -c $*.c 14 | -ld -x -r $*.o 15 | mv a.out $*.o 16 | 17 | netlib netlib_p: ${OBJS} 18 | @echo "building profiled netlib" 19 | @cd profiled; ar cru ../netlib_p ${OBJS} 20 | @echo "building normal netlib" 21 | @ar cru netlib ${OBJS} 22 | 23 | clean: 24 | rm -f ${OBJS} profiled/*.o errs a.out core netlib netlib_p 25 | -------------------------------------------------------------------------------- /usr/src/bin/domainname.c: -------------------------------------------------------------------------------- 1 | #ifndef lint 2 | static char sccsid[] = "@(#)domainname.c 1.1 85/05/30 Copyr 1984 Sun Micro"; 3 | #endif 4 | /* 5 | * domainname -- get (or set domainname) 6 | */ 7 | #include 8 | 9 | char domainname[32]; 10 | extern int errno; 11 | 12 | main(argc,argv) 13 | char *argv[]; 14 | { 15 | int myerrno; 16 | 17 | argc--; 18 | argv++; 19 | if (argc) { 20 | if (setdomainname(*argv,strlen(*argv))) 21 | perror("setdomainname"); 22 | myerrno = errno; 23 | } else { 24 | getdomainname(domainname,sizeof(domainname)); 25 | myerrno = errno; 26 | printf("%s\n",domainname); 27 | } 28 | exit(myerrno); 29 | } 30 | -------------------------------------------------------------------------------- /usr/src/sun/sys/h/callout.h: -------------------------------------------------------------------------------- 1 | /* @(#)callout.h 1.1 85/05/30 SMI; from UCB 4.6 81/04/18 */ 2 | 3 | /* 4 | * The callout structure is for 5 | * a routine arranging 6 | * to be called by the clock interrupt 7 | * (clock.c) with a specified argument, 8 | * in a specified amount of time. 9 | * Used, for example, to time tab 10 | * delays on typewriters. 11 | */ 12 | 13 | struct callout { 14 | int c_time; /* incremental time */ 15 | caddr_t c_arg; /* argument to routine */ 16 | int (*c_func)(); /* routine */ 17 | struct callout *c_next; 18 | }; 19 | #ifdef KERNEL 20 | struct callout *callfree, *callout, calltodo; 21 | int ncallout; 22 | #endif 23 | -------------------------------------------------------------------------------- /usr/src/sun/sys/netpup/pup.c: -------------------------------------------------------------------------------- 1 | /* @(#)pup.c 1.1 85/05/30 SMI; from UCB 4.5 83/05/30 */ 2 | 3 | #include "../h/param.h" 4 | #include "../h/mbuf.h" 5 | #include "../h/protosw.h" 6 | #include "../h/socket.h" 7 | #include "../h/socketvar.h" 8 | #include "../net/af.h" 9 | #include "../netpup/pup.h" 10 | 11 | #ifdef PUP 12 | pup_hash(spup, hp) 13 | struct sockaddr_pup *spup; 14 | struct afhash *hp; 15 | { 16 | 17 | hp->afh_nethash = spup->spup_net; 18 | hp->afh_hosthash = spup->spup_host; 19 | } 20 | 21 | pup_netmatch(spup1, spup2) 22 | struct sockaddr_pup *spup1, *spup2; 23 | { 24 | 25 | return (spup1->spup_net == spup2->spup_net); 26 | } 27 | #endif 28 | -------------------------------------------------------------------------------- /usr/src/include/ranlib.h: -------------------------------------------------------------------------------- 1 | /* ranlib.h 4.1 83/05/03 */ 2 | 3 | /* 4 | * Structure of the __.SYMDEF table of contents for an archive. 5 | * __.SYMDEF begins with a word giving the number of ranlib structures 6 | * which immediately follow, and then continues with a string 7 | * table consisting of a word giving the number of bytes of strings 8 | * which follow and then the strings themselves. 9 | * The ran_strx fields index the string table whose first byte is numbered 0. 10 | */ 11 | struct ranlib { 12 | union { 13 | off_t ran_strx; /* string table index of */ 14 | char *ran_name; /* symbol defined by */ 15 | } ran_un; 16 | off_t ran_off; /* library member at this offset */ 17 | }; 18 | -------------------------------------------------------------------------------- /usr/src/lib/libc/vax/Makefile: -------------------------------------------------------------------------------- 1 | # Makefile nfs.1.0 85/06/28 SAI; from 4.3 83/07/05 2 | # 3 | # Machine dependent routines for the VAX are located here 4 | # 5 | COMPAT= compat-4.1 6 | ALL= gen net stdio ${COMPAT} 7 | 8 | vaxlib vaxlib_p: ${ALL} 9 | -mkdir tmp 10 | for i in ${ALL}; do (cd tmp; ar x ../$$i/$${i}lib); done 11 | ar cr vaxlib `ls tmp/*.o | sort -t/ +1` 12 | rm -f tmp/* 13 | for i in ${ALL}; do (cd tmp; ar x ../$$i/$${i}lib_p); done 14 | ar cr vaxlib_p `ls tmp/*.o | sort -t/ +1` 15 | rm -rf tmp 16 | 17 | ${ALL}: FRC 18 | cd $@; make ${MFLAGS} 19 | 20 | FRC: 21 | 22 | clean: 23 | for i in ${ALL}; do (cd $$i; make ${MFLAGS} clean); done 24 | rm -f tmp/*.o; 25 | -rmdir tmp 26 | -------------------------------------------------------------------------------- /usr/src/include/disktab.h: -------------------------------------------------------------------------------- 1 | /* disktab.h 4.3 83/08/11 */ 2 | 3 | /* 4 | * Disk description table, see disktab(5) 5 | */ 6 | #define DISKTAB "/etc/disktab" 7 | 8 | struct disktab { 9 | char *d_name; /* drive name */ 10 | char *d_type; /* drive type */ 11 | int d_secsize; /* sector size in bytes */ 12 | int d_ntracks; /* # tracks/cylinder */ 13 | int d_nsectors; /* # sectors/track */ 14 | int d_ncylinders; /* # cylinders */ 15 | int d_rpm; /* revolutions/minute */ 16 | struct partition { 17 | int p_size; /* #sectors in partition */ 18 | short p_bsize; /* block size in bytes */ 19 | short p_fsize; /* frag size in bytes */ 20 | } d_partitions[8]; 21 | }; 22 | 23 | struct disktab *getdiskbyname(); 24 | -------------------------------------------------------------------------------- /usr/src/include/mp.h: -------------------------------------------------------------------------------- 1 | /* mp.h 4.2 83/07/01 */ 2 | 3 | #define MINT struct mint 4 | MINT 5 | { int len; 6 | short *val; 7 | }; 8 | #define FREE(x) {if(x.len!=0) {free((char *)x.val); x.len=0;}} 9 | #ifndef DBG 10 | #define shfree(u) free((char *)u) 11 | #else 12 | #include 13 | #define shfree(u) { if(dbg) fprintf(stderr, "free %o\n", u); free((char *)u);} 14 | extern int dbg; 15 | #endif 16 | #ifndef vax 17 | struct half 18 | { short high; 19 | short low; 20 | }; 21 | #else 22 | struct half 23 | { short low; 24 | short high; 25 | }; 26 | #endif 27 | extern MINT *itom(); 28 | extern short *xalloc(); 29 | 30 | #ifdef lint 31 | extern xv_oid; 32 | #define VOID xv_oid = 33 | #else 34 | #define VOID 35 | #endif 36 | -------------------------------------------------------------------------------- /usr/src/sun/sys/h/kernel.h: -------------------------------------------------------------------------------- 1 | /* @(#)kernel.h 1.1 85/05/30 SMI; from UCB 4.8 83/05/30 */ 2 | 3 | /* 4 | * Global variables for the kernel 5 | */ 6 | 7 | long rmalloc(); 8 | 9 | /* 1.1 */ 10 | char hostname[32]; 11 | int hostnamelen; 12 | char domainname[32]; 13 | int domainnamelen; 14 | 15 | /* 1.2 */ 16 | struct timeval boottime; 17 | struct timeval time; 18 | struct timezone tz; /* XXX */ 19 | int hz; 20 | int phz; /* alternate clock's frequency */ 21 | int tick; 22 | int lbolt; /* awoken once a second */ 23 | int realitexpire(); 24 | 25 | long avenrun[3]; 26 | 27 | #ifdef GPROF 28 | extern int profiling; 29 | extern char *s_lowpc; 30 | extern u_long s_textsize; 31 | extern u_short *kcount; 32 | #endif 33 | -------------------------------------------------------------------------------- /usr/src/sun/sys/net/af.h: -------------------------------------------------------------------------------- 1 | /* @(#)af.h 1.1 85/05/30 SMI; from UCB 4.3 82/03/30 */ 2 | 3 | /* 4 | * Address family routines, 5 | * used in handling generic sockaddr structures. 6 | * 7 | * Hash routine is called 8 | * af_hash(addr, h); 9 | * struct sockaddr *addr; struct afhash *h; 10 | * producing an afhash structure for addr. 11 | * 12 | * Netmatch routine is called 13 | * af_netmatch(addr1, addr2); 14 | * where addr1 and addr2 are sockaddr *. Returns 1 if network 15 | * values match, 0 otherwise. 16 | */ 17 | struct afswitch { 18 | int (*af_hash)(); 19 | int (*af_netmatch)(); 20 | }; 21 | 22 | struct afhash { 23 | u_int afh_hosthash; 24 | u_int afh_nethash; 25 | }; 26 | 27 | #ifdef KERNEL 28 | struct afswitch afswitch[]; 29 | #endif 30 | -------------------------------------------------------------------------------- /usr/man/man8/rstatd.8c: -------------------------------------------------------------------------------- 1 | .\" @(#)rstatd.8c 1.7 85/04/05 SMI; from UCB 4.2 2 | .TH RSTATD 8C "4 April 1985" 3 | .SH NAME 4 | rstatd \- kernel statistics server 5 | .SH SYNOPSIS 6 | .B /usr/etc/rpc.rstatd 7 | .SH DESCRIPTION 8 | .IX "rstatd command" "" "\fLrstatd\fP \(em kernel statistics server" 9 | .IX statistics rstatd "" "\fLrstatd\fP \(em kernel statistics server" 10 | .IX servers rstatd "" "\fLrstatd\fP \(em kernel statistics server" 11 | .LP 12 | .I Rstatd 13 | is a server which returns performance statistics obtained from the kernel. 14 | These statistics are graphically displayed by 15 | .IR perfmeter (1). 16 | The 17 | .I rstatd 18 | daemon is normally invoked by 19 | .IR inetd (8C). 20 | .SH "SEE ALSO" 21 | perfmeter(1), services(5), inetd(8) 22 | -------------------------------------------------------------------------------- /usr/man/man8/rwalld.8c: -------------------------------------------------------------------------------- 1 | .\" @(#)rwalld.8c 1.2 85/04/05 SMI; 2 | .TH RWALLD 8C "1 February 1985" 3 | .SH NAME 4 | rwalld \- network rwall server 5 | .SH SYNOPSIS 6 | .B /usr/etc/rpc.rwalld 7 | .SH DESCRIPTION 8 | .IX "rwalld command" "" "\fLrwalld\fP \(em network rwall server" 9 | .IX "network rwall server" "" "network rwall server \(em \fLrwalld\fP" 10 | .IX servers rwalld "" "\fLrwalld\fP \(em network rwall server" 11 | .LP 12 | .I Rwalld 13 | is a server that handles 14 | .IR rwall (1) 15 | and 16 | .IR shutdown (1) 17 | requests. 18 | It is implemented by calling 19 | .IR wall (1) 20 | to all the appropriate network machines. 21 | The 22 | .I rwalld 23 | daemon is normally invoked by 24 | .IR inetd (8C). 25 | .SH "SEE ALSO" 26 | rwall(1), wall(1), services(5), inetd(8), shutdown(8) 27 | -------------------------------------------------------------------------------- /usr/src/sun/sys/h/mman.h: -------------------------------------------------------------------------------- 1 | /* @(#)mman.h 1.1 85/05/30 SMI; from UCB 4.2 82/09/04 */ 2 | 3 | /* protections are chosen from these bits, or-ed together */ 4 | #define PROT_READ 0x1 /* pages can be read */ 5 | #define PROT_WRITE 0x2 /* pages can be written */ 6 | #define PROT_EXEC 0x4 /* pages can be executed */ 7 | 8 | /* sharing types: choose either SHARED or PRIVATE */ 9 | #define MAP_SHARED 1 /* share changes */ 10 | #define MAP_PRIVATE 2 /* changes are private */ 11 | 12 | /* advice to madvise */ 13 | #define MADV_NORMAL 0 /* no further special treatment */ 14 | #define MADV_RANDOM 1 /* expect random page references */ 15 | #define MADV_SEQUENTIAL 2 /* expect sequential page references */ 16 | #define MADV_WILLNEED 3 /* will need these pages */ 17 | #define MADV_DONTNEED 4 /* dont need these pages */ 18 | -------------------------------------------------------------------------------- /usr/src/sun/sys/h/dmap.h: -------------------------------------------------------------------------------- 1 | /* @(#)dmap.h 1.1 85/05/30 SMI; from UCB 4.5 83/05/18 */ 2 | 3 | /* 4 | * Definitions for the mapping of vitual swap 5 | * space to the physical swap area - the disk map. 6 | */ 7 | 8 | #define NDMAP 36 /* size of the swap area map */ 9 | 10 | struct dmap 11 | { 12 | swblk_t dm_size; /* current size used by process */ 13 | swblk_t dm_alloc; /* amount of physical swap space allocated */ 14 | swblk_t dm_map[NDMAP]; /* first disk block number in each chunk */ 15 | }; 16 | #ifdef KERNEL 17 | struct dmap zdmap; 18 | int dmmin, dmmax, dmtext; 19 | #endif 20 | 21 | /* 22 | * The following structure is that ``returned'' 23 | * from a call to vstodb(). 24 | */ 25 | struct dblock 26 | { 27 | swblk_t db_base; /* base of physical contig drum block */ 28 | swblk_t db_size; /* size of block */ 29 | }; 30 | -------------------------------------------------------------------------------- /usr/src/sun/sys/netinet/udp_var.h: -------------------------------------------------------------------------------- 1 | /* @(#)udp_var.h 1.1 85/05/30 SMI; from UCB 4.3 81/11/18 */ 2 | 3 | /* 4 | * UDP kernel structures and variables. 5 | */ 6 | struct udpiphdr { 7 | struct ipovly ui_i; /* overlaid ip structure */ 8 | struct udphdr ui_u; /* udp header */ 9 | }; 10 | #define ui_next ui_i.ih_next 11 | #define ui_prev ui_i.ih_prev 12 | #define ui_x1 ui_i.ih_x1 13 | #define ui_pr ui_i.ih_pr 14 | #define ui_len ui_i.ih_len 15 | #define ui_src ui_i.ih_src 16 | #define ui_dst ui_i.ih_dst 17 | #define ui_sport ui_u.uh_sport 18 | #define ui_dport ui_u.uh_dport 19 | #define ui_ulen ui_u.uh_ulen 20 | #define ui_sum ui_u.uh_sum 21 | 22 | struct udpstat { 23 | int udps_hdrops; 24 | int udps_badsum; 25 | int udps_badlen; 26 | }; 27 | 28 | #ifdef KERNEL 29 | struct inpcb udb; 30 | struct udpstat udpstat; 31 | #endif 32 | -------------------------------------------------------------------------------- /usr/src/include/ctype.h: -------------------------------------------------------------------------------- 1 | /* ctype.h 4.1 83/05/03 */ 2 | 3 | #define _U 01 4 | #define _L 02 5 | #define _N 04 6 | #define _S 010 7 | #define _P 020 8 | #define _C 040 9 | #define _X 0100 10 | 11 | extern char _ctype_[]; 12 | 13 | #define isalpha(c) ((_ctype_+1)[c]&(_U|_L)) 14 | #define isupper(c) ((_ctype_+1)[c]&_U) 15 | #define islower(c) ((_ctype_+1)[c]&_L) 16 | #define isdigit(c) ((_ctype_+1)[c]&_N) 17 | #define isxdigit(c) ((_ctype_+1)[c]&(_N|_X)) 18 | #define isspace(c) ((_ctype_+1)[c]&_S) 19 | #define ispunct(c) ((_ctype_+1)[c]&_P) 20 | #define isalnum(c) ((_ctype_+1)[c]&(_U|_L|_N)) 21 | #define isprint(c) ((_ctype_+1)[c]&(_P|_U|_L|_N)) 22 | #define iscntrl(c) ((_ctype_+1)[c]&_C) 23 | #define isascii(c) ((unsigned)(c)<=0177) 24 | #define toupper(c) ((c)-'a'+'A') 25 | #define tolower(c) ((c)-'A'+'a') 26 | #define toascii(c) ((c)&0177) 27 | -------------------------------------------------------------------------------- /usr/src/sun/sys/netinet/in_systm.h: -------------------------------------------------------------------------------- 1 | /* @(#)in_systm.h 1.1 85/05/30 SMI; from UCB 4.14 82/10/09 */ 2 | 3 | /* 4 | * Miscellaneous internetwork 5 | * definitions for kernel. 6 | */ 7 | 8 | #ifndef LOCORE 9 | /* 10 | * Network types. 11 | * 12 | * Internally the system keeps counters in the headers with the bytes 13 | * swapped so that VAX instructions will work on them. It reverses 14 | * the bytes before transmission at each protocol level. The n_ types 15 | * represent the types with the bytes in ``high-ender'' order. 16 | */ 17 | typedef u_short n_short; /* short as received from the net */ 18 | typedef u_long n_long; /* long as received from the net */ 19 | 20 | typedef u_long n_time; /* ms since 00:00 GMT, byte rev */ 21 | #endif 22 | 23 | #ifndef LOCORE 24 | #ifdef KERNEL 25 | n_time iptime(); 26 | #endif 27 | #endif 28 | -------------------------------------------------------------------------------- /usr/src/sun/sys/netinet/tcpip.h: -------------------------------------------------------------------------------- 1 | /* @(#)tcpip.h 1.1 85/05/30 SMI; from UCB 4.1 81/11/29 */ 2 | 3 | /* 4 | * Tcp+ip header, after ip options removed. 5 | */ 6 | struct tcpiphdr { 7 | struct ipovly ti_i; /* overlaid ip structure */ 8 | struct tcphdr ti_t; /* tcp header */ 9 | }; 10 | #define ti_next ti_i.ih_next 11 | #define ti_prev ti_i.ih_prev 12 | #define ti_x1 ti_i.ih_x1 13 | #define ti_pr ti_i.ih_pr 14 | #define ti_len ti_i.ih_len 15 | #define ti_src ti_i.ih_src 16 | #define ti_dst ti_i.ih_dst 17 | #define ti_sport ti_t.th_sport 18 | #define ti_dport ti_t.th_dport 19 | #define ti_seq ti_t.th_seq 20 | #define ti_ack ti_t.th_ack 21 | #define ti_x2 ti_t.th_x2 22 | #define ti_off ti_t.th_off 23 | #define ti_flags ti_t.th_flags 24 | #define ti_win ti_t.th_win 25 | #define ti_sum ti_t.th_sum 26 | #define ti_urp ti_t.th_urp 27 | -------------------------------------------------------------------------------- /usr/man/man1/domainname.1: -------------------------------------------------------------------------------- 1 | .\" @(#)domainname.1 1.4 85/03/04 SMI; 2 | .TH DOMAINNAME 1 "1 February 1985" 3 | .SH NAME 4 | domainname \- set or display name of current domain system 5 | .SH SYNOPSIS 6 | .B domainname 7 | [ nameofdomain ] 8 | .SH DESCRIPTION 9 | .IX "domainname command" "" "\fLdomainname\fP \(em set/display domain name" 10 | .IX domain "set or display current" 11 | .IX "current domain" "set or display" 12 | .IX display "current domain" 13 | .IX set "current domain" 14 | With no arguments, 15 | .I domainname 16 | displays the name of the current domain. 17 | The yellow pages use the domain to refer to a group of hosts. 18 | .LP 19 | Only the super-user can set the domainname by giving an argument; 20 | this is usually done in the startup script 21 | .IR /etc/rc.local . 22 | .SH SEE ALSO 23 | getdomainname(2), setdomainname(2), ypinit(8) 24 | -------------------------------------------------------------------------------- /usr/src/sun/sys/h/ttydev.h: -------------------------------------------------------------------------------- 1 | /* @(#)ttydev.h 1.1 85/05/30 SMI; from UCB 4.3 83/05/18 */ 2 | 3 | /* 4 | * Terminal definitions related to underlying hardware. 5 | */ 6 | #ifndef _TTYDEV_ 7 | #define _TTYDEV_ 8 | 9 | /* 10 | * Speeds 11 | */ 12 | #define B0 0 13 | #define B50 1 14 | #define B75 2 15 | #define B110 3 16 | #define B134 4 17 | #define B150 5 18 | #define B200 6 19 | #define B300 7 20 | #define B600 8 21 | #define B1200 9 22 | #define B1800 10 23 | #define B2400 11 24 | #define B4800 12 25 | #define B9600 13 26 | #define EXTA 14 27 | #define EXTB 15 28 | 29 | #ifdef KERNEL 30 | /* 31 | * Hardware bits. 32 | * SHOULD NOT BE HERE. 33 | */ 34 | #define DONE 0200 35 | #define IENABLE 0100 36 | 37 | /* 38 | * Modem control commands. 39 | */ 40 | #define DMSET 0 41 | #define DMBIS 1 42 | #define DMBIC 2 43 | #define DMGET 3 44 | #endif 45 | #endif 46 | -------------------------------------------------------------------------------- /usr/src/lib/libc/gen/seekdir.c: -------------------------------------------------------------------------------- 1 | #ifndef lint 2 | static char sccsid[] = "@(#)seekdir.c 1.1 85/05/30 SMI"; 3 | #endif 4 | 5 | #include 6 | #include 7 | 8 | /* 9 | * seek to an entry in a directory. 10 | * Only values returned by "telldir" should be passed to seekdir. 11 | */ 12 | void 13 | seekdir(dirp, tell) 14 | register DIR *dirp; 15 | register long tell; 16 | { 17 | register struct direct *dp; 18 | register long entno; 19 | long base; 20 | long curloc; 21 | extern long lseek(); 22 | 23 | curloc = telldir(dirp); 24 | if (curloc == tell) 25 | return; 26 | base = tell / dirp->dd_bsize; 27 | entno = tell % dirp->dd_bsize; 28 | (void) lseek(dirp->dd_fd, base, 0); 29 | dirp->dd_loc = 0; 30 | dirp->dd_entno = 0; 31 | while (dirp->dd_entno < entno) { 32 | dp = readdir(dirp); 33 | if (dp == NULL) 34 | return; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /usr/src/sun/sys/h/dnlc.h: -------------------------------------------------------------------------------- 1 | /* @(#)dnlc.h 1.1 85/05/30 SMI */ 2 | 3 | /* 4 | * Copyright (c) 1984 Sun Microsystems Inc. 5 | */ 6 | 7 | /* 8 | * This structure describes the elements in the cache of recent 9 | * names looked up. 10 | */ 11 | 12 | #define NC_NAMLEN 15 /* maximum name segment length we bother with*/ 13 | 14 | struct ncache { 15 | struct ncache *hash_next, *hash_prev; /* hash chain, MUST BE FIRST */ 16 | struct ncache *lru_next, *lru_prev; /* LRU chain */ 17 | struct vnode *vp; /* vnode the name refers to */ 18 | struct vnode *dp; /* vno of parent of name */ 19 | char namlen; /* length of name */ 20 | char name[NC_NAMLEN]; /* segment name */ 21 | struct ucred *cred; /* credentials */ 22 | }; 23 | 24 | #define ANYCRED ((struct ucred *) -1) 25 | #define NOCRED ((struct ucred *) 0) 26 | /* 27 | int ncsize; 28 | struct ncache *ncache; 29 | */ 30 | -------------------------------------------------------------------------------- /usr/src/sun/sys/vax/reg.h: -------------------------------------------------------------------------------- 1 | /* @(#)reg.h 1.1 85/05/30 SMI; from UCB 4.2 81/02/19 */ 2 | /* 3 | * Location of the users' stored 4 | * registers relative to R0. 5 | * Usage is u.u_ar0[XX]. 6 | */ 7 | #define R0 (-18) 8 | #define R1 (-17) 9 | #define R2 (-16) 10 | #define R3 (-15) 11 | #define R4 (-14) 12 | #define R5 (-13) 13 | #define R6 (-12) 14 | #define R7 (-11) 15 | #define R8 (-10) 16 | #define R9 (-9) 17 | #define R10 (-8) 18 | #define R11 (-7) 19 | #define R12 (-21) 20 | #define R13 (-20) 21 | 22 | #define AP (-21) 23 | #define FP (-20) 24 | #define SP (-5) 25 | #define PS (-1) 26 | #define PC (-2) 27 | 28 | /* 29 | * And now for something completely the same... 30 | */ 31 | #ifndef LOCORE 32 | /* THIS IS NOT COMPLETE BUT WILL SUFFICE FOR NOW */ 33 | struct regs { 34 | int r_pc; /* program counter */ 35 | int r_ps; /* processor status longword */ 36 | }; 37 | #endif 38 | -------------------------------------------------------------------------------- /usr/src/sun/sys/h/reboot.h: -------------------------------------------------------------------------------- 1 | /* @(#)reboot.h 1.1 85/05/30 SMI; from UCB 4.3 82/10/31 */ 2 | 3 | /* 4 | * Arguments to reboot system call and flags to init. 5 | * 6 | * On the VAX, these are passed to boot program in r11, 7 | * and on to init. 8 | * 9 | * On the Sun, these are parsed from the boot command line 10 | * and used to construct the argument list for init. 11 | */ 12 | #define RB_AUTOBOOT 0 /* flags for system auto-booting itself */ 13 | 14 | #define RB_ASKNAME 0x01 /* ask for file name to reboot from */ 15 | #define RB_SINGLE 0x02 /* reboot to single user only */ 16 | #define RB_NOSYNC 0x04 /* dont sync before reboot */ 17 | #define RB_HALT 0x08 /* don't reboot, just halt */ 18 | #define RB_INITNAME 0x10 /* name given for /etc/init */ 19 | #define RB_NOBOOTRC 0x20 /* don't run /etc/rc.boot */ 20 | 21 | #define RB_PANIC 0 /* reboot due to panic */ 22 | #define RB_BOOT 1 /* reboot due to boot() */ 23 | -------------------------------------------------------------------------------- /usr/src/sun/sys/sys/uipc_pipe.c: -------------------------------------------------------------------------------- 1 | /* @(#)uipc_pipe.c 1.1 85/05/30 SMI; from UCB 4.18 82/10/31 */ 2 | 3 | #include "../h/param.h" 4 | #include "../h/mbuf.h" 5 | #include "../h/protosw.h" 6 | #include "../h/socket.h" 7 | #include "../h/socketvar.h" 8 | #include "../h/unpcb.h" 9 | 10 | #define PIPSIZ 4096 11 | 12 | /* 13 | * Sneakily connect a pipe from wso to rso. 14 | * This will get cleaned up when socketpair is added. 15 | */ 16 | piconnect(wso, rso) 17 | struct socket *wso, *rso; 18 | { 19 | 20 | /* when we reserve memory this routine may fail */ 21 | sotounpcb(wso)->unp_conn = sotounpcb(rso); 22 | sotounpcb(rso)->unp_conn = sotounpcb(wso); 23 | wso->so_snd.sb_hiwat = PIPSIZ; 24 | wso->so_snd.sb_mbmax = 2*PIPSIZ; 25 | wso->so_state |= SS_ISCONNECTED|SS_CANTRCVMORE; 26 | rso->so_rcv.sb_hiwat = 0; 27 | rso->so_rcv.sb_mbmax = 0; 28 | rso->so_state |= SS_ISCONNECTED|SS_CANTSENDMORE; 29 | return (1); 30 | } 31 | -------------------------------------------------------------------------------- /usr/src/sun/sys/h/vtimes.h: -------------------------------------------------------------------------------- 1 | /* @(#)vtimes.h 1.1 85/05/30 SMI; from UCB 4.4 82/10/21 */ 2 | /* 3 | * Structure returned by vtimes() and in vwait(). 4 | * In vtimes() two of these are returned, one for the process itself 5 | * and one for all its children. In vwait() these are combined 6 | * by adding componentwise (except for maxrss, which is max'ed). 7 | */ 8 | struct vtimes { 9 | int vm_utime; /* user time (60'ths) */ 10 | int vm_stime; /* system time (60'ths) */ 11 | /* divide next two by utime+stime to get averages */ 12 | unsigned vm_idsrss; /* integral of d+s rss */ 13 | unsigned vm_ixrss; /* integral of text rss */ 14 | int vm_maxrss; /* maximum rss */ 15 | int vm_majflt; /* major page faults */ 16 | int vm_minflt; /* minor page faults */ 17 | int vm_nswap; /* number of swaps */ 18 | int vm_inblk; /* block reads */ 19 | int vm_oublk; /* block writes */ 20 | }; 21 | 22 | #ifdef KERNEL 23 | #endif 24 | -------------------------------------------------------------------------------- /usr/src/sun/sys/netinet/icmp_var.h: -------------------------------------------------------------------------------- 1 | /* @(#)icmp_var.h 1.1 85/05/30 SMI; from UCB 6.2 83/09/19 */ 2 | 3 | /* 4 | * Variables related to this implementation 5 | * of the internet control message protocol. 6 | */ 7 | struct icmpstat { 8 | /* statistics related to icmp packets generated */ 9 | int icps_error; /* # of calls to icmp_error */ 10 | int icps_oldshort; /* no error 'cuz old ip too short */ 11 | int icps_oldicmp; /* no error 'cuz old was icmp */ 12 | int icps_outhist[ICMP_IREQREPLY + 1]; 13 | /* statistics related to input messages processed */ 14 | int icps_badcode; /* icmp_code out of range */ 15 | int icps_tooshort; /* packet < ICMP_MINLEN */ 16 | int icps_checksum; /* bad checksum */ 17 | int icps_badlen; /* calculated bound mismatch */ 18 | int icps_reflect; /* number of responses */ 19 | int icps_inhist[ICMP_IREQREPLY + 1]; 20 | }; 21 | 22 | #ifdef KERNEL 23 | struct icmpstat icmpstat; 24 | #endif 25 | -------------------------------------------------------------------------------- /usr/src/lib/libc/gen/readdir.c: -------------------------------------------------------------------------------- 1 | #ifndef lint 2 | static char sccsid[] = "@(#)readdir.c 1.1 85/05/30 SMI"; 3 | #endif 4 | 5 | #include 6 | #include 7 | 8 | /* 9 | * get next entry in a directory. 10 | */ 11 | struct direct * 12 | readdir(dirp) 13 | register DIR *dirp; 14 | { 15 | register struct direct *dp; 16 | 17 | for (;;) { 18 | if (dirp->dd_loc == 0) { 19 | dirp->dd_size = getdirentries(dirp->dd_fd, 20 | dirp->dd_buf, dirp->dd_bsize, &dirp->dd_bbase); 21 | if (dirp->dd_size <= 0) 22 | return (NULL); 23 | dirp->dd_entno = 0; 24 | } 25 | if (dirp->dd_loc >= dirp->dd_size) { 26 | dirp->dd_loc = 0; 27 | continue; 28 | } 29 | dp = (struct direct *)(dirp->dd_buf + dirp->dd_loc); 30 | if (dp->d_reclen <= 0) 31 | return (NULL); 32 | dirp->dd_loc += dp->d_reclen; 33 | dirp->dd_entno++; 34 | if (dp->d_fileno == 0) 35 | continue; 36 | return (dp); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /usr/src/sun/sys/sys/uipc_proto.c: -------------------------------------------------------------------------------- 1 | /* @(#)uipc_proto.c 1.1 85/05/30 SMI; from UCB 4.28 83/05/27 */ 2 | 3 | #include "../h/param.h" 4 | #include "../h/socket.h" 5 | #include "../h/protosw.h" 6 | #include "../h/domain.h" 7 | #include "../h/mbuf.h" 8 | 9 | /* 10 | * Definitions of protocols supported in the UNIX domain. 11 | */ 12 | 13 | int uipc_usrreq(); 14 | int raw_init(),raw_usrreq(),raw_input(),raw_ctlinput(); 15 | 16 | struct protosw unixsw[] = { 17 | { SOCK_STREAM, PF_UNIX, 0, PR_CONNREQUIRED|PR_WANTRCVD, 18 | 0, 0, 0, 0, 19 | uipc_usrreq, 20 | 0, 0, 0, 0, 21 | }, 22 | { SOCK_DGRAM, PF_UNIX, 0, PR_ATOMIC|PR_ADDR|PR_RIGHTS, 23 | 0, 0, 0, 0, 24 | uipc_usrreq, 25 | 0, 0, 0, 0, 26 | }, 27 | { 0, 0, 0, 0, 28 | raw_input, 0, raw_ctlinput, 0, 29 | raw_usrreq, 30 | raw_init, 0, 0, 0, 31 | } 32 | }; 33 | 34 | struct domain unixdomain = 35 | { AF_UNIX, "unix", unixsw, &unixsw[sizeof(unixsw)/sizeof(unixsw[0])] }; 36 | -------------------------------------------------------------------------------- /usr/src/sun/sys/netinet/tcp_seq.h: -------------------------------------------------------------------------------- 1 | /* @(#)tcp_seq.h 1.1 85/05/30 SMI; from UCB 4.1 81/11/29 */ 2 | 3 | /* 4 | * TCP sequence numbers are 32 bit integers operated 5 | * on with modular arithmetic. These macros can be 6 | * used to compare such integers. 7 | */ 8 | #define SEQ_LT(a,b) ((int)((a)-(b)) < 0) 9 | #define SEQ_LEQ(a,b) ((int)((a)-(b)) <= 0) 10 | #define SEQ_GT(a,b) ((int)((a)-(b)) > 0) 11 | #define SEQ_GEQ(a,b) ((int)((a)-(b)) >= 0) 12 | 13 | /* 14 | * Macros to initialize tcp sequence numbers for 15 | * send and receive from initial send and receive 16 | * sequence numbers. 17 | */ 18 | #define tcp_rcvseqinit(tp) \ 19 | (tp)->rcv_nxt = (tp)->irs + 1 20 | 21 | #define tcp_sendseqinit(tp) \ 22 | (tp)->snd_una = (tp)->snd_nxt = (tp)->snd_max = (tp)->snd_up = \ 23 | (tp)->iss 24 | 25 | #define TCP_ISSINCR 128 /* increment for tcp_iss each second */ 26 | 27 | #ifdef KERNEL 28 | tcp_seq tcp_iss; /* tcp initial send seq # */ 29 | #endif 30 | -------------------------------------------------------------------------------- /usr/src/include/fcntl.h: -------------------------------------------------------------------------------- 1 | /* fcntl.h 4.2 83/09/25 */ 2 | 3 | /* 4 | * Flag values accessible to open(2) and fcntl(2) 5 | * (The first three can only be set by open) 6 | */ 7 | #define O_RDONLY 0 8 | #define O_WRONLY 1 9 | #define O_RDWR 2 10 | #define O_NDELAY FNDELAY /* Non-blocking I/O */ 11 | #define O_APPEND FAPPEND /* append (writes guaranteed at the end) */ 12 | 13 | #ifndef F_DUPFD 14 | /* fcntl(2) requests */ 15 | #define F_DUPFD 0 /* Duplicate fildes */ 16 | #define F_GETFD 1 /* Get fildes flags */ 17 | #define F_SETFD 2 /* Set fildes flags */ 18 | #define F_GETFL 3 /* Get file flags */ 19 | #define F_SETFL 4 /* Set file flags */ 20 | #define F_GETOWN 5 /* Get owner */ 21 | #define F_SETOWN 6 /* Set owner */ 22 | 23 | /* flags for F_GETFL, F_SETFL-- copied from */ 24 | #define FNDELAY 00004 /* non-blocking reads */ 25 | #define FAPPEND 00010 /* append on each write */ 26 | #define FASYNC 00100 /* signal pgrp when data ready */ 27 | #endif 28 | -------------------------------------------------------------------------------- /usr/man/man8/fsirand.8: -------------------------------------------------------------------------------- 1 | .\" @(#)fsirand.8 1.2 85/04/05 SMI; 2 | .TH FSIRAND 8 "1 February 1985" 3 | .SH NAME 4 | fsirand \- install random inode generation numbers 5 | .SH SYNOPSIS 6 | .B fsirand 7 | [ 8 | .B \-p 9 | ] special 10 | .SH DESCRIPTION 11 | .IX "fsirand command" "" "\fLfsirand\fP \(em install random inode generation numbers" 12 | .I Fsirand 13 | installs random inode generation numbers on all the inodes on device 14 | .I special, 15 | and also installs a filesystem ID in the superblock. 16 | This helps increase the security of filesystems exported by NFS. 17 | .LP 18 | .I Fsirand 19 | must be used only on an unmounted filesystem 20 | that has been checked with 21 | .IR fsck (8). 22 | The only exception is that it can be used 23 | on the root filesystem in single-user mode, 24 | if the system is immediately re-booted afterwords. 25 | .SH OPTIONS 26 | .TP 27 | .B \-p 28 | Print out the generation numbers for all the inodes, 29 | but do not change the generation numbers. 30 | -------------------------------------------------------------------------------- /usr/src/sun/sys/netinet/tcp.h: -------------------------------------------------------------------------------- 1 | /* @(#)tcp.h 1.1 85/05/30 SMI; from UCB 1.24 83/07/06 */ 2 | 3 | typedef u_long tcp_seq; 4 | /* 5 | * TCP header. 6 | * Per RFC 793, September, 1981. 7 | */ 8 | struct tcphdr { 9 | u_short th_sport; /* source port */ 10 | u_short th_dport; /* destination port */ 11 | tcp_seq th_seq; /* sequence number */ 12 | tcp_seq th_ack; /* acknowledgement number */ 13 | #ifdef vax 14 | u_char th_x2:4, /* (unused) */ 15 | th_off:4; /* data offset */ 16 | #endif 17 | #ifdef mc68000 18 | u_char th_off:4, /* data offset */ 19 | th_x2:4; /* (unused) */ 20 | #endif 21 | u_char th_flags; 22 | #define TH_FIN 0x01 23 | #define TH_SYN 0x02 24 | #define TH_RST 0x04 25 | #define TH_PUSH 0x08 26 | #define TH_ACK 0x10 27 | #define TH_URG 0x20 28 | u_short th_win; /* window */ 29 | u_short th_sum; /* checksum */ 30 | u_short th_urp; /* urgent pointer */ 31 | }; 32 | 33 | #define TCPOPT_EOL 0 34 | #define TCPOPT_NOP 1 35 | #define TCPOPT_MAXSEG 2 36 | -------------------------------------------------------------------------------- /usr/man/man8/mountd.8c: -------------------------------------------------------------------------------- 1 | .\" @(#)mountd.8c 1.3 85/04/05 SMI; 2 | .TH MOUNTD 8C "1 February 1985" 3 | .SH NAME 4 | mountd \- NFS mount request server 5 | .SH SYNOPSIS 6 | .B /usr/etc/rpc.mountd 7 | .SH DESCRIPTION 8 | .IX "mountd command" "" "\fLmountd\fP \(em NFS mount server" 9 | .IX "NFS mount server" "" "NFS mount server \(em \fLmountd\fP" 10 | .IX servers mountd "" "\fLmountd\fP \(em mount request server" 11 | .LP 12 | .I Mountd 13 | is an 14 | .IR rpc (4) 15 | server that answers file system mount requests. 16 | It reads the file 17 | .IR /etc/exports , 18 | described in 19 | .IR exports (5), 20 | to determine which file systems are available to 21 | which machines and users. It also provides information 22 | as to which clients have file systems mounted. 23 | This information can be printed using the 24 | .IR showmount (8) 25 | command. 26 | .LP 27 | The 28 | .I mountd 29 | daemon is normally invoked by 30 | .IR inetd (8C). 31 | .SH "SEE ALSO" 32 | exports(5), services(5), inetd(8), showmount(8) 33 | -------------------------------------------------------------------------------- /usr/src/lib/libc/rpc/rpc.h: -------------------------------------------------------------------------------- 1 | /* @(#)rpc.h 1.1 85/05/30 SMI */ 2 | 3 | /* 4 | * rpc.h, Just includes the billions of rpc header files necessary to 5 | * do remote procedure calling. 6 | * 7 | * Copyright (C) 1984, Sun Microsystems, Inc. 8 | */ 9 | 10 | #include /* some typedefs */ 11 | #include 12 | 13 | /* external data representation interfaces */ 14 | #include /* generic (de)serializer */ 15 | 16 | /* Client side only authentication */ 17 | #include /* generic authenticator (client side) */ 18 | 19 | /* Client side (mostly) remote procedure call */ 20 | #include /* generic rpc stuff */ 21 | 22 | /* semi-private protocol headers */ 23 | #include /* protocol for rpc messages */ 24 | #include /* protocol for unix style cred */ 25 | 26 | /* Server side only remote procedure callee */ 27 | #include /* service manager and multiplexer */ 28 | #include /* service side authenticator */ 29 | -------------------------------------------------------------------------------- /usr/src/sun/sys/nfs/nfs_clnt.h: -------------------------------------------------------------------------------- 1 | /* @(#)nfs_clnt.h 1.1 85/05/30 SMI */ 2 | 3 | /* 4 | * vfs pointer to mount info 5 | */ 6 | #define vftomi(vfsp) ((struct mntinfo *)((vfsp)->vfs_data)) 7 | 8 | /* 9 | * vnode pointer to mount info 10 | */ 11 | #define vtomi(vp) ((struct mntinfo *)(((vp)->v_vfsp)->vfs_data)) 12 | 13 | /* 14 | * NFS vnode to server's block size 15 | */ 16 | #define vtoblksz(vp) (vtomi(vp)->mi_bsize) 17 | 18 | 19 | /* 20 | * NFS private data per mounted file system 21 | */ 22 | struct mntinfo { 23 | struct sockaddr_in mi_addr; /* server's address */ 24 | struct vnode *mi_rootvp; /* root vnode */ 25 | int mi_hard; /* hard or soft mount */ 26 | int mi_refct; /* active vnodes for this vfs */ 27 | long mi_tsize; /* preferred transfer size (bytes) */ 28 | long mi_bsize; /* server's disk block size */ 29 | int mi_mntno; /* kludge to set client rdev for stat*/ 30 | }; 31 | 32 | /* 33 | * enum to specifiy cache flushing action when file data is stale 34 | */ 35 | enum staleflush {NOFLUSH, SFLUSH}; 36 | -------------------------------------------------------------------------------- /usr/man/man2/nfssvc.2: -------------------------------------------------------------------------------- 1 | .\" @(#)nfssvc.2 1.2 85/04/04 SMI; from UCB 4.2 2 | .TH NFSSVC 2 "1 February 1985" 3 | .SH NAME 4 | nfssvc, async_daemon \- NFS daemons 5 | .SH SYNOPSIS 6 | .nf 7 | .ft B 8 | nfssvc(sock) 9 | int sock; 10 | .PP 11 | .ft B 12 | async_daemon() 13 | .pp 14 | .ft B 15 | .IX nfssvc "" \fLnfssvc\fP 16 | .IX "socket operations" nfssvc "" \fLnfssvc\fP 17 | .IX "network file system daemons" 18 | .IX daemons "network file system" 19 | .IX async_daemon "" \fLasync_daemon\fP 20 | .IX "socket operations" async_daemon "" \fLasync_daemon\fP 21 | .SH DESCRIPTION 22 | .I Nfssvc 23 | starts an NFS 24 | daemon listening on socket 25 | .IR sock . 26 | The socket must be AF_INET, and SOCK_DGRAM (protocol UDP/IP). 27 | The system call will return only if the process is killed. 28 | .PP 29 | .I Async_daemon 30 | implements the NFS daemon 31 | that handles asynchronous I/O for an NFS client. 32 | The system call never returns. 33 | .SH BUGS 34 | These two system calls allow kernel processes to have user context. 35 | .SH SEE ALSO 36 | mountd(8) 37 | -------------------------------------------------------------------------------- /usr/src/sun/sys/netpup/pup_proto.c: -------------------------------------------------------------------------------- 1 | /* @(#)pup_proto.c 1.1 85/05/30 SMI; from UCB 5.3 83/06/30 */ 2 | 3 | #include "../h/param.h" 4 | #include "../h/socket.h" 5 | #include "../h/protosw.h" 6 | #include "../h/domain.h" 7 | 8 | /* 9 | * PUP-I protocol family: raw interface 10 | */ 11 | int rpup_output(); 12 | extern int raw_usrreq(); 13 | 14 | struct protosw pupsw[] = { 15 | { SOCK_RAW, PF_PUP, 0, PR_ATOMIC|PR_ADDR, 16 | 0, rpup_output, 0, 0, 17 | raw_usrreq, 18 | 0, 0, 0, 0, 19 | }, 20 | }; 21 | 22 | struct domain pupdomain = 23 | { AF_PUP, "pup", pupsw, &pupsw[sizeof(pupsw)/sizeof(pupsw[0])] }; 24 | 25 | #ifdef notdef 26 | /* 27 | * 3 Mb/s Ethernet link protocol family: raw interface 28 | */ 29 | int raw_enoutput(); 30 | extern int raw_usrreq(); 31 | 32 | struct protosw ensw[] = { 33 | { SOCK_RAW, PF_ETHERLINK, 0, PR_ATOMIC|PR_ADDR, 34 | 0, raw_enoutput, 0, 0, 35 | raw_usrreq, 36 | 0, 0, 0, 0, 37 | }, 38 | }; 39 | 40 | struct domain endomain = 41 | { AF_ETHERLINK "ether", ensw, &ensw[sizeof(ensw)/sizeof(ensw[0])] }; 42 | #endif 43 | -------------------------------------------------------------------------------- /usr/src/lib/libc/gen/opendir.c: -------------------------------------------------------------------------------- 1 | #ifndef lint 2 | static char sccsid[] = "@(#)opendir.c 1.1 85/05/30 SMI"; 3 | #endif 4 | 5 | #include 6 | #include 7 | #include 8 | 9 | /* 10 | * open a directory. 11 | */ 12 | DIR * 13 | opendir(name) 14 | char *name; 15 | { 16 | register DIR *dirp; 17 | register int fd; 18 | struct stat sb; 19 | extern char *malloc(); 20 | 21 | if ((fd = open(name, 0)) == -1) 22 | return (NULL); 23 | if (fstat(fd, &sb) == -1) { 24 | close(fd); 25 | return (NULL); 26 | } 27 | if ((sb.st_mode & S_IFMT) != S_IFDIR) { 28 | close(fd); 29 | return (NULL); 30 | } 31 | if (((dirp = (DIR *)malloc(sizeof(DIR))) == NULL) || 32 | ((dirp->dd_buf = malloc((int)sb.st_blksize)) == NULL)) { 33 | if (dirp) { 34 | if (dirp->dd_buf) { 35 | free(dirp->dd_buf); 36 | } 37 | free(dirp); 38 | } 39 | close(fd); 40 | return (NULL); 41 | } 42 | dirp->dd_bsize = sb.st_blksize; 43 | dirp->dd_bbase = 0; 44 | dirp->dd_entno = 0; 45 | dirp->dd_fd = fd; 46 | dirp->dd_loc = 0; 47 | return (dirp); 48 | } 49 | -------------------------------------------------------------------------------- /usr/man/man8/rpcinfo.8: -------------------------------------------------------------------------------- 1 | .\" @(#)rpcinfo.8 1.2 85/04/05 SMI; 2 | .TH RPCINFO 8 "1 February 1985" 3 | .SH NAME 4 | rpcinfo \- report RPC information 5 | .SH SYNOPSIS 6 | .B "rpcinfo \-p" 7 | [ host ] 8 | .br 9 | .B "rpcinfo \-u" 10 | host program-number version-number 11 | .br 12 | .B "rpcinfo \-t" 13 | host program-number version-number 14 | .SH DESCRIPTION 15 | .IX "rpcinfo command" "" "\fLrpcinfo\fP \(em report RPC information" 16 | .I Rpcinfo 17 | makes an RPC call to an RPC server and reports what it finds. 18 | .SH OPTIONS 19 | .TP 20 | .B \-p 21 | Probe the portmapper on 22 | .IR host , 23 | and print a list of all registered RPC programs. 24 | If 25 | .I host 26 | is not specified, it defaults to the value returned by 27 | .IR hostname (1). 28 | .TP 29 | .B \-u 30 | Make an RPC call to procedure 0 of 31 | .I program-number 32 | using UDP, and report whether a response was received. 33 | .TP 34 | .B \-t 35 | Make an RPC call to procedure 0 of 36 | .I program-number 37 | using TCP, and report whether a response was received. 38 | .SH "SEE ALSO" 39 | .I "RPC Reference Manual," 40 | portmap(8) 41 | -------------------------------------------------------------------------------- /usr/src/lib/libc/sys/SYS.h: -------------------------------------------------------------------------------- 1 | /* @(#)SYS.h 1.1 85/05/30 SMI; from UCB 4.1 83/05/10 */ 2 | 3 | #include 4 | 5 | #if vax 6 | #ifdef PROF 7 | #define ENTRY(x) .globl _/**/x; .align 2; _/**/x: .word 0; \ 8 | .data; 1:; .long 0; .text; moval 1b,r0; jsb mcount 9 | #else 10 | #define ENTRY(x) .globl _/**/x; .align 2; _/**/x: .word 0 11 | #endif PROF 12 | #define SYSCALL(x) err: jmp cerror; ENTRY(x); chmk $SYS_/**/x; jcs err 13 | #define PSEUDO(x,y) ENTRY(x); chmk $SYS_/**/y 14 | #define CALL(x,y) calls $x, _/**/y 15 | #define RET ret 16 | 17 | .globl cerror 18 | #endif 19 | 20 | #if sun 21 | .globl cerror 22 | #ifdef PROF 23 | .globl mcount 24 | #define ENTRY(x) .globl _/**/x;\ 25 | _/**/x: link a6,#0;\ 26 | lea x/**/1,a0;\ 27 | .data; x/**/1: .long 0; .text;\ 28 | jsr mcount;\ 29 | unlk a6 30 | #else 31 | #define ENTRY(x) .globl _/**/x; _/**/x: 32 | #endif 33 | 34 | #define PARAM sp@(4) 35 | #define PARAM2 sp@(8) 36 | #define PSEUDO(x,y) ENTRY(x); pea SYS_/**/y; trap #0 37 | #define SYSCALL(x) err: jmp cerror; ENTRY(x); pea SYS_/**/x; trap #0; jcs err 38 | #define RET rts 39 | #endif 40 | -------------------------------------------------------------------------------- /usr/src/sun/sys/netpup/pup.h: -------------------------------------------------------------------------------- 1 | /* @(#)pup.h 1.1 85/05/30 SMI; from UCB 4.6 83/05/30 */ 2 | 3 | struct pupport { 4 | u_char pup_net; 5 | u_char pup_host; 6 | u_char pup_socket[4]; 7 | }; 8 | 9 | /* 10 | * PUP header. 11 | */ 12 | struct pup_header { 13 | u_short pup_length; 14 | u_char pup_tcontrol; /* transport control */ 15 | u_char pup_type; /* protocol type */ 16 | u_long pup_id; /* used by protocols */ 17 | u_char pup_dnet; /* destination */ 18 | u_char pup_dhost; 19 | u_char pup_dsock[4]; 20 | u_char pup_snet; /* source */ 21 | u_char pup_shost; 22 | u_char pup_ssock[4]; 23 | }; 24 | 25 | #define PUP_TRACE 01 /* trace pup in network */ 26 | 27 | #define MINPUPSIZ (sizeof (struct pup_header) + sizeof (short)) 28 | #define MAXPUPDATA 532 29 | #define MAXPUPSIZ (MINPUPSIZ + MAXPUPDATA) 30 | 31 | #define PUP_NOCKSUM 0xffff /* no checksum supplied */ 32 | 33 | /* 34 | * A sockaddr, as seen through the eyes of PUP. 35 | */ 36 | struct sockaddr_pup { 37 | short spup_family; 38 | short spup_zero1; 39 | u_char spup_net; 40 | u_char spup_host; 41 | u_char spup_sock[4]; 42 | char spup_zero2[4]; 43 | }; 44 | -------------------------------------------------------------------------------- /usr/man/man8/nfsd.8c: -------------------------------------------------------------------------------- 1 | .\" @(#)nfsd.8c 1.4 85/04/05 SMI; 2 | .TH NFSD 8C "1 February 1985" 3 | .SH NAME 4 | nfsd, biod \- NFS daemons 5 | .SH SYNOPSIS 6 | .B /etc/nfsd 7 | [ nservers ] 8 | .sp .5 9 | .B /etc/biod 10 | [ nservers ] 11 | .SH DESCRIPTION 12 | .IX "nfsd command" "" "\fLnfsd\fP \(em NFS daemon" 13 | .IX "biod command" "" "\fLbiod\fP \(em NFS daemon" 14 | .IX servers nfsd "" "\fLnfsd\fP \(em NFS daemon" 15 | .IX servers biod "" "\fLbiod\fP \(em NFS daemon" 16 | .I Nfsd 17 | starts the 18 | .IR nfs (4) 19 | server daemons that handle client filesystem requests. 20 | .I Nservers 21 | is the number of file system request daemons to start. 22 | This number should be based on the load expected on this server; 23 | four is a good number. 24 | If 25 | .I nservers 26 | is not specified it defaults to one. 27 | .PP 28 | .I Biod 29 | starts 30 | .I nservers 31 | asynchronous block I/O daemons. 32 | This command is used on a NFS client to handle read-ahead and write-behind 33 | of buffer cached blocks. 34 | A good value for 35 | .I nservers 36 | is four; if not specified it defaults to one. 37 | .SH "SEE ALSO" 38 | mountd(8c), exports(5) 39 | -------------------------------------------------------------------------------- /samples/services: -------------------------------------------------------------------------------- 1 | # 2 | # @(#)services 1.1 84/12/20 SMI 3 | # 4 | # Network services, Internet style 5 | # 6 | echo 7/udp 7 | discard 9/udp sink null 8 | systat 11/tcp 9 | daytime 13/tcp 10 | netstat 15/tcp 11 | ftp 21/tcp 12 | telnet 23/tcp 13 | smtp 25/tcp mail 14 | time 37/tcp timserver 15 | name 42/tcp nameserver 16 | whois 43/tcp nicname 17 | mtp 57/tcp # deprecated 18 | hostnames 101/tcp hostname # usually from sri-nic 19 | sunrpc 111/udp 20 | sunrpc 111/tcp 21 | # 22 | # Host specific functions 23 | # 24 | tftp 69/udp 25 | rje 77/tcp 26 | finger 79/tcp 27 | link 87/tcp ttylink 28 | supdup 95/tcp 29 | ingreslock 1524/tcp 30 | # 31 | # UNIX specific services 32 | # 33 | exec 512/tcp 34 | login 513/tcp 35 | shell 514/tcp cmd # no passwords used 36 | printer 515/tcp spooler # experimental 37 | efs 520/tcp # for LucasFilm 38 | courier 530/tcp rpc # experimental 39 | biff 512/udp comsat 40 | who 513/udp whod 41 | syslog 514/udp 42 | talk 517/udp 43 | route 520/udp router routed # 521 also 44 | new-rwho 550/udp new-who # experimental 45 | rmonitor 560/udp rmonitord # experimental 46 | monitor 561/udp # experimental 47 | -------------------------------------------------------------------------------- /usr/src/lib/libc/rpcsvc/yppasswdxdr.c: -------------------------------------------------------------------------------- 1 | #ifndef lint 2 | static char sccsid[] = "@(#)yppasswdxdr.c 1.1 85/05/30 Copyr 1985 Sun Micro"; 3 | #endif 4 | 5 | /* 6 | * Copyright (c) 1985 by Sun Microsystems, Inc. 7 | */ 8 | 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | xdr_yppasswd(xdrsp, pp) 15 | XDR *xdrsp; 16 | struct yppasswd *pp; 17 | { 18 | if (xdr_wrapstring(xdrsp, &pp->oldpass) == 0) 19 | return (0); 20 | if (xdr_passwd(xdrsp, &pp->newpw) == 0) 21 | return (0); 22 | return (1); 23 | } 24 | 25 | xdr_passwd(xdrsp, pw) 26 | XDR *xdrsp; 27 | struct passwd *pw; 28 | { 29 | if (xdr_wrapstring(xdrsp, &pw->pw_name) == 0) 30 | return (0); 31 | if (xdr_wrapstring(xdrsp, &pw->pw_passwd) == 0) 32 | return (0); 33 | if (xdr_int(xdrsp, &pw->pw_uid) == 0) 34 | return (0); 35 | if (xdr_int(xdrsp, &pw->pw_gid) == 0) 36 | return (0); 37 | if (xdr_wrapstring(xdrsp, &pw->pw_gecos) == 0) 38 | return (0); 39 | if (xdr_wrapstring(xdrsp, &pw->pw_dir) == 0) 40 | return (0); 41 | if (xdr_wrapstring(xdrsp, &pw->pw_shell) == 0) 42 | return (0); 43 | } 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /usr/src/sun/sys/h/stat.h: -------------------------------------------------------------------------------- 1 | /* @(#)stat.h 1.1 85/05/30 SMI; from UCB 4.7 83/05/21 */ 2 | 3 | struct stat 4 | { 5 | dev_t st_dev; 6 | ino_t st_ino; 7 | unsigned short st_mode; 8 | short st_nlink; 9 | short st_uid; 10 | short st_gid; 11 | dev_t st_rdev; 12 | off_t st_size; 13 | time_t st_atime; 14 | int st_spare1; 15 | time_t st_mtime; 16 | int st_spare2; 17 | time_t st_ctime; 18 | int st_spare3; 19 | long st_blksize; 20 | long st_blocks; 21 | long st_spare4[2]; 22 | }; 23 | 24 | #define S_IFMT 0170000 /* type of file */ 25 | #define S_IFDIR 0040000 /* directory */ 26 | #define S_IFCHR 0020000 /* character special */ 27 | #define S_IFBLK 0060000 /* block special */ 28 | #define S_IFREG 0100000 /* regular */ 29 | #define S_IFLNK 0120000 /* symbolic link */ 30 | #define S_IFSOCK 0140000/* socket */ 31 | #define S_ISUID 0004000 /* set user id on execution */ 32 | #define S_ISGID 0002000 /* set group id on execution */ 33 | #define S_ISVTX 0001000 /* save swapped text even after use */ 34 | #define S_IREAD 0000400 /* read permission, owner */ 35 | #define S_IWRITE 0000200 /* write permission, owner */ 36 | #define S_IEXEC 0000100 /* execute/search permission, owner */ 37 | -------------------------------------------------------------------------------- /usr/src/sun/sys/h/pathname.h: -------------------------------------------------------------------------------- 1 | /* @(#)pathname.h 1.1 85/05/30 SMI */ 2 | 3 | /* 4 | * Pathname structure. 5 | * System calls which operate on path names gather the 6 | * pathname from system call into this structure and reduce 7 | * it by peeling off translated components. If a symbolic 8 | * link is encountered the new pathname to be translated 9 | * is also assembled in this structure. 10 | */ 11 | struct pathname { 12 | char *pn_buf; /* underlying storage */ 13 | char *pn_path; /* remaining pathname */ 14 | int pn_pathlen; /* remaining length */ 15 | }; 16 | 17 | #define pn_peekchar(PNP) ((PNP)->pn_pathlen>0?*((PNP)->pn_path):0) 18 | #define pn_pathleft(PNP) ((PNP)->pn_pathlen) 19 | 20 | extern int pn_alloc(); /* allocat buffer for pathname */ 21 | extern int pn_get(); /* allocate buf and copy path into it */ 22 | extern int pn_getchar(); /* get next pathname char */ 23 | extern int pn_set(); /* set pathname to string */ 24 | extern int pn_combine(); /* combine to pathnames (for symlink) */ 25 | extern int pn_getcomponent(); /* get next component of pathname */ 26 | extern void pn_skipslash(); /* skip over slashes */ 27 | extern void pn_free(); /* free pathname buffer */ 28 | -------------------------------------------------------------------------------- /usr/src/sun/sys/net/af.c: -------------------------------------------------------------------------------- 1 | /* @(#)af.c 1.1 85/05/30 SMI; from UCB 4.7 82/10/17 */ 2 | 3 | #include "../h/param.h" 4 | #include "../h/mbuf.h" 5 | #include "../h/protosw.h" 6 | #include "../h/socket.h" 7 | #include "../h/socketvar.h" 8 | #include "../net/af.h" 9 | 10 | /* 11 | * Address family support routines 12 | */ 13 | int null_hash(), null_netmatch(); 14 | #define AFNULL \ 15 | { null_hash, null_netmatch } 16 | 17 | #ifdef INET 18 | extern int inet_hash(), inet_netmatch(); 19 | #define AFINET \ 20 | { inet_hash, inet_netmatch } 21 | #else 22 | #define AFINET AFNULL 23 | #endif 24 | 25 | #ifdef PUP 26 | extern int pup_hash(), pup_netmatch(); 27 | #define AFPUP \ 28 | { pup_hash, pup_netmatch } 29 | #else 30 | #define AFPUP AFNULL 31 | #endif 32 | 33 | struct afswitch afswitch[AF_MAX] = { 34 | AFNULL, AFNULL, AFINET, AFINET, AFPUP, 35 | AFNULL, AFNULL, AFNULL, AFNULL, AFNULL, 36 | AFNULL 37 | }; 38 | 39 | /*ARGSUSED*/ 40 | null_hash(addr, hp) 41 | struct sockaddr *addr; 42 | struct afhash *hp; 43 | { 44 | 45 | hp->afh_nethash = hp->afh_hosthash = 0; 46 | } 47 | 48 | /*ARGSUSED*/ 49 | null_netmatch(a1, a2) 50 | struct sockaddr *a1, *a2; 51 | { 52 | 53 | return (0); 54 | } 55 | -------------------------------------------------------------------------------- /usr/src/sun/sys/netinet/in_pcb.h: -------------------------------------------------------------------------------- 1 | /* @(#)in_pcb.h 1.1 85/05/30 SMI; from UCB 4.5 82/10/20 */ 2 | 3 | /* 4 | * Common structure pcb for internet protocol implementation. 5 | * Here are stored pointers to local and foreign host table 6 | * entries, local and foreign socket numbers, and pointers 7 | * up (to a socket structure) and down (to a protocol-specific) 8 | * control block. 9 | */ 10 | struct inpcb { 11 | struct inpcb *inp_next,*inp_prev; 12 | /* pointers to other pcb's */ 13 | struct inpcb *inp_head; /* pointer back to chain of inpcb's 14 | for this protocol */ 15 | struct in_addr inp_faddr; /* foreign host table entry */ 16 | u_short inp_fport; /* foreign port */ 17 | struct in_addr inp_laddr; /* local host table entry */ 18 | u_short inp_lport; /* local port */ 19 | struct socket *inp_socket; /* back pointer to socket */ 20 | caddr_t inp_ppcb; /* pointer to per-protocol pcb */ 21 | struct route inp_route; /* placeholder for routing entry */ 22 | }; 23 | 24 | #define INPLOOKUP_WILDCARD 1 25 | #define INPLOOKUP_SETLOCAL 2 26 | 27 | #define sotoinpcb(so) ((struct inpcb *)(so)->so_pcb) 28 | 29 | #ifdef KERNEL 30 | struct inpcb *in_pcblookup(); 31 | #endif 32 | -------------------------------------------------------------------------------- /usr/src/sun/sys/vax/param.h: -------------------------------------------------------------------------------- 1 | /* @(#)param.h 1.1 85/05/30 SMI; from UCB 6.1 83/07/29 */ 2 | 3 | /* 4 | * Machine dependent constants for vax. 5 | */ 6 | #define NBPG 512 /* bytes/page */ 7 | #define PGOFSET (NBPG-1) /* byte offset into page */ 8 | #define PGSHIFT 9 /* LOG2(NBPG) */ 9 | 10 | #define CLSIZE 2 11 | #define CLSIZELOG2 1 12 | 13 | #define SSIZE 4 /* initial stack size/NBPG */ 14 | #define SINCR 4 /* increment of stack/NBPG */ 15 | 16 | #define UPAGES 10 /* pages of u-area */ 17 | 18 | /* 19 | * Some macros for units conversion 20 | */ 21 | /* Core clicks (512 bytes) to segments and vice versa */ 22 | #define ctos(x) (x) 23 | #define stoc(x) (x) 24 | 25 | /* Core clicks (512 bytes) to disk blocks */ 26 | #define ctod(x) (x) 27 | #define dtoc(x) (x) 28 | #define dtob(x) ((x)<<9) 29 | 30 | /* clicks to bytes */ 31 | #define ctob(x) ((x)<<9) 32 | 33 | /* bytes to clicks */ 34 | #define btoc(x) ((((unsigned)(x)+511)>>9)) 35 | 36 | /* 37 | * Macros to decode processor status word. 38 | */ 39 | #define USERMODE(ps) (((ps) & PSL_CURMOD) == PSL_CURMOD) 40 | #define BASEPRI(ps) (((ps) & PSL_IPL) == 0) 41 | 42 | #define DELAY(n) { register int N = (n); while (--N > 0); } 43 | -------------------------------------------------------------------------------- /usr/man/man8/portmap.8c: -------------------------------------------------------------------------------- 1 | .\" @(#)portmap.8c 1.2 85/04/05 SMI; 2 | .TH PORTMAP 8C "1 February 1985" 3 | .SH NAME 4 | portmap \- DARPA port to RPC program number mapper 5 | .SH SYNOPSIS 6 | .B /usr/etc/rpc.portmap 7 | .SH DESCRIPTION 8 | .IX "portmap command" "" "\fLportmap\fP \(em DARPA to RPC mapper" 9 | .IX "DARPA to RPC mapper" "" "DARPA to RPC mapper \(em \fLportmap\fP" 10 | .I Portmap 11 | is a server that converts RPC program numbers 12 | into DARPA protocol port numbers. 13 | It must be running in order to make RPC calls. 14 | .PP 15 | When an RPC server is started, it will tell 16 | .I portmap 17 | what port number it is listening to, 18 | and what RPC program numbers it is prepared to serve. 19 | When a client wishes to make an RPC call to a given program number, 20 | it will first contact 21 | .I portmap 22 | on the server machine to determine 23 | the port number where RPC packets should be sent. 24 | .PP 25 | Normally, standard RPC servers are started by 26 | .IR inetd (8c), 27 | so 28 | .I portmap 29 | must be started before 30 | .I inetd 31 | is invoked. 32 | .SH "SEE ALSO" 33 | servers(5), rpcinfo(8), inetd(8) 34 | .SH BUGS 35 | If 36 | .I portmap 37 | crashes, all servers must be restarted. 38 | -------------------------------------------------------------------------------- /usr/src/etc/biod.c: -------------------------------------------------------------------------------- 1 | #ifndef lint 2 | static char sccsid[] = "@(#)biod.c 1.1 85/05/30 Copyr 1983 Sun Micro"; 3 | #endif 4 | 5 | #include 6 | #include 7 | #include 8 | 9 | /* 10 | * This is the NFS asynchronous block I/O daemon 11 | */ 12 | 13 | main(argc, argv) 14 | int argc; 15 | char *argv[]; 16 | { 17 | extern int errno; 18 | int pid; 19 | int count; 20 | 21 | if (argc > 2) { 22 | usage(argv[0]); 23 | } 24 | 25 | if (argc == 2) { 26 | count = atoi(argv[1]); 27 | if (count < 0) { 28 | usage(argv[0]); 29 | } 30 | } else { 31 | count = 1; 32 | } 33 | 34 | { int tt = open("/dev/tty", O_RDWR); 35 | if (tt > 0) { 36 | ioctl(tt, TIOCNOTTY, 0); 37 | close(tt); 38 | } 39 | } 40 | while (count--) { 41 | pid = fork(); 42 | if (pid == 0) { 43 | async_daemon(); /* Should never return */ 44 | fprintf(stderr, "%s: async_daemon ", argv[0]); 45 | perror(""); 46 | exit(1); 47 | } 48 | if (pid < 0) { 49 | fprintf(stderr, "%s: cannot fork", argv[0]); 50 | perror(""); 51 | exit(1); 52 | } 53 | } 54 | } 55 | 56 | usage(name) 57 | char *name; 58 | { 59 | 60 | fprintf(stderr, "usage: %s []\n", name); 61 | exit(1); 62 | } 63 | -------------------------------------------------------------------------------- /usr/src/include/stdio.h: -------------------------------------------------------------------------------- 1 | /* stdio.h 1.5 83/08/11 */ 2 | #define BUFSIZ 1024 3 | #define _NFILE 20 4 | # ifndef FILE 5 | extern struct _iobuf { 6 | int _cnt; 7 | char *_ptr; 8 | char *_base; 9 | int _bufsiz; 10 | short _flag; 11 | char _file; 12 | } _iob[_NFILE]; 13 | # endif 14 | 15 | #define _IOREAD 01 16 | #define _IOWRT 02 17 | #define _IONBF 04 18 | #define _IOMYBUF 010 19 | #define _IOEOF 020 20 | #define _IOERR 040 21 | #define _IOSTRG 0100 22 | #define _IOLBF 0200 23 | #define _IORW 0400 24 | #define NULL 0 25 | #define FILE struct _iobuf 26 | #define EOF (-1) 27 | 28 | #define stdin (&_iob[0]) 29 | #define stdout (&_iob[1]) 30 | #define stderr (&_iob[2]) 31 | #define getc(p) (--(p)->_cnt>=0? *(p)->_ptr++&0377:_filbuf(p)) 32 | #define getchar() getc(stdin) 33 | #define putc(x,p) (--(p)->_cnt>=0? ((int)(*(p)->_ptr++=(unsigned)(x))):_flsbuf((unsigned)(x),p)) 34 | #define putchar(x) putc(x,stdout) 35 | #define feof(p) (((p)->_flag&_IOEOF)!=0) 36 | #define ferror(p) (((p)->_flag&_IOERR)!=0) 37 | #define fileno(p) ((p)->_file) 38 | 39 | FILE *fopen(); 40 | FILE *fdopen(); 41 | FILE *freopen(); 42 | long ftell(); 43 | char *fgets(); 44 | #ifdef vax 45 | char *sprintf(); /* too painful to do right */ 46 | #endif 47 | -------------------------------------------------------------------------------- /usr/man/man1/rwall.1: -------------------------------------------------------------------------------- 1 | .TH RWALL 1 "1 February 1985" 2 | .\" @(#)rwall.1 1.2 85/04/05 SMI; 3 | .SH NAME 4 | rwall \- write to all users over a network 5 | .SH SYNOPSIS 6 | .B rwall 7 | host1 host2 ... 8 | .br 9 | .B rwall 10 | .B \-n 11 | netgroup1 netgroup2 ... 12 | .br 13 | .B rwall 14 | .B \-h 15 | host 16 | .B \-n 17 | netgroup 18 | .SH DESCRIPTION 19 | .IX "write to all users on network" "" "write to all users on network \(em \fLrwall\fP" 20 | .IX network rwall "" "\fLrwall\fP \(em write to all users" 21 | .IX "broadcast messages" "rwall" "" "\fLrwall\fP \(em to all users on network" 22 | .I Rwall 23 | reads a message from standard input until end-of-file. 24 | It then sends this message, 25 | preceded by the line ``Broadcast Message ...'', 26 | to all users logged in on the specified host machines. 27 | With the 28 | .B -n 29 | option, 30 | it sends to the specified network groups, 31 | which are defined in 32 | .IR netgroup (5). 33 | .PP 34 | A machine can only receive such a message if it is running 35 | .IR rwalld (8), 36 | which is normally started up from 37 | .I /etc/servers 38 | by the daemon 39 | .IR inetd (8). 40 | .SH FILES 41 | /etc/servers 42 | .SH "SEE ALSO" 43 | wall(1), netgroup(5), rwalld(8), shutdown(8) 44 | -------------------------------------------------------------------------------- /usr/src/include/fstab.h: -------------------------------------------------------------------------------- 1 | /* fstab.h 4.4 83/05/24 */ 2 | 3 | /* 4 | * File system table, see fstab (5) 5 | * 6 | * Used by dump, mount, umount, swapon, fsck, df, ... 7 | * 8 | * The fs_spec field is the block special name. Programs 9 | * that want to use the character special name must create 10 | * that name by prepending a 'r' after the right most slash. 11 | * Quota files are always named "quotas", so if type is "rq", 12 | * then use concatenation of fs_file and "quotas" to locate 13 | * quota file. 14 | */ 15 | #define FSTAB "/etc/fstab" 16 | 17 | #define FSTAB_RW "rw" /* read/write device */ 18 | #define FSTAB_RQ "rq" /* read/write with quotas */ 19 | #define FSTAB_RO "ro" /* read-only device */ 20 | #define FSTAB_SW "sw" /* swap device */ 21 | #define FSTAB_XX "xx" /* ignore totally */ 22 | 23 | struct fstab{ 24 | char *fs_spec; /* block special device name */ 25 | char *fs_file; /* file system path prefix */ 26 | char *fs_type; /* FSTAB_* */ 27 | int fs_freq; /* dump frequency, in days */ 28 | int fs_passno; /* pass number on parallel dump */ 29 | }; 30 | 31 | struct fstab *getfsent(); 32 | struct fstab *getfsspec(); 33 | struct fstab *getfsfile(); 34 | struct fstab *getfstype(); 35 | int setfsent(); 36 | int endfsent(); 37 | -------------------------------------------------------------------------------- /usr/src/sun/sys/h/types.h: -------------------------------------------------------------------------------- 1 | /* @(#)types.h 1.1 85/05/30 SMI; from UCB 4.11 83/07/01 */ 2 | 3 | /* 4 | * Basic system types and major/minor device constructing/busting macros. 5 | */ 6 | 7 | /* major part of a device */ 8 | #define major(x) ((int)(((unsigned)(x)>>8)&0377)) 9 | 10 | /* minor part of a device */ 11 | #define minor(x) ((int)((x)&0377)) 12 | 13 | /* make a device number */ 14 | #define makedev(x,y) ((dev_t)(((x)<<8) | (y))) 15 | 16 | typedef unsigned char u_char; 17 | typedef unsigned short u_short; 18 | typedef unsigned int u_int; 19 | typedef unsigned long u_long; 20 | typedef unsigned short ushort; /* sys III compat */ 21 | 22 | #ifdef vax 23 | typedef struct _physadr { int r[1]; } *physadr; 24 | typedef struct label_t { 25 | int val[14]; 26 | } label_t; 27 | #endif 28 | #ifdef mc68000 29 | typedef struct _physadr { short r[1]; } *physadr; 30 | typedef struct label_t { 31 | int val[13]; 32 | } label_t; 33 | #endif 34 | typedef struct _quad { long val[2]; } quad; 35 | typedef long daddr_t; 36 | typedef char * caddr_t; 37 | typedef u_long ino_t; 38 | typedef long swblk_t; 39 | typedef int size_t; 40 | typedef int time_t; 41 | typedef short dev_t; 42 | typedef int off_t; 43 | 44 | typedef struct fd_set { int fds_bits[1]; } fd_set; 45 | 46 | -------------------------------------------------------------------------------- /usr/src/sun/sys/net/netisr.h: -------------------------------------------------------------------------------- 1 | /* @(#)netisr.h 1.1 85/05/30 SMI; from UCB 4.4 83/07/06 */ 2 | 3 | /* 4 | * The networking code runs off software interrupts. 5 | * 6 | * You can switch into the network by doing splnet() and return by splx(). 7 | * The software interrupt level for the network is higher than the software 8 | * level for the clock (so you can enter the network in routines called 9 | * at timeout time). 10 | */ 11 | #ifdef vax 12 | #define setsoftnet() mtpr(SIRR, 12) 13 | #endif 14 | #ifdef sun 15 | #include "../sun/sir.h" 16 | #define setsoftnet() siron(SIR_NET) 17 | #endif 18 | 19 | /* 20 | * Each ``pup-level-1'' input queue has a bit in a ``netisr'' status 21 | * word which is used to de-multiplex a single software 22 | * interrupt used for scheduling the network code to calls 23 | * on the lowest level routine of each protocol. 24 | */ 25 | #define NETISR_RAW 0 /* same as AF_UNSPEC */ 26 | #define NETISR_IP 2 /* same as AF_INET */ 27 | #define NETISR_NS 6 /* same as AF_NS */ 28 | #define NETISR_ND 7 /* network disk protocol */ 29 | 30 | #define schednetisr(anisr) { netisr |= 1<<(anisr); setsoftnet(); } 31 | 32 | #ifndef LOCORE 33 | #ifdef KERNEL 34 | int netisr; /* scheduling bits for network */ 35 | #endif 36 | #endif 37 | -------------------------------------------------------------------------------- /usr/src/sun/sys/h/acct.h: -------------------------------------------------------------------------------- 1 | /* @(#)acct.h 1.1 85/05/30 SMI; from UCB 6.1 83/07/29 */ 2 | 3 | /* 4 | * Accounting structures; 5 | * these use a comp_t type which is a 3 bits base 8 6 | * exponent, 13 bit fraction ``floating point'' number. 7 | */ 8 | typedef u_short comp_t; 9 | 10 | struct acct 11 | { 12 | char ac_comm[10]; /* Accounting command name */ 13 | comp_t ac_utime; /* Accounting user time */ 14 | comp_t ac_stime; /* Accounting system time */ 15 | comp_t ac_etime; /* Accounting elapsed time */ 16 | time_t ac_btime; /* Beginning time */ 17 | short ac_uid; /* Accounting user ID */ 18 | short ac_gid; /* Accounting group ID */ 19 | short ac_mem; /* average memory usage */ 20 | comp_t ac_io; /* number of disk IO blocks */ 21 | dev_t ac_tty; /* control typewriter */ 22 | char ac_flag; /* Accounting flag */ 23 | }; 24 | 25 | #define AFORK 0001 /* has executed fork, but no exec */ 26 | #define ASU 0002 /* used super-user privileges */ 27 | #define ACOMPAT 0004 /* used compatibility mode */ 28 | #define ACORE 0010 /* dumped core */ 29 | #define AXSIG 0020 /* killed by a signal */ 30 | 31 | #ifdef KERNEL 32 | #ifdef SYSACCT 33 | struct acct acctbuf; 34 | struct vnode *acctp; 35 | #else 36 | #define acct() 37 | #endif 38 | #endif 39 | -------------------------------------------------------------------------------- /usr/src/include/arpa/tftp.h: -------------------------------------------------------------------------------- 1 | /* tftp.h 4.2 83/06/11 */ 2 | 3 | /* 4 | * Trivial File Transfer Protocol (IEN-133) 5 | */ 6 | #define SEGSIZE 512 /* data segment size */ 7 | 8 | /* 9 | * Packet types. 10 | */ 11 | #define RRQ 01 /* read request */ 12 | #define WRQ 02 /* write request */ 13 | #define DATA 03 /* data packet */ 14 | #define ACK 04 /* acknowledgement */ 15 | #define ERROR 05 /* error code */ 16 | 17 | struct tftphdr { 18 | short th_opcode; /* packet type */ 19 | union { 20 | short tu_block; /* block # */ 21 | short tu_code; /* error code */ 22 | char tu_stuff[1]; /* request packet stuff */ 23 | } th_u; 24 | char th_data[1]; /* data or error string */ 25 | }; 26 | 27 | #define th_block th_u.tu_block 28 | #define th_code th_u.tu_code 29 | #define th_stuff th_u.tu_stuff 30 | #define th_msg th_data 31 | 32 | /* 33 | * Error codes. 34 | */ 35 | #define EUNDEF 0 /* not defined */ 36 | #define ENOTFOUND 1 /* file not found */ 37 | #define EACCESS 2 /* access violation */ 38 | #define ENOSPACE 3 /* disk full or allocation exceeded */ 39 | #define EBADOP 4 /* illegal TFTP operation */ 40 | #define EBADID 5 /* unknown transfer ID */ 41 | #define EEXISTS 6 /* file already exists */ 42 | #define ENOUSER 7 /* no such user */ 43 | -------------------------------------------------------------------------------- /usr/src/sun/sys/h/des.h: -------------------------------------------------------------------------------- 1 | /* @(#)des.h 1.1 85/05/30 SMI */ 2 | 3 | /* 4 | * Copyright (c) 1984 by Sun Microsystems, Inc. 5 | */ 6 | 7 | /* 8 | * Generic DES driver interface 9 | * Keep this file hardware independent! 10 | */ 11 | struct deskey { 12 | u_char des_key[8]; /* key (with low bit parity) */ 13 | enum { ENCRYPT, DECRYPT} des_dir; /* direction */ 14 | enum { ECB, CBC } des_mode; /* mode */ 15 | }; 16 | 17 | /* 18 | * Initial vector for CBC mode 19 | */ 20 | struct desivec { 21 | u_char des_ivec[8]; /* initial vector */ 22 | }; 23 | 24 | /* 25 | * Data block descriptor 26 | */ 27 | struct desblock { 28 | char *des_data; /* data address */ 29 | int des_len; /* data length (mult of 8) */ 30 | }; 31 | 32 | typedef char deschunk_t[8]; 33 | 34 | /* 35 | * Setting modes also sets the initial vector to zero 36 | */ 37 | #define DESIOCSETKEY _IOW(d, 0, struct deskey) /* set des mode */ 38 | #define DESIOCGETKEY _IOR(d, 1, struct deskey) /* get des mode */ 39 | #define DESIOCSETIVEC _IOW(d, 2, struct desivec) /* set init vector */ 40 | #define DESIOCGETIVEC _IOR(d, 3, struct desivec) /* get init vector */ 41 | #define DESIOCBLOCK _IOW(d, 4, struct desblock) /* process block */ 42 | #define DESIOCCHUNK _IOWR(d, 5, deschunk_t) /* process 8 bytes */ 43 | -------------------------------------------------------------------------------- /usr/src/lib/libc/rpc/auth_unix.h: -------------------------------------------------------------------------------- 1 | /* @(#)auth_unix.h 1.1 85/05/30 SMI */ 2 | 3 | /* 4 | * auth_unix.h, Protocol for UNIX style authentication parameters for RPC 5 | * 6 | * Copyright (C) 1984, Sun Microsystems, Inc. 7 | */ 8 | 9 | /* 10 | * The system is very weak. The client uses no encryption for it 11 | * credentials and only sends null verifiers. The server sends backs 12 | * null verifiers or optionally a verifier that suggests a new short hand 13 | * for the credentials. 14 | */ 15 | 16 | /* The machine name is part of a credential; it may not exceed 255 bytes */ 17 | #define MAX_MACHINE_NAME 255 18 | 19 | /* gids compose part of a credential; there may not be more than 10 of them */ 20 | #define NGRPS 8 21 | 22 | /* 23 | * Unix style credentials. 24 | */ 25 | struct authunix_parms { 26 | u_long aup_time; 27 | char *aup_machname; 28 | int aup_uid; 29 | int aup_gid; 30 | u_int aup_len; 31 | int *aup_gids; 32 | }; 33 | 34 | extern bool_t xdr_authunix_parms(); 35 | 36 | /* 37 | * If a response verifier has flavor AUTH_SHORT, 38 | * then the body of the response verifier encapsulates the following structure; 39 | * again it is serialized in the obvious fashion. 40 | */ 41 | struct short_hand_verf { 42 | struct opaque_auth new_cred; 43 | }; 44 | -------------------------------------------------------------------------------- /usr/src/sun/sys/h/text.h: -------------------------------------------------------------------------------- 1 | /* @(#)text.h 1.1 85/05/30 SMI; from UCB 4.4 81/03/09 */ 2 | 3 | /* 4 | * Text structure. 5 | * One allocated per pure 6 | * procedure on swap device. 7 | * Manipulated by text.c 8 | */ 9 | #define NXDAD 12 /* param.h:MAXTSIZ / dmap.h:DMTEXT */ 10 | 11 | struct text 12 | { 13 | swblk_t x_daddr[NXDAD]; /* disk addresses of DMTEXT-page segments */ 14 | swblk_t x_ptdaddr; /* disk address of page table */ 15 | size_t x_size; /* size (clicks) */ 16 | struct proc *x_caddr; /* ptr to linked proc, if loaded */ 17 | struct vnode *x_vptr; /* vnode of prototype */ 18 | short x_rssize; 19 | short x_swrss; 20 | char x_count; /* reference count */ 21 | char x_ccount; /* number of loaded references */ 22 | char x_flag; /* traced, written flags */ 23 | char x_slptime; 24 | short x_poip; /* page out in progress count */ 25 | }; 26 | 27 | #ifdef KERNEL 28 | struct text *text, *textNTEXT; 29 | int ntext; 30 | #endif 31 | 32 | #define XTRC 01 /* Text may be written, exclusive use */ 33 | #define XWRIT 02 /* Text written into, must swap out */ 34 | #define XLOAD 04 /* Currently being read from file */ 35 | #define XLOCK 010 /* Being swapped in or out */ 36 | #define XWANT 020 /* Wanted for swapping */ 37 | #define XPAGV 040 /* Page in on demand from vnode */ 38 | -------------------------------------------------------------------------------- /usr/src/include/nlist.h: -------------------------------------------------------------------------------- 1 | /* nlist.h 4.1 83/05/03 */ 2 | 3 | /* 4 | * Format of a symbol table entry; this file is included by 5 | * and should be used if you aren't interested the a.out header 6 | * or relocation information. 7 | */ 8 | struct nlist { 9 | char *n_name; /* for use when in-core */ 10 | unsigned char n_type; /* type flag, i.e. N_TEXT etc; see below */ 11 | char n_other; /* unused */ 12 | short n_desc; /* see */ 13 | unsigned long n_value; /* value of this symbol (or sdb offset) */ 14 | }; 15 | #define n_hash n_desc /* used internally by ld */ 16 | 17 | /* 18 | * Simple values for n_type. 19 | */ 20 | #define N_UNDF 0x0 /* undefined */ 21 | #define N_ABS 0x2 /* absolute */ 22 | #define N_TEXT 0x4 /* text */ 23 | #define N_DATA 0x6 /* data */ 24 | #define N_BSS 0x8 /* bss */ 25 | #define N_COMM 0x12 /* common (internal to ld) */ 26 | #define N_FN 0x1f /* file name symbol */ 27 | 28 | #define N_EXT 01 /* external bit, or'ed in */ 29 | #define N_TYPE 0x1e /* mask for all the type bits */ 30 | 31 | /* 32 | * Sdb entries have some of the N_STAB bits set. 33 | * These are given in 34 | */ 35 | #define N_STAB 0xe0 /* if any of these bits set, a SDB entry */ 36 | 37 | /* 38 | * Format for namelist values. 39 | */ 40 | #define N_FORMAT "%08x" 41 | -------------------------------------------------------------------------------- /usr/man/man1/yppasswd.1: -------------------------------------------------------------------------------- 1 | .\" @(#)yppasswd.1 1.2 85/04/05 SMI; 2 | .TH YPPASSWD 1 "16 March 1985" 3 | .SH NAME 4 | yppasswd \- change login password in yellow pages 5 | .SH SYNOPSIS 6 | .B yppasswd 7 | \ [ name ] 8 | .SH DESCRIPTION 9 | This command changes (or installs) a password associated with the user 10 | .IR name 11 | (your own name by default) 12 | in the yellow pages. The yellow pages password may be different 13 | from the one on your own machine. 14 | .LP 15 | .I Yppasswd 16 | prompts for the old yellow pages password and then for the new one. 17 | The caller must supply both. 18 | The new password must be typed twice, to forestall mistakes. 19 | .LP 20 | New passwords must be at least four characters long if they use 21 | a sufficiently rich alphabet and at least six characters long 22 | if monocase. These rules are relaxed if you are insistent enough. 23 | .LP 24 | Only the owner of the name or the super-user may change a password; 25 | in either case you must prove you know the old password. 26 | .SH "SEE ALSO" 27 | passwd(1), ypfiles(5), yppasswdd(8C) 28 | .SH BUGS 29 | The update protocol passes all the information to the server in 30 | one rpc call, without ever looking at it. Thus if you 31 | type in your old password incorrectly, you will not be notified until 32 | after you have entered your new password. 33 | -------------------------------------------------------------------------------- /usr/src/include/rpcsvc/mount.h: -------------------------------------------------------------------------------- 1 | /* mount.h 1.1 85/05/30 */ 2 | 3 | /* 4 | * Copyright (c) 1984 Sun Microsystems, Inc. 5 | */ 6 | 7 | #define MOUNTPROG 100005 8 | #define MOUNTPROC_MNT 1 9 | #define MOUNTPROC_DUMP 2 10 | #define MOUNTPROC_UMNT 3 11 | #define MOUNTPROC_UMNTALL 4 12 | #define MOUNTPROC_EXPORT 5 13 | #define MOUNTPROC_EXPORTALL 6 14 | #define MOUNTVERS_ORIG 1 15 | #define MOUNTVERS 1 16 | 17 | #ifndef svc_getcaller 18 | #define svc_getcaller(x) (&(x)->xp_raddr) 19 | #endif 20 | 21 | bool_t xdr_path(); 22 | bool_t xdr_fhandle(); 23 | bool_t xdr_fhstatus(); 24 | bool_t xdr_mountlist(); 25 | bool_t xdr_exports(); 26 | 27 | struct mountlist { /* what is mounted */ 28 | char *ml_name; 29 | char *ml_path; 30 | struct mountlist *ml_nxt; 31 | }; 32 | 33 | struct fhstatus { 34 | int fhs_status; 35 | fhandle_t fhs_fh; 36 | }; 37 | 38 | /* 39 | * List of exported directories 40 | * An export entry with ex_groups 41 | * NULL indicates an entry which is exported to the world. 42 | */ 43 | struct exports { 44 | dev_t ex_dev; /* dev of directory */ 45 | char *ex_name; /* name of directory */ 46 | struct groups *ex_groups; /* groups allowed to mount this entry */ 47 | struct exports *ex_next; 48 | }; 49 | 50 | struct groups { 51 | char *g_name; 52 | struct groups *g_next; 53 | }; 54 | -------------------------------------------------------------------------------- /usr/src/lib/libc/rpcsvc/mount.h: -------------------------------------------------------------------------------- 1 | /* mount.h 1.1 85/05/30 */ 2 | 3 | /* 4 | * Copyright (c) 1984 Sun Microsystems, Inc. 5 | */ 6 | 7 | #define MOUNTPROG 100005 8 | #define MOUNTPROC_MNT 1 9 | #define MOUNTPROC_DUMP 2 10 | #define MOUNTPROC_UMNT 3 11 | #define MOUNTPROC_UMNTALL 4 12 | #define MOUNTPROC_EXPORT 5 13 | #define MOUNTPROC_EXPORTALL 6 14 | #define MOUNTVERS_ORIG 1 15 | #define MOUNTVERS 1 16 | 17 | #ifndef svc_getcaller 18 | #define svc_getcaller(x) (&(x)->xp_raddr) 19 | #endif 20 | 21 | bool_t xdr_path(); 22 | bool_t xdr_fhandle(); 23 | bool_t xdr_fhstatus(); 24 | bool_t xdr_mountlist(); 25 | bool_t xdr_exports(); 26 | 27 | struct mountlist { /* what is mounted */ 28 | char *ml_name; 29 | char *ml_path; 30 | struct mountlist *ml_nxt; 31 | }; 32 | 33 | struct fhstatus { 34 | int fhs_status; 35 | fhandle_t fhs_fh; 36 | }; 37 | 38 | /* 39 | * List of exported directories 40 | * An export entry with ex_groups 41 | * NULL indicates an entry which is exported to the world. 42 | */ 43 | struct exports { 44 | dev_t ex_dev; /* dev of directory */ 45 | char *ex_name; /* name of directory */ 46 | struct groups *ex_groups; /* groups allowed to mount this entry */ 47 | struct exports *ex_next; 48 | }; 49 | 50 | struct groups { 51 | char *g_name; 52 | struct groups *g_next; 53 | }; 54 | -------------------------------------------------------------------------------- /usr/man/man8/showmount.8: -------------------------------------------------------------------------------- 1 | .\" @(#)showmount.8 1.3 85/04/05 SMI; 2 | .TH SHOWMOUNT 8 "1 February 1985" 3 | .SH NAME 4 | showmount \- show all remote mounts 5 | .SH SYNOPSIS 6 | .B showmount 7 | [ 8 | .B \-a 9 | ] [ 10 | .B \-d 11 | ] [ 12 | .B \-e 13 | ] [ host ] 14 | .SH DESCRIPTION 15 | .IX "showmount command" "" "\fLshowmount\fP \(em display remote mounts" 16 | .I Showmount 17 | lists all the clients 18 | that have remotely mounted a filesystem from 19 | .IR host . 20 | This information is maintained by the 21 | .IR mountd (8c) 22 | server on 23 | .IR host , 24 | and is saved across crashes in the file 25 | .IR /etc/rmtab . 26 | The default value for 27 | .I host 28 | is the value returned by 29 | .IR hostname (1). 30 | .SH OPTIONS 31 | .TP 32 | .B \-d 33 | List directories that have been remotely mounted by clients. 34 | .TP 35 | .B \-a 36 | Print all remote mounts in the format 37 | .sp.5 38 | hostname:directory 39 | .sp.5 40 | where 41 | .I hostname 42 | is the name of the client, and 43 | .I directory 44 | is the root of the file system that has been mounted. 45 | .TP 46 | .B \-e 47 | Print the list of exported file systems. 48 | .SH "SEE ALSO" 49 | rmtab(5), mountd(8), exports(5) 50 | .SH BUGS 51 | If a client crashes, its entry will not be removed from the list 52 | until it reboots and executes 53 | .IR "umount \-a" . 54 | -------------------------------------------------------------------------------- /usr/src/include/dumprestor.h: -------------------------------------------------------------------------------- 1 | /* dumprestor.h 2.5 83/08/11 */ 2 | 3 | /* 4 | * TP_BSIZE is the size of file blocks on the dump tapes. 5 | * Note that TP_BSIZE must be a multiple of DEV_BSIZE. 6 | * 7 | * NTREC is the number of TP_BSIZE blocks that are written 8 | * in each tape record. 9 | * 10 | * TP_NINDIR is the number of indirect pointers in a TS_INODE 11 | * or TS_ADDR record. Note that it must be a power of two. 12 | */ 13 | #define TP_BSIZE 1024 14 | #define NTREC 10 15 | #define TP_NINDIR (TP_BSIZE/2) 16 | 17 | #define TS_TAPE 1 18 | #define TS_INODE 2 19 | #define TS_BITS 3 20 | #define TS_ADDR 4 21 | #define TS_END 5 22 | #define TS_CLRI 6 23 | #define OFS_MAGIC (int)60011 24 | #define NFS_MAGIC (int)60012 25 | #define CHECKSUM (int)84446 26 | 27 | union u_spcl { 28 | char dummy[TP_BSIZE]; 29 | struct s_spcl { 30 | int c_type; 31 | time_t c_date; 32 | time_t c_ddate; 33 | int c_volume; 34 | daddr_t c_tapea; 35 | ino_t c_inumber; 36 | int c_magic; 37 | int c_checksum; 38 | struct dinode c_dinode; 39 | int c_count; 40 | char c_addr[TP_NINDIR]; 41 | } s_spcl; 42 | } u_spcl; 43 | 44 | #define spcl u_spcl.s_spcl 45 | 46 | #define DUMPOUTFMT "%-16s %c %s" /* for printf */ 47 | /* name, incno, ctime(date) */ 48 | #define DUMPINFMT "%16s %c %[^\n]\n" /* inverse for scanf */ 49 | -------------------------------------------------------------------------------- /usr/src/lib/libc/rpcsvc/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Makefile nfs.1.0 85/06/27 SAI; from 1.1 85/05/30 3 | # 4 | 5 | SRC= getnetgrent.c innetgr.c mountxdr.c \ 6 | rstatxdr.c rusersxdr.c\ 7 | ypprot_err.c yp_bind.c yperr_string.c clnt_domatch.c\ 8 | yp_enum.c _ypclnt_enum.c yp_match.c ypxdr.c yppasswdxdr.c 9 | OBJS= getnetgrent.o innetgr.o mountxdr.o \ 10 | rstatxdr.o rusersxdr.o\ 11 | ypprot_err.o yp_bind.o yperr_string.o clnt_domatch.o\ 12 | yp_enum.o _ypclnt_enum.o yp_match.o ypxdr.o yppasswdxdr.o 13 | INC= mount.h rstat.h rusers.h yp_prot.h ypclnt.h netwall.h yppasswd.h 14 | 15 | CFLAGS= -O -Dvax 16 | 17 | .c.o: 18 | ${CC} -p -c ${CFLAGS} $*.c 19 | -ld -X -r $*.o 20 | mv a.out profiled/$*.o 21 | ${CC} ${CFLAGS} -c $*.c 22 | -ld -x -r $*.o 23 | mv a.out $*.o 24 | 25 | rpcsvclib rpcsvclib_p: ${OBJS} 26 | @echo "building profiled rpcsvclib" 27 | @cd profiled; ar cru ../rpcsvclib_p ${OBJS} 28 | @echo "building normal rpcsvclib" 29 | @ar cru rpcsvclib ${OBJS} 30 | 31 | tags: $(SRC) $(KSRC) $(INC) 32 | ctags -tw $(SRC) $(KSRC) $(INC) 33 | 34 | ref: tags 35 | sed 's, /.*,,' tags | \ 36 | awk ' { printf("%-26s%-16s%s\n", $$1, $$2, $$3) }' > ref 37 | 38 | lint: 39 | lint -bnuvx $(SRC) 40 | 41 | print: 42 | pr $(INC) $(SRC) $(KSRC) | lpr -Pvp 43 | 44 | clean: 45 | rm -f $(OBJS) rpcsvclib linted made profiled/*.o rpcsvclib_p 46 | -------------------------------------------------------------------------------- /usr/man/man2/unmount.2: -------------------------------------------------------------------------------- 1 | .\" @(#)unmount.2 1.2 85/04/04 SMI; from UCB 4.2 2 | .TH UNMOUNT 2 "1 February 1985" 3 | .SH NAME 4 | unmount \- remove a file system 5 | .SH SYNOPSIS 6 | .nf 7 | .ft B 8 | unmount(name) 9 | char *name; 10 | .fi 11 | .IX unmount "" \fLunmount\fP 12 | .IX "file system" unmount "" \fLunmount\fP 13 | .IX "remove file system" 14 | .IX "demount file system" 15 | .SH DESCRIPTION 16 | .I Unmount 17 | announces to the system that the directory 18 | .I name 19 | is no longer to refer to the root of a mounted file system. 20 | The directory 21 | .I name 22 | reverts to its ordinary interpretation. 23 | .SH "RETURN VALUE 24 | .I Unmount 25 | returns 0 if the action occurred; \-1 if 26 | if the directory is inaccessible or 27 | does not have a mounted file system, 28 | or if there are active files in the mounted 29 | file system. 30 | .SH ERRORS 31 | .I Unmount 32 | may fail with one of the following errors: 33 | .TP 15 34 | [EINVAL] 35 | The caller is not the super-user. 36 | .TP 15 37 | [EINVAL] 38 | .I Name 39 | is not the root of a mounted file system. 40 | .TP 15 41 | [EBUSY] 42 | A process is holding a reference to a file located 43 | on the file system. 44 | .SH "SEE ALSO" 45 | mount(2), mount(8), umount(8) 46 | .SH BUGS 47 | The error codes are in a state of disarray; too many errors 48 | appear to the caller as one value. 49 | -------------------------------------------------------------------------------- /usr/src/include/rpcsvc/rstat.h: -------------------------------------------------------------------------------- 1 | /* @(#)rstat.h 1.1 85/05/30 SMI */ 2 | 3 | /* 4 | * Copyright (c) 1984 by Sun Microsystems, Inc. 5 | */ 6 | 7 | #ifndef CPUSTATES 8 | #include 9 | #endif 10 | 11 | #ifndef DST_NONE 12 | #include 13 | #endif 14 | 15 | #define RSTATPROG 100001 16 | #define RSTATVERS_ORIG 1 17 | #define RSTATVERS_SWTCH 2 18 | #define RSTATVERS 2 19 | #define RSTATPROC_STATS 1 20 | #define RSTATPROC_HAVEDISK 2 21 | 22 | struct stats { /* version 1 */ 23 | int cp_time[CPUSTATES]; 24 | int dk_xfer[DK_NDRIVE]; 25 | unsigned v_pgpgin; /* these are cumulative sum */ 26 | unsigned v_pgpgout; 27 | unsigned v_pswpin; 28 | unsigned v_pswpout; 29 | unsigned v_intr; 30 | int if_ipackets; 31 | int if_ierrors; 32 | int if_opackets; 33 | int if_oerrors; 34 | int if_collisions; 35 | }; 36 | struct statsswtch { /* version 2 */ 37 | int cp_time[CPUSTATES]; 38 | int dk_xfer[DK_NDRIVE]; 39 | unsigned v_pgpgin; /* these are cumulative sum */ 40 | unsigned v_pgpgout; 41 | unsigned v_pswpin; 42 | unsigned v_pswpout; 43 | unsigned v_intr; 44 | int if_ipackets; 45 | int if_ierrors; 46 | int if_opackets; 47 | int if_oerrors; 48 | int if_collisions; 49 | unsigned v_swtch; 50 | long avenrun[3]; 51 | struct timeval boottime 52 | }; 53 | 54 | int xdr_stats(); 55 | int xdr_statsswtch(); 56 | int havedisk(); 57 | -------------------------------------------------------------------------------- /usr/src/lib/libc/rpcsvc/rstat.h: -------------------------------------------------------------------------------- 1 | /* @(#)rstat.h 1.1 85/05/30 SMI */ 2 | 3 | /* 4 | * Copyright (c) 1984 by Sun Microsystems, Inc. 5 | */ 6 | 7 | #ifndef CPUSTATES 8 | #include 9 | #endif 10 | 11 | #ifndef DST_NONE 12 | #include 13 | #endif 14 | 15 | #define RSTATPROG 100001 16 | #define RSTATVERS_ORIG 1 17 | #define RSTATVERS_SWTCH 2 18 | #define RSTATVERS 2 19 | #define RSTATPROC_STATS 1 20 | #define RSTATPROC_HAVEDISK 2 21 | 22 | struct stats { /* version 1 */ 23 | int cp_time[CPUSTATES]; 24 | int dk_xfer[DK_NDRIVE]; 25 | unsigned v_pgpgin; /* these are cumulative sum */ 26 | unsigned v_pgpgout; 27 | unsigned v_pswpin; 28 | unsigned v_pswpout; 29 | unsigned v_intr; 30 | int if_ipackets; 31 | int if_ierrors; 32 | int if_opackets; 33 | int if_oerrors; 34 | int if_collisions; 35 | }; 36 | struct statsswtch { /* version 2 */ 37 | int cp_time[CPUSTATES]; 38 | int dk_xfer[DK_NDRIVE]; 39 | unsigned v_pgpgin; /* these are cumulative sum */ 40 | unsigned v_pgpgout; 41 | unsigned v_pswpin; 42 | unsigned v_pswpout; 43 | unsigned v_intr; 44 | int if_ipackets; 45 | int if_ierrors; 46 | int if_opackets; 47 | int if_oerrors; 48 | int if_collisions; 49 | unsigned v_swtch; 50 | long avenrun[3]; 51 | struct timeval boottime 52 | }; 53 | 54 | int xdr_stats(); 55 | int xdr_statsswtch(); 56 | int havedisk(); 57 | -------------------------------------------------------------------------------- /usr/src/sun/sys/h/ttychars.h: -------------------------------------------------------------------------------- 1 | /* @(#)ttychars.h 1.1 85/05/30 SMI; from UCB 4.6 83/07/01 */ 2 | 3 | /* 4 | * User visible structures and constants 5 | * related to terminal handling. 6 | */ 7 | #ifndef _TTYCHARS_ 8 | #define _TTYCHARS_ 9 | struct ttychars { 10 | char tc_erase; /* erase last character */ 11 | char tc_kill; /* erase entire line */ 12 | char tc_intrc; /* interrupt */ 13 | char tc_quitc; /* quit */ 14 | char tc_startc; /* start output */ 15 | char tc_stopc; /* stop output */ 16 | char tc_eofc; /* end-of-file */ 17 | char tc_brkc; /* input delimiter (like nl) */ 18 | char tc_suspc; /* stop process signal */ 19 | char tc_dsuspc; /* delayed stop process signal */ 20 | char tc_rprntc; /* reprint line */ 21 | char tc_flushc; /* flush output (toggles) */ 22 | char tc_werasc; /* word erase */ 23 | char tc_lnextc; /* literal next character */ 24 | }; 25 | 26 | #define CTRL(c) ('c'&037) 27 | 28 | /* default special characters */ 29 | #define CERASE 0177 30 | #define CKILL CTRL(u) 31 | #define CINTR CTRL(c) 32 | #define CQUIT 034 /* FS, ^\ */ 33 | #define CSTART CTRL(q) 34 | #define CSTOP CTRL(s) 35 | #define CEOF CTRL(d) 36 | #define CEOT CEOF 37 | #define CBRK 0377 38 | #define CSUSP CTRL(z) 39 | #define CDSUSP CTRL(y) 40 | #define CRPRNT CTRL(r) 41 | #define CFLUSH CTRL(o) 42 | #define CWERASE CTRL(w) 43 | #define CLNEXT CTRL(v) 44 | #endif 45 | -------------------------------------------------------------------------------- /usr/man/man5/netgroup.5: -------------------------------------------------------------------------------- 1 | .\" @(#)netgroup.5 1.2 85/04/04 SMI; 2 | .TH NETGROUP 5 "1 February 1985" 3 | .SH NAME 4 | netgroup \- list of network groups 5 | .SH DESCRIPTION 6 | .IX "netgroup file" "" "\fLnetgroup\fP \(em network groups list" 7 | .I Netgroup 8 | defines network wide groups, 9 | which are used for permission checking when doing 10 | remote mounts, remote logins, and remote shells. 11 | Each line of the 12 | .I netgroup 13 | file defines a group and has the format 14 | .IP 15 | groupname member1 member2 .... 16 | .PP 17 | where member\fIi\fP\| is either another group name, or a triple: 18 | .IP 19 | (hostname, username, domainname) 20 | .PP 21 | Any of three fields can be empty, 22 | in which case it signifies a wild card. 23 | Thus 24 | .IP 25 | universal (,,) 26 | .PP 27 | defines a group to which everyone belongs. 28 | .PP 29 | Network groups are accessed through the yellow pages. 30 | The database actually used by the yellow pages are in these two files: 31 | .IP 32 | /etc/yp/\fIdomainname\fP/netgroup.dir 33 | /etc/yp/\fIdomainname\fP/netgroup.pag 34 | .PP 35 | These files can be created from 36 | .I /etc/netgroup 37 | using 38 | .IR makedbm (8). 39 | .SH FILES 40 | /etc/netgroup 41 | .br 42 | /etc/yp/\fIdomainname\fP/netgroup.dir 43 | .br 44 | /etc/yp/\fIdomainname\fP/netgroup.pag 45 | .SH "SEE ALSO" 46 | getnetgrent(3), exportfs(8), makedbm(8), ypserv(8) 47 | -------------------------------------------------------------------------------- /usr/src/etc/yp/stdhosts.c: -------------------------------------------------------------------------------- 1 | #ifndef lint 2 | static char sccsid[] = "@(#)stdhosts.c 1.1 85/05/30 Copyr 1985 Sun Micro"; 3 | #endif 4 | 5 | /* 6 | * Copyright (c) 1985 by Sun Microsystems, Inc. 7 | */ 8 | 9 | #include 10 | 11 | /* 12 | * Filter to convert addresses in /etc/hosts file to standard form 13 | */ 14 | 15 | main(argc, argv) 16 | char **argv; 17 | { 18 | char line[256]; 19 | char adr[256]; 20 | char *any(), *trailer; 21 | FILE *fp; 22 | 23 | if (argc > 1) { 24 | fp = fopen(argv[1], "r"); 25 | if (fp == NULL) { 26 | fprintf(stderr, "stdhosts: can't open %s\n", argv[1]); 27 | exit(1); 28 | } 29 | } 30 | else 31 | fp = stdin; 32 | while (fgets(line, sizeof(line), fp)) { 33 | if (line[0] == '#') 34 | continue; 35 | if ((trailer = any(line, " \t")) == NULL) 36 | continue; 37 | sscanf(line, "%s", adr); 38 | fputs(inet_ntoa(inet_addr(adr)), stdout); 39 | fputs(trailer, stdout); 40 | } 41 | } 42 | 43 | /* 44 | * scans cp, looking for a match with any character 45 | * in match. Returns pointer to place in cp that matched 46 | * (or NULL if no match) 47 | */ 48 | static char * 49 | any(cp, match) 50 | register char *cp; 51 | char *match; 52 | { 53 | register char *mp, c; 54 | 55 | while (c = *cp) { 56 | for (mp = match; *mp; mp++) 57 | if (*mp == c) 58 | return (cp); 59 | cp++; 60 | } 61 | return (NULL); 62 | } 63 | -------------------------------------------------------------------------------- /usr/src/lib/libc/rpc/pmap_clnt.h: -------------------------------------------------------------------------------- 1 | /* @(#)pmap_clnt.h 1.1 85/05/30 SMI */ 2 | 3 | /* 4 | * portmap_clnt.h 5 | * Supplies C routines to get to portmap services. 6 | * 7 | * Copyright (C) 1984, Sun Microsystems, Inc. 8 | */ 9 | 10 | /* 11 | * Usage: 12 | * success = pmap_set(program, version, protocol, port); 13 | * success = pmap_unset(program, version); 14 | * port = pmap_getport(address, program, version, protocol); 15 | * head = pmap_getmaps(address); 16 | * clnt_stat = pmap_rmtcall(address, program, version, procedure, 17 | * xdrargs, argsp, xdrres, resp, tout, port_ptr) 18 | * (works for udp only.) 19 | * clnt_stat = clnt_broadcast(program, version, procedure, 20 | * xdrargs, argsp, xdrres, resp, eachresult) 21 | * (like pmap_rmtcall, except the call is broadcasted to all 22 | * locally connected nets. For each valid response received, 23 | * the procedure eachresult is called. Its form is: 24 | * done = eachresult(resp, raddr) 25 | * bool_t done; 26 | * caddr_t resp; 27 | * struct sockaddr_in raddr; 28 | * where resp points to the results of the call and raddr is the 29 | * address if the responder to the broadcast. 30 | */ 31 | 32 | extern bool_t pmap_set(); 33 | extern bool_t pmap_unset(); 34 | extern u_short pmap_getport(); 35 | extern struct pmaplist *pmap_getmaps(); 36 | enum clnt_stat pmap_rmtcall(); 37 | enum clnt_stat clnt_broadcast(); 38 | -------------------------------------------------------------------------------- /usr/src/lib/libc/rpc/disclaimer: -------------------------------------------------------------------------------- 1 | /* 2 | * Sun RPC is a product of Sun Microsystems, Inc. and is provided for 3 | * unrestricted use provided that this legend is included on all tape 4 | * media and as a part of the software program in whole or part. Users 5 | * may copy or modify Sun RPC without charge, but are not authorized 6 | * to license or distribute it to anyone else except as part of a product or 7 | * program developed by the user. 8 | * 9 | * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE 10 | * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR 11 | * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. 12 | * 13 | * Sun RPC is provided with no support and without any obligation on the 14 | * part of Sun Microsystems, Inc. to assist in its use, correction, 15 | * modification or enhancement. 16 | * 17 | * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE 18 | * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC 19 | * OR ANY PART THEREOF. 20 | * 21 | * In no event will Sun Microsystems, Inc. be liable for any lost revenue 22 | * or profits or other special, indirect and consequential damages, even if 23 | * Sun has been advised of the possibility of such damages. 24 | * 25 | * Sun Microsystems, Inc. 26 | * 2550 Garcia Avenue 27 | * Mountain View, California 94043 28 | */ 29 | -------------------------------------------------------------------------------- /usr/src/include/pascal/unixio.i: -------------------------------------------------------------------------------- 1 | (* Copyright (c) 1979 Regents of the University of California *) 2 | 3 | const 4 | sccsid = '@(#)unixio.i 1.1 6/17/81'; 5 | 6 | type 7 | fileptr = record 8 | cnt :integer 9 | end; 10 | 11 | function TELL( 12 | var fptr :text) 13 | {returns} :fileptr; 14 | 15 | var 16 | filesize, headsize, tailsize :integer; 17 | result :fileptr; 18 | 19 | begin 20 | tailsize := 0; 21 | while not eof(fptr) do begin 22 | get(fptr); 23 | tailsize := tailsize + 1 24 | end; 25 | filesize := 0; 26 | reset(fptr); 27 | while not eof(fptr) do begin 28 | get(fptr); 29 | filesize := filesize + 1 30 | end; 31 | reset(fptr); 32 | for headsize := 1 to filesize - tailsize do 33 | get(fptr); 34 | result.cnt := headsize; 35 | TELL := result 36 | end; 37 | 38 | procedure SEEK( 39 | var fptr :text; 40 | var cnt :fileptr); 41 | 42 | var 43 | i :integer; 44 | 45 | begin 46 | reset(fptr); 47 | for i := 1 to cnt.cnt do 48 | get(fptr) 49 | end; 50 | 51 | procedure APPEND( 52 | var fptr :text); 53 | 54 | var 55 | tmp :text; 56 | 57 | begin 58 | rewrite(tmp); 59 | reset(fptr); 60 | while not eof(fptr) do begin 61 | if eoln(fptr) then 62 | writeln(tmp) 63 | else 64 | write(tmp, fptr^); 65 | get(fptr) 66 | end; 67 | reset(tmp); 68 | rewrite(fptr); 69 | while not eof(tmp) do begin 70 | if eoln(tmp) then 71 | writeln(fptr) 72 | else 73 | write(fptr, tmp^); 74 | get(tmp) 75 | end 76 | end; 77 | -------------------------------------------------------------------------------- /usr/src/etc/dump/dumprestor.h: -------------------------------------------------------------------------------- 1 | /* @(#)dumprestor.h 1.1 85/05/30 SMI; from UCB 2.4 82/10/14 */ 2 | /* Copyright (c) 1981 Regents of the University of California */ 3 | 4 | /* 5 | * TP_BSIZE is the size of file blocks on the dump tapes. 6 | * Note that TP_BSIZE must be a multiple of DEV_BSIZE. 7 | * 8 | * NTREC is the number of TP_BSIZE blocks that are written 9 | * in each tape record. 10 | * 11 | * TP_NINDIR is the number of indirect pointers in a TS_INODE 12 | * or TS_ADDR record. Note that it must be a power of two. 13 | */ 14 | #define TP_BSIZE 1024 15 | #define NTREC 10 16 | #define TP_NINDIR (TP_BSIZE/2) 17 | 18 | #define TS_TAPE 1 19 | #define TS_INODE 2 20 | #define TS_BITS 3 21 | #define TS_ADDR 4 22 | #define TS_END 5 23 | #define TS_CLRI 6 24 | #define OFS_MAGIC (int)60011 25 | #define NFS_MAGIC (int)60012 26 | #define CHECKSUM (int)84446 27 | 28 | union u_spcl { 29 | char dummy[TP_BSIZE]; 30 | struct s_spcl { 31 | int c_type; 32 | time_t c_date; 33 | time_t c_ddate; 34 | int c_volume; 35 | daddr_t c_tapea; 36 | ino_t c_inumber; 37 | int c_magic; 38 | int c_checksum; 39 | struct dinode c_dinode; 40 | int c_count; 41 | char c_addr[TP_NINDIR]; 42 | } s_spcl; 43 | } u_spcl; 44 | 45 | #define spcl u_spcl.s_spcl 46 | 47 | #define DUMPOUTFMT "%-16s %c %s" /* for printf */ 48 | /* name, incno, ctime(date) */ 49 | #define DUMPINFMT "%16s %c %[^\n]\n" /* inverse for scanf */ 50 | -------------------------------------------------------------------------------- /usr/man/man5/exports.5: -------------------------------------------------------------------------------- 1 | .\" @(#)exports.5 1.2 85/04/04 SMI; 2 | .TH EXPORTS 5 "1 February 1985" 3 | .SH NAME 4 | exports \- NFS file systems being exported 5 | .SH SYNOPSIS 6 | .B /etc/exports 7 | .SH DESCRIPTION 8 | .IX "NFS exported file systems" "" "NFS exported file systems \(em \fLexportfs\fP" 9 | The file 10 | .I /etc/exports 11 | describes the file systems which are being exported to 12 | .IR nfs (4) 13 | clients. It is created by the system administrator 14 | using a text editor and processed by the 15 | .I mount 16 | request daemon 17 | .IR mountd (8c) 18 | each time a mount request is received. 19 | .PP 20 | The file consists of a list of file systems and the 21 | .IR netgroups (5) 22 | or machine names allowed to remote mount each file system. 23 | The file system names are left justified and followed by 24 | a list of names separated by white space. 25 | The names will be looked up in 26 | .I /etc/netgroups 27 | and then in 28 | .IR /etc/hosts . 29 | A file system name with no name list following means export to everyone. 30 | A ``#'' anywhere in the file indicates a comment 31 | extending to the end of the line it appears on. 32 | .SH EXAMPLE 33 | .PP 34 | .ft L 35 | .nf 36 | /usr clients # export to my clients 37 | /usr/local # export to the world 38 | /usr2 phoenix sun sundae # export to only these machines 39 | .fi 40 | .SH FILES 41 | /etc/exports 42 | .SH SEE ALSO 43 | mountd(8c) 44 | -------------------------------------------------------------------------------- /usr/src/include/netdb.h: -------------------------------------------------------------------------------- 1 | /* netdb.h 1.1 85/08/26 */ 2 | /* 3 | * Structures returned by network 4 | * data base library. All addresses 5 | * are supplied in host order, and 6 | * returned in network order (suitable 7 | * for use in system calls). 8 | */ 9 | struct hostent { 10 | char *h_name; /* official name of host */ 11 | char **h_aliases; /* alias list */ 12 | int h_addrtype; /* host address type */ 13 | int h_length; /* length of address */ 14 | char *h_addr; /* address */ 15 | }; 16 | 17 | /* 18 | * Assumption here is that a network number 19 | * fits in 32 bits -- probably a poor one. 20 | */ 21 | struct netent { 22 | char *n_name; /* official name of net */ 23 | char **n_aliases; /* alias list */ 24 | int n_addrtype; /* net address type */ 25 | int n_net; /* network # */ 26 | }; 27 | 28 | struct servent { 29 | char *s_name; /* official service name */ 30 | char **s_aliases; /* alias list */ 31 | int s_port; /* port # */ 32 | char *s_proto; /* protocol to use */ 33 | }; 34 | 35 | struct protoent { 36 | char *p_name; /* official protocol name */ 37 | char **p_aliases; /* alias list */ 38 | int p_proto; /* protocol # */ 39 | }; 40 | 41 | struct hostent *gethostbyname(), *gethostbyaddr(), *gethostent(); 42 | struct netent *getnetbyname(), *getnetbyaddr(), *getnetent(); 43 | struct servent *getservbyname(), *getservbyport(), *getservent(); 44 | struct protoent *getprotobyname(), *getprotobynumber(), *getprotoent(); 45 | -------------------------------------------------------------------------------- /usr/src/lib/libc/gen/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # @(#)Makefile nfs.1.0 85/06/27 SAI; from 1.1 85/05/30 SMI; from UCB 4.23 83/07/01 3 | # 4 | 5 | CRYPT=-DCRYPT 6 | CFLAGS= -O ${CRYPT} 7 | 8 | OBJS= alarm.o atoi.o atol.o \ 9 | calloc.o closedir.o crypt.o ctime.o ctype_.o \ 10 | errlst.o execvp.o \ 11 | fstab.o \ 12 | gcvt.o getenv.o getgrent.o getlogin.o \ 13 | getpass.o getpwent.o getwd.o initgroups.o isatty.o \ 14 | malloc.o mktemp.o \ 15 | mntent.o \ 16 | nlist.o opendir.o \ 17 | perror.o popen.o psignal.o \ 18 | qsort.o random.o readdir.o regex.o \ 19 | scandir.o seekdir.o setgid.o setegid.o setrgid.o setuid.o \ 20 | seteuid.o setruid.o siglist.o signal.o sleep.o \ 21 | swab.o syslog.o system.o \ 22 | telldir.o time.o timezone.o ttyname.o ttyslot.o \ 23 | valloc.o 24 | 25 | .c.o: 26 | ${CC} -p ${CFLAGS} -c $*.c 27 | -ld -X -r $*.o 28 | mv a.out profiled/$*.o 29 | ${CC} ${CFLAGS} -c $*.c 30 | -ld -x -r $*.o 31 | mv a.out $*.o 32 | 33 | genlib genlib_p: ${OBJS} 34 | @echo "building profiled genlib" 35 | @cd profiled; ar cru ../genlib_p ${OBJS} 36 | @echo "buiding normal genlib" 37 | @ar cru genlib ${OBJS} 38 | 39 | clean: 40 | rm -f genlib genlib_p ${OBJS} profiled/*.o 41 | 42 | errlst.o: errlst.c 43 | cc -S errlst.c 44 | ed - <:errfix errlst.s 45 | as -o errlst.o errlst.s 46 | rm -f errlst.s 47 | cp errlst.o profiled/errlst.o 48 | 49 | siglist.o: siglist.c 50 | cc -c -R siglist.c 51 | cp siglist.o profiled/siglist.o 52 | 53 | -------------------------------------------------------------------------------- /usr/src/lib/libc/rpcsvc/ypprot_err.c: -------------------------------------------------------------------------------- 1 | #ifndef lint 2 | static char sccsid[] = "@(#)ypprot_err.c 1.1 85/05/30 Copyr 1985 Sun Micro"; 3 | #endif 4 | 5 | #include /* Pull this in first */ 6 | #undef NULL /* Remove dbm.h's definition of NULL */ 7 | extern void dbmclose(); /* Refer to dbm routine not in dbm.h */ 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | 20 | /* 21 | * Maps a yp protocol error code (as defined in 22 | * yp_prot.h) to a yp client interface error code (as defined in 23 | * ypclnt.h). 24 | */ 25 | int 26 | _map_ypprot_err(yp_protocol_error) 27 | int yp_protocol_error; 28 | { 29 | int reason; 30 | 31 | switch (yp_protocol_error) { 32 | 33 | case YP_NOMORE: { 34 | reason = YPERR_NOMORE; 35 | break; 36 | } 37 | 38 | case YP_NOMAP: { 39 | reason = YPERR_MAP; 40 | break; 41 | } 42 | 43 | case YP_NODOM: { 44 | reason = YPERR_DOMAIN; 45 | break; 46 | } 47 | 48 | case YP_NOKEY: { 49 | reason = YPERR_KEY; 50 | break; 51 | } 52 | 53 | case YP_BADARGS: { 54 | reason = YPERR_BADARGS; 55 | break; 56 | } 57 | 58 | default: { 59 | reason = YPERR_YPERR; 60 | break; 61 | } 62 | 63 | } 64 | 65 | return(reason); 66 | } 67 | -------------------------------------------------------------------------------- /usr/src/include/mntent.h: -------------------------------------------------------------------------------- 1 | /* @(#)mntent.h 1.1 85/05/30 SMI */ 2 | 3 | /* 4 | * File system table, see mntent (5) 5 | * 6 | * Used by dump, mount, umount, swapon, fsck, df, ... 7 | * 8 | * Quota files are always named "quotas", so if type is "rq", 9 | * then use concatenation of mnt_file and "quotas" to locate 10 | * quota file. 11 | */ 12 | 13 | #define MNTTAB "/etc/fstab" 14 | #define MOUNTED "/etc/mtab" 15 | 16 | #define MNTMAXSTR 128 17 | 18 | #define MNTTYPE_42 "4.2" /* 4.2 file system */ 19 | #define MNTTYPE_NFS "nfs" /* network file system */ 20 | #define MNTTYPE_PC "pc" /* IBM PC (MSDOS) file system */ 21 | #define MNTTYPE_SWAP "swap" /* swap file system */ 22 | #define MNTTYPE_IGNORE "ignore"/* No type specified, ignore this entry */ 23 | 24 | #define MNTOPT_RO "ro" /* read only */ 25 | #define MNTOPT_RW "rw" /* read/write */ 26 | #define MNTOPT_QUOTA "quota" /* quotas */ 27 | #define MNTOPT_NOQUOTA "noquota" /* no quotas */ 28 | #define MNTOPT_SOFT "soft" /* soft mount */ 29 | #define MNTOPT_HARD "hard" /* hard mount */ 30 | 31 | struct mntent{ 32 | char *mnt_fsname; /* name of mounted file system */ 33 | char *mnt_dir; /* file system path prefix */ 34 | char *mnt_type; /* MNTTYPE_* */ 35 | char *mnt_opts; /* MNTOPT* */ 36 | int mnt_freq; /* dump frequency, in days */ 37 | int mnt_passno; /* pass number on parallel fsck */ 38 | }; 39 | 40 | struct mntent *getmntent(); 41 | char *hasmntopt(); 42 | FILE *setmntent(); 43 | int endmntent(); 44 | -------------------------------------------------------------------------------- /usr/src/sun/sys/net/raw_cb.h: -------------------------------------------------------------------------------- 1 | /* @(#)raw_cb.h 1.1 85/05/30 SMI; from UCB 4.5 83/06/30 */ 2 | 3 | /* 4 | * Raw protocol interface control block. Used 5 | * to tie a socket to the generic raw interface. 6 | */ 7 | struct rawcb { 8 | struct rawcb *rcb_next; /* doubly linked list */ 9 | struct rawcb *rcb_prev; 10 | struct socket *rcb_socket; /* back pointer to socket */ 11 | struct sockaddr rcb_faddr; /* destination address */ 12 | struct sockaddr rcb_laddr; /* socket's address */ 13 | caddr_t rcb_pcb; /* protocol specific stuff */ 14 | struct route rcb_route; /* routing information */ 15 | short rcb_flags; 16 | }; 17 | 18 | /* 19 | * Since we can't interpret canonical addresses, 20 | * we mark an address present in the flags field. 21 | */ 22 | #define RAW_LADDR 01 23 | #define RAW_FADDR 02 24 | #define RAW_DONTROUTE 04 /* no routing, default */ 25 | 26 | #define sotorawcb(so) ((struct rawcb *)(so)->so_pcb) 27 | 28 | /* 29 | * Nominal space allocated to a raw socket. 30 | */ 31 | #define RAWSNDQ 2048 32 | #define RAWRCVQ 2048 33 | 34 | /* 35 | * Format of raw interface header prepended by 36 | * raw_input after call from protocol specific 37 | * input routine. 38 | */ 39 | struct raw_header { 40 | struct sockproto raw_proto; /* format of packet */ 41 | struct sockaddr raw_dst; /* dst address for rawintr */ 42 | struct sockaddr raw_src; /* src address for sbappendaddr */ 43 | }; 44 | 45 | #ifdef KERNEL 46 | struct rawcb rawcb; /* head of list */ 47 | #endif 48 | -------------------------------------------------------------------------------- /usr/src/sun/sys/h/time.h: -------------------------------------------------------------------------------- 1 | /* @(#)time.h 1.1 85/05/30 SMI; from UCB 4.4 83/07/09 */ 2 | 3 | /* 4 | * Structure returned by gettimeofday(2) system call, 5 | * and used in other calls. 6 | */ 7 | struct timeval { 8 | long tv_sec; /* seconds */ 9 | long tv_usec; /* and microseconds */ 10 | }; 11 | 12 | struct timezone { 13 | int tz_minuteswest; /* minutes west of Greenwich */ 14 | int tz_dsttime; /* type of dst correction */ 15 | }; 16 | #define DST_NONE 0 /* not on dst */ 17 | #define DST_USA 1 /* USA style dst */ 18 | #define DST_AUST 2 /* Australian style dst */ 19 | #define DST_WET 3 /* Western European dst */ 20 | #define DST_MET 4 /* Middle European dst */ 21 | #define DST_EET 5 /* Eastern European dst */ 22 | 23 | /* 24 | * Operations on timevals. 25 | * 26 | * NB: timercmp does not work for >= or <=. 27 | */ 28 | #define timerisset(tvp) ((tvp)->tv_sec || (tvp)->tv_usec) 29 | #define timercmp(tvp, uvp, cmp) \ 30 | ((tvp)->tv_sec cmp (uvp)->tv_sec || \ 31 | (tvp)->tv_sec == (uvp)->tv_sec && (tvp)->tv_usec cmp (uvp)->tv_usec) 32 | #define timerclear(tvp) (tvp)->tv_sec = (tvp)->tv_usec = 0 33 | 34 | /* 35 | * Names of the interval timers, and structure 36 | * defining a timer setting. 37 | */ 38 | #define ITIMER_REAL 0 39 | #define ITIMER_VIRTUAL 1 40 | #define ITIMER_PROF 2 41 | 42 | struct itimerval { 43 | struct timeval it_interval; /* timer interval */ 44 | struct timeval it_value; /* current value */ 45 | }; 46 | 47 | #ifndef KERNEL 48 | #include 49 | #endif 50 | -------------------------------------------------------------------------------- /usr/src/sun/sys/h/conf.h: -------------------------------------------------------------------------------- 1 | /* @(#)conf.h 1.1 85/05/30 SMI; from UCB 4.11 83/05/18 */ 2 | 3 | /* 4 | * Declaration of block device 5 | * switch. Each entry (row) is 6 | * the only link between the 7 | * main unix code and the driver. 8 | * The initialization of the 9 | * device switches is in the 10 | * file conf.c. 11 | */ 12 | struct bdevsw 13 | { 14 | int (*d_open)(); 15 | int (*d_close)(); 16 | int (*d_strategy)(); 17 | int (*d_dump)(); 18 | int (*d_psize)(); 19 | int d_flags; 20 | }; 21 | #ifdef KERNEL 22 | struct bdevsw bdevsw[]; 23 | #endif 24 | 25 | /* 26 | * Character device switch. 27 | */ 28 | struct cdevsw 29 | { 30 | int (*d_open)(); 31 | int (*d_close)(); 32 | int (*d_read)(); 33 | int (*d_write)(); 34 | int (*d_ioctl)(); 35 | int (*d_stop)(); 36 | int (*d_reset)(); 37 | struct tty *d_ttys; 38 | int (*d_select)(); 39 | int (*d_mmap)(); 40 | }; 41 | #ifdef KERNEL 42 | struct cdevsw cdevsw[]; 43 | #endif 44 | 45 | /* 46 | * tty line control switch. 47 | */ 48 | struct linesw 49 | { 50 | int (*l_open)(); 51 | int (*l_close)(); 52 | int (*l_read)(); 53 | int (*l_write)(); 54 | int (*l_ioctl)(); 55 | int (*l_rint)(); 56 | int (*l_rend)(); 57 | int (*l_meta)(); 58 | int (*l_start)(); 59 | int (*l_modem)(); 60 | }; 61 | #ifdef KERNEL 62 | struct linesw linesw[]; 63 | #endif 64 | 65 | /* 66 | * Swap device information 67 | */ 68 | struct swdevt 69 | { 70 | dev_t sw_dev; 71 | int sw_freed; 72 | int sw_nblks; 73 | }; 74 | #ifdef KERNEL 75 | struct swdevt swdevt[]; 76 | #endif 77 | -------------------------------------------------------------------------------- /usr/src/sun/sys/sys/vm_mon.c: -------------------------------------------------------------------------------- 1 | /* @(#)vm_mon.c 1.1 85/05/30 SMI; from UCB 4.9 82/10/31 */ 2 | 3 | #include "../h/param.h" 4 | #include "../h/systm.h" 5 | #include "../h/user.h" 6 | #include "../h/vmmeter.h" 7 | #include "../h/trace.h" 8 | 9 | #ifdef PGINPROF 10 | 11 | int pmonmin = PMONMIN; 12 | int pres = PRES; 13 | int rmonmin = RMONMIN; 14 | int rres = RRES; 15 | 16 | vmsizmon() 17 | { 18 | register int i; 19 | 20 | i = (u.u_dsize / DRES) < NDMON ? (u.u_dsize / DRES):NDMON; 21 | dmon[i] += u.u_ru.ru_utime.tv_sec - u.u_outime; 22 | 23 | i = (u.u_ssize / SRES) < NSMON ? (u.u_ssize / SRES):NSMON; 24 | smon[i] += u.u_ru.ru_utime.tv_sec - u.u_outime; 25 | u.u_outime = u.u_ru.ru_utime.tv_sec; 26 | } 27 | 28 | vmfltmon(hist, atime, amin, res, nmax) 29 | register unsigned int *hist; 30 | register int atime, amin, res, nmax; 31 | { 32 | register int i; 33 | 34 | i = (atime - amin) / res; 35 | if (i>=0 && i= TRCSIZ) { 54 | tracex += (TRCSIZ - x); 55 | x = 0; 56 | } 57 | argp = &args; 58 | tracep = &tracebuf[x]; 59 | tracex += nargs; 60 | *tracep++ = (time.tv_sec%1000)*1000 + (time.tv_usec/1000); 61 | nargs--; 62 | do 63 | *tracep++ = *argp++; 64 | while (--nargs > 0); 65 | } 66 | #endif 67 | -------------------------------------------------------------------------------- /usr/src/sun/sys/h/unpcb.h: -------------------------------------------------------------------------------- 1 | /* @(#)unpcb.h 1.1 85/05/30 SMI; from UCB 5.3 82/11/13 */ 2 | 3 | /* 4 | * Protocol control block for an active 5 | * instance of a UNIX internal protocol. 6 | * 7 | * A socket may be associated with an vnode in the 8 | * file system. If so, the unp_vnode pointer holds 9 | * a reference count to this vnode, which should be irele'd 10 | * when the socket goes away. 11 | * 12 | * A socket may be connected to another socket, in which 13 | * case the control block of the socket to which it is connected 14 | * is given by unp_conn. 15 | * 16 | * A socket may be referenced by a number of sockets (e.g. several 17 | * sockets may be connected to a datagram socket.) These sockets 18 | * are in a linked list starting with unp_refs, linked through 19 | * unp_nextref and null-terminated. Note that a socket may be referenced 20 | * by a number of other sockets and may also reference a socket (not 21 | * necessarily one which is referencing it). This generates 22 | * the need for unp_refs and unp_nextref to be separate fields. 23 | */ 24 | struct unpcb { 25 | struct socket *unp_socket; /* pointer back to socket */ 26 | struct vnode *unp_vnode; /* if associated with file */ 27 | struct unpcb *unp_conn; /* control block of connected socket */ 28 | struct unpcb *unp_refs; /* referencing socket linked list */ 29 | struct unpcb *unp_nextref; /* link in unp_refs list */ 30 | struct mbuf *unp_remaddr; /* address of connected socket */ 31 | }; 32 | 33 | #define sotounpcb(so) ((struct unpcb *)((so)->so_pcb)) 34 | -------------------------------------------------------------------------------- /usr/src/include/rpcsvc/ypclnt.h: -------------------------------------------------------------------------------- 1 | /* @(#)ypclnt.h 1.1 85/05/30 SMI */ 2 | 3 | /* 4 | * ypclnt.h 5 | * This defines the symbols used in the c language 6 | * interface to the yp client functions. A description of this interface 7 | * can be read in ypclnt(3N). 8 | */ 9 | 10 | /* 11 | * Failure reason codes. The success condition is indicated by a functional 12 | * value of "0". 13 | */ 14 | #define YPERR_BADARGS 1 /* Args to function are bad */ 15 | #define YPERR_RPC 2 /* RPC failure */ 16 | #define YPERR_DOMAIN 3 /* Can't bind to a server which serves 17 | * this domain. */ 18 | #define YPERR_MAP 4 /* No such map in server's domain */ 19 | #define YPERR_KEY 5 /* No such key in map */ 20 | #define YPERR_YPERR 6 /* Internal yp server or client 21 | * interface error */ 22 | #define YPERR_RESRC 7 /* Local resource allocation failure */ 23 | #define YPERR_NOMORE 8 /* No more records in map database */ 24 | #define YPERR_PMAP 9 /* Can't communicate with portmapper */ 25 | #define YPERR_YPBIND 10 /* Can't communicate with ypbind */ 26 | #define YPERR_YPSERV 11 /* Can't communicate with ypserv */ 27 | #define YPERR_NODOM 12 /* Local domain name not set */ 28 | 29 | 30 | /* 31 | * External yp client function references. 32 | */ 33 | extern int yp_bind(); 34 | extern void yp_unbind(); 35 | extern int yp_get_default_domain (); 36 | extern int yp_match (); 37 | extern int yp_first (); 38 | extern int ypclnt_first (); 39 | extern int yp_next(); 40 | extern int ypclnt_next(); 41 | extern char *yperr_string(); 42 | 43 | -------------------------------------------------------------------------------- /usr/src/lib/libc/rpcsvc/ypclnt.h: -------------------------------------------------------------------------------- 1 | /* @(#)ypclnt.h 1.1 85/05/30 SMI */ 2 | 3 | /* 4 | * ypclnt.h 5 | * This defines the symbols used in the c language 6 | * interface to the yp client functions. A description of this interface 7 | * can be read in ypclnt(3N). 8 | */ 9 | 10 | /* 11 | * Failure reason codes. The success condition is indicated by a functional 12 | * value of "0". 13 | */ 14 | #define YPERR_BADARGS 1 /* Args to function are bad */ 15 | #define YPERR_RPC 2 /* RPC failure */ 16 | #define YPERR_DOMAIN 3 /* Can't bind to a server which serves 17 | * this domain. */ 18 | #define YPERR_MAP 4 /* No such map in server's domain */ 19 | #define YPERR_KEY 5 /* No such key in map */ 20 | #define YPERR_YPERR 6 /* Internal yp server or client 21 | * interface error */ 22 | #define YPERR_RESRC 7 /* Local resource allocation failure */ 23 | #define YPERR_NOMORE 8 /* No more records in map database */ 24 | #define YPERR_PMAP 9 /* Can't communicate with portmapper */ 25 | #define YPERR_YPBIND 10 /* Can't communicate with ypbind */ 26 | #define YPERR_YPSERV 11 /* Can't communicate with ypserv */ 27 | #define YPERR_NODOM 12 /* Local domain name not set */ 28 | 29 | 30 | /* 31 | * External yp client function references. 32 | */ 33 | extern int yp_bind(); 34 | extern void yp_unbind(); 35 | extern int yp_get_default_domain (); 36 | extern int yp_match (); 37 | extern int yp_first (); 38 | extern int ypclnt_first (); 39 | extern int yp_next(); 40 | extern int ypclnt_next(); 41 | extern char *yperr_string(); 42 | 43 | -------------------------------------------------------------------------------- /usr/man/man8/ypmake.8: -------------------------------------------------------------------------------- 1 | .\" @(#)ypmake.8 1.2 85/04/05 SMI; 2 | .TH YPMAKE 8 "1 February 1985" 3 | .SH NAME 4 | ypmake \- rebuild yellow pages database 5 | .SH SYNOPSIS 6 | .B cd 7 | .B /etc/yp 8 | .B ; 9 | .B make 10 | .SH DESCRIPTION 11 | .IX "ypmake command" "" "\fLypmake\fP \(em rebuild yellow pages database" 12 | .IX "rebuild yellow pages database" "" "rebuild yellow pages database \(em \fLypmake\fP" 13 | .IX "yellow pages" "rebuild database" "" "rebuild database \(em \fLypmake\fP" 14 | There is a 15 | .I Makefile 16 | in 17 | .IR /etc/yp 18 | for building the yellow pages database. 19 | With no arguments, 20 | .I make 21 | creates 22 | .I dbm 23 | databases for everything that is out of date, 24 | and then executes 25 | .IR yppush (8) 26 | to notify slave databases that there has been a change. 27 | .PP 28 | Typing 29 | .I "make passwd" 30 | will create and 31 | .I yppush 32 | just the password database (assuming it is out of date). 33 | Likewise, 34 | .I "make hosts" 35 | and 36 | .I "make networks" 37 | will create and 38 | .I yppush 39 | the host and network files, 40 | .I /etc/hosts 41 | and 42 | .IR /etc/networks . 43 | .PP 44 | There are three special variables: 45 | DIR, which gives the directory of the source files; 46 | NOPUSH, which when non-null inhibits doing a 47 | .I yppush 48 | of the new database files; 49 | and DOM, used to construct a domain 50 | other than the master's default domain. 51 | The default for DIR is 52 | .IR /etc , 53 | and the default for NOPUSH is 54 | the null string. 55 | .SH "SEE ALSO" 56 | makedbm(8), ypserv(8) 57 | -------------------------------------------------------------------------------- /usr/src/sun/sys/h/dkbad.h: -------------------------------------------------------------------------------- 1 | /* @(#)dkbad.h 1.1 85/05/30 SMI; from UCB 4.3 81/05/10 */ 2 | 3 | /* 4 | * Definitions needed to perform bad sector 5 | * revectoring ala DEC STD 144. 6 | * 7 | * The bad sector information is located in the 8 | * first 5 even numbered sectors of the last 9 | * track of the disk pack. There are five 10 | * identical copies of the information, described 11 | * by the dkbad structure. 12 | * 13 | * Replacement sectors are allocated starting with 14 | * the first sector before the bad sector information 15 | * and working backwards towards the beginning of 16 | * the disk. A maximum of 126 bad sectors are supported. 17 | * The position of the bad sector in the bad sector table 18 | * determines which replacement sector it corresponds to. 19 | * 20 | * The bad sector information and replacement sectors 21 | * are conventionally only accessible through the 22 | * 'c' file system partition of the disk. If that 23 | * partition is used for a file system, the user is 24 | * responsible for making sure that it does not overlap 25 | * the bad sector information or any replacement sector.s 26 | */ 27 | 28 | struct dkbad { 29 | long bt_csn; /* cartridge serial number */ 30 | u_short bt_mbz; /* unused; should be 0 */ 31 | u_short bt_flag; /* -1 => alignment cartridge */ 32 | struct bt_bad { 33 | u_short bt_cyl; /* cylinder number of bad sector */ 34 | u_short bt_trksec; /* track and sector number */ 35 | } bt_bad[126]; 36 | }; 37 | 38 | #define ECC 0 39 | #define SSE 1 40 | #define BSE 2 41 | #define CONT 3 42 | -------------------------------------------------------------------------------- /samples/rc.local: -------------------------------------------------------------------------------- 1 | # 2 | # @(#)rc.local 1.9 85/02/21 SMI; from UCB 4.2 3 | # 4 | /bin/hostname sunvax 5 | /bin/domainname sun 6 | /etc/ifconfig il0 `hostname` -trailers up 7 | echo -n 'starting rpc services:' >/dev/console 8 | if [ -f /etc/portmap ]; then 9 | /etc/portmap; echo -n ' portmap' >/dev/console 10 | fi 11 | if [ -f /etc/ypserv -a -d /etc/yp/`domainname` ]; then 12 | /etc/ypserv; echo -n ' ypserv' >/dev/console 13 | fi 14 | if [ -f /etc/ypbind ]; then 15 | /etc/ypbind; echo -n ' ypbind' >/dev/console 16 | fi 17 | echo '.' >/dev/console 18 | if [ -f /etc/routed ]; then 19 | /etc/routed & echo ' starting router' >/dev/console 20 | fi 21 | /etc/mount -vat nfs >/dev/console 22 | #echo -n 'check quotas: ' >/dev/console 23 | # /usr/etc/quotacheck -a >/dev/console 24 | #echo 'done.' >/dev/console 25 | #/usr/etc/quotaon -a 26 | /etc/dmesg | grep UNIX | /usr/ucb/tail -1 >/tmp/t1 27 | grep -v UNIX /etc/motd >>/tmp/t1 28 | mv /tmp/t1 /etc/motd 29 | # 30 | /usr/etc/savecore /usr/crash >/dev/console 31 | echo -n 'local daemons:' >/dev/console 32 | if [ -f /usr/lib/sendmail -a -f /usr/lib/sendmail.cf ]; then 33 | (cd /usr/spool/mqueue; rm -f nf* lf*) 34 | /usr/lib/sendmail -bd -q1h & echo -n ' sendmail' >/dev/console 35 | fi 36 | # 37 | # if nfs daemon exists and /etc/exports file exists become nfs server 38 | # 39 | if [ -f /etc/nfsd -a -f /etc/exports ]; then 40 | /etc/nfsd 4 & echo -n ' nfsd' >/dev/console 41 | fi 42 | if [ -f /etc/biod ]; then 43 | /etc/biod 4; echo -n ' biod' >/dev/console 44 | fi 45 | echo '.' >/dev/console 46 | -------------------------------------------------------------------------------- /usr/src/sun/sys/h/vmsystm.h: -------------------------------------------------------------------------------- 1 | /* @(#)vmsystm.h 1.1 85/05/30 SMI; from UCB 4.3 81/04/23 */ 2 | 3 | /* 4 | * Miscellaneous virtual memory subsystem variables and structures. 5 | */ 6 | 7 | #ifdef KERNEL 8 | int freemem; /* remaining blocks of free memory */ 9 | int avefree; /* moving average of remaining free blocks */ 10 | int avefree30; /* 30 sec (avefree is 5 sec) moving average */ 11 | int deficit; /* estimate of needs of new swapped in procs */ 12 | int nscan; /* number of scans in last second */ 13 | int multprog; /* current multiprogramming degree */ 14 | int desscan; /* desired pages scanned per second */ 15 | 16 | /* writable copies of tunables */ 17 | int maxpgio; /* max paging i/o per sec before start swaps */ 18 | int maxslp; /* max sleep time before very swappable */ 19 | int lotsfree; /* max free before clock freezes */ 20 | int minfree; /* minimum free pages before swapping begins */ 21 | int desfree; /* no of pages to try to keep free via daemon */ 22 | int saferss; /* no pages not to steal; decays with slptime */ 23 | #endif 24 | 25 | /* 26 | * Fork/vfork accounting. 27 | */ 28 | struct forkstat 29 | { 30 | int cntfork; 31 | int cntvfork; 32 | int sizfork; 33 | int sizvfork; 34 | }; 35 | #ifdef KERNEL 36 | struct forkstat forkstat; 37 | #endif 38 | 39 | /* 40 | * Swap kind accounting. 41 | */ 42 | struct swptstat 43 | { 44 | int pteasy; /* easy pt swaps */ 45 | int ptexpand; /* pt expansion swaps */ 46 | int ptshrink; /* pt shrinking swaps */ 47 | int ptpack; /* pt swaps involving spte copying */ 48 | }; 49 | #ifdef KERNEL 50 | struct swptstat swptstat; 51 | #endif 52 | -------------------------------------------------------------------------------- /usr/man/man5/rmtab.5: -------------------------------------------------------------------------------- 1 | .\" @(#)rmtab.5 1.2 85/04/04 SMI; 2 | .TH RMTAB 5 "1 February 1985" 3 | .SH NAME 4 | rmtab \- remotely mounted file system table 5 | .SH DESCRIPTION 6 | .IX "rmtab file" "" "\fLrmtab\fP \(em remote mounted file system table" 7 | .I Rmtab 8 | resides in directory 9 | .I /etc 10 | and contains a record of all clients 11 | that have done remote mounts of file systems from this machine. 12 | Whenever a remote 13 | .I mount 14 | is done, an entry is made in the 15 | .I rmtab 16 | file of the machine serving up that file system. 17 | .I Umount 18 | removes entries, if of a remotely mounted file system. 19 | .I "Umount \-a" 20 | broadcasts to all servers, and informs them that they should remove 21 | all entries from 22 | .I rmtab 23 | created by the sender of the broadcast message. 24 | By placing a 25 | .I "umount \-a" 26 | command in 27 | .IR /etc/rc.boot , 28 | .I rmtab 29 | tables can be purged of entries made by a crashed host, 30 | which upon rebooting did not remount the same file systems it had before. 31 | The table is a series of lines of the form 32 | .IP 33 | hostname:directory 34 | .PP 35 | This table is used only to preserve information between crashes, 36 | and is read only by 37 | .IR mountd (8) 38 | when it starts up. 39 | .I Mountd 40 | keeps an in-core table, 41 | which it uses to handle requests from programs like 42 | .IR showmount (1) 43 | and 44 | .IR shutdown (8). 45 | .SH FILES 46 | /etc/rmtab 47 | .SH "SEE ALSO" 48 | showmount(1), mountd(8), mount(8), umount(8), shutdown(8) 49 | .SH BUGS 50 | Although the 51 | .I rmtab 52 | table is close to the truth, 53 | it is not always 100% accurate. 54 | -------------------------------------------------------------------------------- /usr/src/sun/doc/sunhead.ms: -------------------------------------------------------------------------------- 1 | .\" 2 | .\" Header File for Sun Manuals 3 | .\" Use with -ms macros 4 | .\" Adapted from TIS course header 5 | .\" Sally Rutter, The Instruction Set 6 | .\" 19th November 1985 7 | .\" 8 | .nr PS 11 9 | .nr VS 14 10 | .ds Un \s-1UNIX\s0 11 | .\" define string Un = UNIX in smaller point size 12 | .fp 7 C 13 | .\" Put constant width font in position 7 14 | .fp 6 CB 15 | .\" Put bold constant width font in position 6 16 | .\" The next 2 definitions are for constant width displays 17 | .\" LS for display start and LF for display finish 18 | .de LS 19 | .DS \\$1 \\$2 \\$3 20 | .nf 21 | .ft 7 22 | .ps 10 23 | .vs 12 24 | .nr Tw \w'a'*8 25 | .ta \\n(Twu,+\\n(Twu,+\\n(Twu,+\\n(Twu,+\\n(Twu,+\\n(Twu,+\\n(Twu 26 | .. 27 | .de LF 28 | .ft 29 | .fi 30 | .ps 11 31 | .vs 14 32 | .DE 33 | .. 34 | .\" The next definition is for text in constant width font. 35 | .de LW 36 | .ie\\n(.$ .nr ;G \\n(.f 37 | .el.ft 7 38 | .if\\n(.$ .if !\\n(.$-2 \&\f7\\$1\fP\\$2 39 | .if\\n(.$-2 \{.ds }i 40 | .if\\n(.f2 .ds }i \^ 41 | .ds}I \&\f7\\$1\fP\\$2\\*(}i 42 | 'br\} 43 | .if\\n(.$-2 .if !\\n(.$-4 \\*(}I\f7\\$3\fP\\$4 44 | .if\\n(.$-4 .if !\\n(.$-6 \\*(}I\f7\\$3\fP\\$4\\*(}i\f7\\$5\fP\\$6 45 | .if\\n(.$ .ft \\n(;G 46 | .. 47 | .\" The next definition ensures that there is at least 48 | .\" 0.5i left on the page when a sub-heading is called 49 | .rn SH Sh 50 | .de SH 51 | .br 52 | .ne 1.5i 53 | .Sh 54 | .. 55 | .\" The next definition is simply a need macro 56 | . \" NE - need space 57 | .de NE 58 | .br 59 | .ne 2i 60 | .. 61 | .de Pb 62 | 'bp 63 | .. 64 | .wh -1i Pb 65 | .\" Need the definition of index (IX) from somewhere ... 66 | 67 | -------------------------------------------------------------------------------- /usr/man/man8/ypwhich.8: -------------------------------------------------------------------------------- 1 | .\" @(#)ypwhich.8 1.3 85/04/05 SMI; 2 | .TH YPWHICH 8 "14 March 1985" 3 | .SH NAME 4 | ypwhich \- which machines are the YP server and master? 5 | .SH SYNOPSIS 6 | .B ypwhich 7 | [ 8 | .B \-d 9 | domainname ] [ hostname ] 10 | .PP 11 | .B ypwhich 12 | [ 13 | .B \-d 14 | domainname ] [ 15 | .B \-t 16 | ] 17 | .B \-m 18 | [ mname ] 19 | .SH DESCRIPTION 20 | .IX "ypwhich command" "" "\fLypwhich\fP \(em who is yellow pages server" 21 | .I Ypwhich 22 | tells which YP server supplies yellow pages to a YP client, 23 | and which YP server is the master for a map. 24 | If invoked without arguments, it gives the YP server 25 | for the local machine. If 26 | .I hostname 27 | is specified, that machine is queried 28 | to find out which YP master it is using. 29 | .PP 30 | If the 31 | .B \-m 32 | switch is used without \fImname\fP, a list of every map 33 | in the domain and the master of each will be printed. If 34 | .I mname 35 | is specified, only the master YP server for that map is printed. 36 | .I Mname 37 | may be a mapname, or a nickname for a mapname. 38 | Mapnames and nicknames are described in 39 | .IR ypcat (8). 40 | .SH OPTIONS 41 | .TP 42 | .B \-d 43 | .I Domainname 44 | specifies the name of a YP domain. 45 | The default is the default domain for the local machine. 46 | .TP 47 | .B \-m 48 | Find the master YP server for a map, 49 | or for all maps in a domain. No 50 | .I hostname 51 | may be specified with 52 | .BR \-m . 53 | .TP 54 | .B \-t 55 | Inhibit nickname translation; 56 | useful if there is a mapname identical to a nickname. 57 | This is not true of any Sun-supplied map. 58 | .SH "SEE ALSO" 59 | ypfiles(5), rpcinfo(8), yppush(8), ypserv(8) 60 | -------------------------------------------------------------------------------- /usr/src/include/arpa/ftp.h: -------------------------------------------------------------------------------- 1 | /* ftp.h 4.1 83/01/13 */ 2 | /* 3 | * Definitions for FTP 4 | * See RFC-765 5 | */ 6 | 7 | /* 8 | * Reply codes. 9 | */ 10 | #define PRELIM 1 /* positive preliminary */ 11 | #define COMPLETE 2 /* positive completion */ 12 | #define CONTINUE 3 /* positive intermediate */ 13 | #define TRANSIENT 4 /* transient negative completion */ 14 | #define ERROR 5 /* permanent negative completion */ 15 | 16 | /* 17 | * Type codes 18 | */ 19 | #define TYPE_A 1 /* ASCII */ 20 | #define TYPE_E 2 /* EBCDIC */ 21 | #define TYPE_I 3 /* image */ 22 | #define TYPE_L 4 /* local byte size */ 23 | 24 | /* 25 | * Form codes 26 | */ 27 | #define FORM_N 1 /* non-print */ 28 | #define FORM_T 2 /* telnet format effectors */ 29 | #define FORM_C 3 /* carriage control (ASA) */ 30 | 31 | /* 32 | * Structure codes 33 | */ 34 | #define STRU_F 1 /* file (no record structure) */ 35 | #define STRU_R 2 /* record structure */ 36 | #define STRU_P 3 /* page structure */ 37 | 38 | /* 39 | * Mode types 40 | */ 41 | #define MODE_S 1 /* stream */ 42 | #define MODE_B 2 /* block */ 43 | #define MODE_C 3 /* compressed */ 44 | 45 | /* 46 | * Record Tokens 47 | */ 48 | #define REC_ESC '\377' /* Record-mode Escape */ 49 | #define REC_EOR '\001' /* Record-mode End-of-Record */ 50 | #define REC_EOF '\002' /* Record-mode End-of-File */ 51 | 52 | /* 53 | * Block Header 54 | */ 55 | #define BLK_EOR 0x80 /* Block is End-of-Record */ 56 | #define BLK_EOF 0x40 /* Block is End-of-File */ 57 | #define BLK_ERRORS 0x20 /* Block is suspected of containing errors */ 58 | #define BLK_RESTART 0x10 /* Block is Restart Marker */ 59 | 60 | #define BLK_BYTECOUNT 2 /* Bytes in this block */ 61 | -------------------------------------------------------------------------------- /usr/src/lib/libc/rpcsvc/rusersxdr.c: -------------------------------------------------------------------------------- 1 | #ifndef lint 2 | static char sccsid[] = "@(#)rusersxdr.c 1.1 85/05/30 Copyr 1984 Sun Micro"; 3 | #endif 4 | 5 | /* 6 | * Copyright (c) 1984 by Sun Microsystems, Inc. 7 | */ 8 | 9 | #include 10 | #include "rusers.h" 11 | #include 12 | 13 | rusers(host, up) 14 | char *host; 15 | struct utmparr *up; 16 | { 17 | return callrpc(host, RUSERSPROG, RUSERSVERS, RUSERSPROC_NAMES, 18 | xdr_void, 0, xdr_utmparr, up); 19 | } 20 | 21 | rnusers(host, up) 22 | char *host; 23 | struct utmparr *up; 24 | { 25 | int nusers; 26 | 27 | if (callrpc(host, RUSERSPROG, RUSERSVERS, RUSERSPROC_NUM, 28 | xdr_void, 0, xdr_u_long, &nusers) < 0) 29 | return -1; 30 | else 31 | return (nusers); 32 | } 33 | 34 | xdr_utmp(xdrsp, up) 35 | XDR *xdrsp; 36 | struct utmp *up; 37 | { 38 | int len; 39 | char *p; 40 | 41 | len = sizeof(up->ut_line); 42 | p = up->ut_line; 43 | if (xdr_bytes(xdrsp, &p, &len, len) == FALSE) 44 | return 0; 45 | len = sizeof(up->ut_name); 46 | p = up->ut_name; 47 | if (xdr_bytes(xdrsp, &p, &len, len) == FALSE) 48 | return 0; 49 | len = sizeof(up->ut_host); 50 | p = up->ut_host; 51 | if (xdr_bytes(xdrsp, &p, &len, len) == FALSE) 52 | return 0; 53 | if (xdr_long(xdrsp, &up->ut_time) == FALSE) 54 | return 0; 55 | return 1; 56 | } 57 | 58 | xdr_utmpptr(xdrsp, up) 59 | XDR *xdrsp; 60 | struct utmp **up; 61 | { 62 | return (xdr_reference(xdrsp, up, sizeof (struct utmp), xdr_utmp)); 63 | } 64 | 65 | xdr_utmparr(xdrsp, up) 66 | XDR *xdrsp; 67 | struct utmparr *up; 68 | { 69 | return (xdr_array(xdrsp, &up->uta_arr, &(up->uta_cnt), 70 | MAXUSERS, sizeof(struct utmp *), xdr_utmpptr)); 71 | } 72 | -------------------------------------------------------------------------------- /usr/src/sun/sys/vaxif/if_il.h: -------------------------------------------------------------------------------- 1 | /* @(#)if_il.h 1.1 85/05/30 SMI; from UCB 6.1 83/07/29 */ 2 | 3 | /* 4 | * Structure of an Ethernet header -- receive format 5 | */ 6 | struct il_rheader { 7 | u_char ilr_status; /* Frame Status */ 8 | u_char ilr_fill1; 9 | u_short ilr_length; /* Frame Length */ 10 | u_char ilr_dhost[6]; /* Destination Host */ 11 | u_char ilr_shost[6]; /* Source Host */ 12 | u_short ilr_type; /* Type of packet */ 13 | }; 14 | 15 | /* 16 | * Structure of statistics record 17 | */ 18 | struct il_stats { 19 | u_short ils_fill1; 20 | u_short ils_length; /* Length (should be 62) */ 21 | struct ether_addr ils_addr; /* Ethernet Address */ 22 | u_short ils_frames; /* Number of Frames Received */ 23 | u_short ils_rfifo; /* Number of Frames in Receive FIFO */ 24 | u_short ils_xmit; /* Number of Frames Transmitted */ 25 | u_short ils_xcollis; /* Number of Excess Collisions */ 26 | u_short ils_frag; /* Number of Fragments Received */ 27 | u_short ils_lost; /* Number of Times Frames Lost */ 28 | u_short ils_multi; /* Number of Multicasts Accepted */ 29 | u_short ils_rmulti; /* Number of Multicasts Rejected */ 30 | u_short ils_crc; /* Number of CRC Errors */ 31 | u_short ils_align; /* Number of Alignment Errors */ 32 | u_short ils_collis; /* Number of Collisions */ 33 | u_short ils_owcollis; /* Number of Out-of-window Collisions */ 34 | u_short ils_fill2[8]; 35 | char ils_module[8]; /* Module ID */ 36 | char ils_firmware[8]; /* Firmware ID */ 37 | }; 38 | 39 | /* 40 | * Structure of Collision Delay Time Record 41 | */ 42 | struct il_collis { 43 | u_short ilc_fill1; 44 | u_short ilc_length; /* Length (should be 0-32) */ 45 | u_short ilc_delay[16]; /* Delay Times */ 46 | }; 47 | -------------------------------------------------------------------------------- /usr/src/sun/sys/sys/tty_tty.c: -------------------------------------------------------------------------------- 1 | /* @(#)tty_tty.c 1.1 85/05/30 SMI; from UCB 4.14 82/12/05 */ 2 | 3 | /* 4 | * Indirect driver for controlling tty. 5 | * 6 | * THIS IS GARBAGE: MUST SOON BE DONE WITH struct vnode * IN PROC TABLE. 7 | */ 8 | #include "../h/param.h" 9 | #include "../h/systm.h" 10 | #include "../h/conf.h" 11 | #include "../h/user.h" 12 | #include "../h/ioctl.h" 13 | #include "../h/tty.h" 14 | #include "../h/proc.h" 15 | #include "../h/uio.h" 16 | 17 | /*ARGSUSED*/ 18 | syopen(dev, flag) 19 | dev_t dev; 20 | int flag; 21 | { 22 | 23 | if (u.u_ttyp == NULL) 24 | return (ENXIO); 25 | return ((*cdevsw[major(u.u_ttyd)].d_open)(u.u_ttyd, flag)); 26 | } 27 | 28 | /*ARGSUSED*/ 29 | syread(dev, uio) 30 | dev_t dev; 31 | struct uio *uio; 32 | { 33 | 34 | if (u.u_ttyp == NULL) 35 | return (ENXIO); 36 | return ((*cdevsw[major(u.u_ttyd)].d_read)(u.u_ttyd, uio)); 37 | } 38 | 39 | /*ARGSUSED*/ 40 | sywrite(dev, uio) 41 | dev_t dev; 42 | struct uio *uio; 43 | { 44 | 45 | if (u.u_ttyp == NULL) 46 | return (ENXIO); 47 | return ((*cdevsw[major(u.u_ttyd)].d_write)(u.u_ttyd, uio)); 48 | } 49 | 50 | /*ARGSUSED*/ 51 | syioctl(dev, cmd, addr, flag) 52 | dev_t dev; 53 | int cmd; 54 | caddr_t addr; 55 | int flag; 56 | { 57 | 58 | if (cmd == TIOCNOTTY) { 59 | u.u_ttyp = 0; 60 | u.u_ttyd = 0; 61 | u.u_procp->p_pgrp = 0; 62 | return (0); 63 | } 64 | if (u.u_ttyp == NULL) 65 | return (ENXIO); 66 | return ((*cdevsw[major(u.u_ttyd)].d_ioctl)(u.u_ttyd, cmd, addr, flag)); 67 | } 68 | 69 | /*ARGSUSED*/ 70 | syselect(dev, flag) 71 | dev_t dev; 72 | int flag; 73 | { 74 | 75 | if (u.u_ttyp == NULL) { 76 | u.u_error = ENXIO; 77 | return (0); 78 | } 79 | return ((*cdevsw[major(u.u_ttyd)].d_select)(u.u_ttyd, flag)); 80 | } 81 | -------------------------------------------------------------------------------- /usr/man/man5/servers.5: -------------------------------------------------------------------------------- 1 | .\" @(#)servers.5 1.5 85/04/04 SMI; from UCB 4.2 2 | .TH SERVERS 5 "28 February 1985" 3 | .SH NAME 4 | servers \- inet server data base 5 | .SH DESCRIPTION 6 | .IX "servers file" "" "\fLservers\fP \(em inet server database" 7 | .IX "inet server database" "" "inet server database \(em \fLservers\fP" 8 | The 9 | .I servers 10 | file contains the list of servers that 11 | .IR inetd (8) 12 | operates. 13 | For each server a single line should be present 14 | with the following information: 15 | .HP 10 16 | name of server 17 | .br 18 | .ns 19 | .HP 10 20 | protocol 21 | .br 22 | .ns 23 | .HP 10 24 | server location 25 | .PP 26 | Items are separated by any number of blanks and/or 27 | tab characters. A ``#'' indicates the beginning of 28 | a comment; characters up to the end of the line are 29 | not interpreted by routines which search the file. 30 | .PP 31 | The name of the server should be the official service 32 | name as contained in 33 | .IR services (5). 34 | The protocol entry is either udp or tcp. 35 | The server location 36 | is the full path name of the server program. 37 | .SH EXAMPLE 38 | .LP 39 | The following example is taken from the Sun UNIX system. 40 | .sp 41 | .nf 42 | .ta \w'comsat\0\0'u +\w'udp\0\0'u 43 | tcp tcp /usr/etc/in.tcpd 44 | telnet tcp /usr/etc/in.telnetd 45 | shell tcp /etc/in.rshd 46 | login tcp /etc/in.rlogind 47 | exec tcp /usr/etc/in.rexecd 48 | ttcp udp /usr/etc/in.ttcpd 49 | syslog udp /usr/etc/in.syslog 50 | comsat udp /usr/etc/in.comsat 51 | talk udp /usr/etc/in.talkd 52 | time tcp /usr/etc/in.timed 53 | .fi 54 | .SH FILES 55 | /etc/servers 56 | .SH "SEE ALSO" 57 | services(5), inetd(8) 58 | .SH BUGS 59 | Because of a limitation on the number of open files, 60 | this file must contain fewer than 27 lines. 61 | -------------------------------------------------------------------------------- /usr/man/man2/statfs.2: -------------------------------------------------------------------------------- 1 | .\" @(#)statfs.2 1.4 85/04/04 SMI; from UCB 4.2 2 | .TH STATFS 2 "1 February 1985" 3 | .SH NAME 4 | statfs \- get file system statistics 5 | .SH SYNOPSIS 6 | .nf 7 | .ft B 8 | #include 9 | .sp.5 10 | statfs(path, buf) 11 | char *path; 12 | struct statfs *buf; 13 | .sp.5 14 | fstatfs(fd, buf) 15 | int fd; 16 | struct statfs *buf; 17 | .fi 18 | .IX statfs "" \fLstatfs\fP 19 | .IX "file system" statfs "" \fLstatfs\fP 20 | .IX "get file system statistiics" 21 | .IX statistics "get file system" 22 | .SH DESCRIPTION 23 | .I Statfs 24 | returns information about a mounted file system. 25 | .I Path 26 | is the pathname of any file within the mounted filesystem. 27 | .I Buf 28 | is a pointer to a 29 | .I statfs 30 | structure defined as follows: 31 | .IP 32 | .ta \w'#define'u +\w'fsid_t\0\0'u +\w'f_spare[7]\0\0'u 33 | .nf 34 | typedef struct { 35 | long val[2]; 36 | } fsid_t; 37 | .sp.5 38 | struct statfs { 39 | long f_type; /* type of info, zero for now */ 40 | long f_bsize; /* fundamental file system block size */ 41 | long f_blocks; /* total blocks in file system */ 42 | long f_bfree; /* free blocks */ 43 | long f_bavail; /* free blocks available to non-superuser */ 44 | long f_files; /* total file nodes in file system */ 45 | long f_ffree; /* free file nodes in fs */ 46 | fsid_t f_fsid; /* file system id */ 47 | long f_spare[7]; /* spare for later */ 48 | }; 49 | .fi 50 | .PP 51 | Fields that are undefined for a particular file system are set to \-1. 52 | .I Fstatfs 53 | returns the same information about an open file referenced by descriptor 54 | .IR fd . 55 | .SH "RETURN VALUE 56 | Upon successful completion, a value of 0 is returned. 57 | Otherwise, \-1 is returned and the global variable 58 | .I errno 59 | is set to indicate the error. 60 | .SH "SEE ALSO" 61 | -------------------------------------------------------------------------------- /usr/src/sun/sys/h/cmap.h: -------------------------------------------------------------------------------- 1 | /* @(#)cmap.h 1.1 85/05/30 SMI; from UCB 4.5 81/03/09 */ 2 | 3 | /* 4 | * core map entry 5 | */ 6 | struct cmap 7 | { 8 | unsigned int c_next:13, /* index of next free list entry */ 9 | c_prev:13, /* index of previous free list entry */ 10 | c_type:2, /* type CSYS or CTEXT or CSTACK or CDATA */ 11 | c_lock:1, /* locked for raw i/o or pagein */ 12 | c_want:1, /* wanted */ 13 | c_free:1, /* on the free list */ 14 | c_gone:1, /* associated page has been released */ 15 | c_page:16, /* virtual page number in segment */ 16 | c_hlink:13, /* hash link for */ 17 | c_intrans:1, /* intransit bit */ 18 | c_blkno:22, /* disk block this is a copy of */ 19 | c_ndx:10; /* index of owner proc or text */ 20 | struct vnode *c_vp; /* vnode to which c_blkno refers */ 21 | }; 22 | 23 | #define CMHEAD 0 24 | 25 | /* 26 | * Shared text pages are not totally abandoned when a process 27 | * exits, but are remembered while in the free list hashed by 28 | * off the cmhash structure so that they can be reattached 29 | * if another instance of the program runs again soon. 30 | */ 31 | #define CMHSIZ 128 /* SHOULD BE DYNAMIC */ 32 | #define CMHASH(bn) ((bn)&(CMHSIZ-1)) 33 | 34 | #ifdef KERNEL 35 | struct cmap *cmap; 36 | struct cmap *ecmap; 37 | int ncmap; 38 | struct cmap *mfind(); 39 | int firstfree, maxfree; 40 | int ecmx; /* cmap index of ecmap */ 41 | short cmhash[CMHSIZ]; 42 | #endif 43 | 44 | /* bits defined in c_type */ 45 | 46 | #define CSYS 0 /* none of below */ 47 | #define CTEXT 1 /* belongs to shared text segment */ 48 | #define CDATA 2 /* belongs to data segment */ 49 | #define CSTACK 3 /* belongs to stack segment */ 50 | 51 | #define pgtocm(x) ((((x)-firstfree) / CLSIZE) + 1) 52 | #define cmtopg(x) ((((x)-1) * CLSIZE) + firstfree) 53 | -------------------------------------------------------------------------------- /usr/src/include/stab.h: -------------------------------------------------------------------------------- 1 | /* @(#)stab.h 1.1 85/05/30 SMI; from UCB 4.1 83/05/03 */ 2 | 3 | /* IF YOU ADD DEFINITIONS, ADD THEM TO nm.c as well */ 4 | /* 5 | * This file gives definitions supplementing 6 | * for permanent symbol table entries. 7 | * These must have one of the N_STAB bits on, 8 | * and are subject to relocation according to the masks in . 9 | */ 10 | /* 11 | * for symbolic debugger, sdb(1): 12 | */ 13 | #define N_GSYM 0x20 /* global symbol: name,,0,type,0 */ 14 | #define N_FNAME 0x22 /* procedure name (f77 kludge): name,,0 */ 15 | #define N_FUN 0x24 /* procedure: name,,0,linenumber,address */ 16 | #define N_STSYM 0x26 /* static symbol: name,,0,type,address */ 17 | #define N_LCSYM 0x28 /* .lcomm symbol: name,,0,type,address */ 18 | #define N_RSYM 0x40 /* register sym: name,,0,type,register */ 19 | #define N_SLINE 0x44 /* src line: 0,,0,linenumber,address */ 20 | #define N_SSYM 0x60 /* structure elt: name,,0,type,struct_offset */ 21 | #define N_SO 0x64 /* source file name: name,,0,0,address */ 22 | #define N_LSYM 0x80 /* local sym: name,,0,type,offset */ 23 | #define N_SOL 0x84 /* #included file name: name,,0,0,address */ 24 | #define N_PSYM 0xa0 /* parameter: name,,0,type,offset */ 25 | #define N_ENTRY 0xa4 /* alternate entry: name,linenumber,address */ 26 | #define N_LBRAC 0xc0 /* left bracket: 0,,0,nesting level,address */ 27 | #define N_RBRAC 0xe0 /* right bracket: 0,,0,nesting level,address */ 28 | #define N_BCOMM 0xe2 /* begin common: name,, */ 29 | #define N_ECOMM 0xe4 /* end common: name,, */ 30 | #define N_ECOML 0xe8 /* end common (local name): ,,address */ 31 | #define N_LENG 0xfe /* second stab entry with length information */ 32 | 33 | /* 34 | * for the berkeley pascal compiler, pc(1): 35 | */ 36 | #define N_PC 0x30 /* global pascal symbol: name,,0,subtype,line */ 37 | -------------------------------------------------------------------------------- /usr/src/sun/doc/c0.cover: -------------------------------------------------------------------------------- 1 | .\" @(#)c0.cover 1.1 85/04/09 Sun Microsystems 2 | .\" next three lines are three-part titles 3 | .ds LH 4 | .ds CH 5 | .ds RH 6 | .ds LF 7 | .ds CF 8 | .ds RF 9 | .sp 2i 10 | .ce 99 11 | .ps 24 12 | .B 13 | Networking 14 | .sp 0.5i 15 | on the 16 | .sp 0.5i 17 | Sun Workstation 18 | .sp |8i 19 | .ps 14 20 | .vs 16 21 | .R 22 | Sun Microsystems, Inc. 23 | .br 24 | 2550 Garcia Avenue 25 | .br 26 | Mountain View 27 | .br 28 | California 94043 29 | .br 30 | (415) 960\|-1300 31 | .ce 0 32 | .ps 8 33 | .vs 10 34 | .sp |9.5i 35 | .in +4.5i 36 | Part Number: 800-1177-01 37 | .br 38 | Revision: A of 15 April 1985 39 | .br 40 | For: Sun System Release 2.0 41 | .in -4.5i 42 | .EH '''' 43 | .OH '''' 44 | .bp 45 | .af PN i 46 | .ds CF - \\n(PN - 47 | .sp 1i 48 | .ce 10 49 | .ps 24 50 | Revision History 51 | .ps 52 | .ce 0 53 | .sp 1i 54 | .TS 55 | box; 56 | cf3 w(.4i) cf3 w(1.25i) cf3 w(4.2i) 57 | lf3 w(.4i) | l w(1.25i) | l w(4.2i). 58 | .sp 4p 59 | Rev Date Comments 60 | .sp 4p 61 | = 62 | .sp 4p 63 | A-\(*a 19 November 1984 T{ 64 | First release of this manual; mostly new material. 65 | T} 66 | A-\(*b 1 February 1985 T{ 67 | Second release of this manual, with minor revisions. 68 | T} 69 | A 15 April 1985 T{ 70 | Third release of this manual, for customer shipment. 71 | T} 72 | .sp 13 73 | .sp 4p 74 | .TE 75 | .sp |8i 76 | .LP 77 | .ce 78 | Copyright \(co 1985 by Sun Microsystems. 79 | .LP 80 | This publication is protected by Federal Copyright Law, 81 | with all rights reserved. 82 | No part of this publication may be reproduced, 83 | stored in a retrieval system, 84 | translated, transcribed, or transmitted, 85 | in any form, or by any means 86 | manual, electric, electronic, electro-magnetic, 87 | mechanical, chemical, optical, or otherwise, 88 | without prior explicit written permission from Sun Microsystems. 89 | -------------------------------------------------------------------------------- /usr/src/sun/sys/h/map.h: -------------------------------------------------------------------------------- 1 | /* @(#)map.h 1.1 85/05/30 SMI; from UCB 4.7 81/11/08 */ 2 | 3 | /* 4 | * Resource Allocation Maps. 5 | * 6 | * Associated routines manage sub-allocation of an address space using 7 | * an array of segment descriptors. The first element of this array 8 | * is a map structure, describing the arrays extent and the name 9 | * of the controlled object. Each additional structure represents 10 | * a free segment of the address space. 11 | * 12 | * A call to rminit initializes a resource map and may also be used 13 | * to free some address space for the map. Subsequent calls to rmalloc 14 | * and rmfree allocate and free space in the resource map. If the resource 15 | * map becomes too fragmented to be described in the available space, 16 | * then some of the resource is discarded. This may lead to critical 17 | * shortages, but is better than not checking (as the previous versions 18 | * of these routines did) or giving up and calling panic(). The routines 19 | * could use linked lists and call a memory allocator when they run 20 | * out of space, but that would not solve the out of space problem when 21 | * called at interrupt time. 22 | * 23 | * N.B.: The address 0 in the resource address space is not available 24 | * as it is used internally by the resource map routines. 25 | */ 26 | struct map { 27 | struct mapent *m_limit; /* address of last slot in map */ 28 | char *m_name; /* name of resource */ 29 | /* we use m_name when the map overflows, in warning messages */ 30 | }; 31 | struct mapent 32 | { 33 | int m_size; /* size of this segment of the map */ 34 | int m_addr; /* resource-space addr of start of segment */ 35 | }; 36 | 37 | #ifdef KERNEL 38 | struct map *swapmap; 39 | int nswapmap; 40 | struct map *argmap; 41 | #define ARGMAPSIZE 16 42 | struct map *kernelmap; 43 | #endif 44 | -------------------------------------------------------------------------------- /usr/src/sun/sys/h/resource.h: -------------------------------------------------------------------------------- 1 | /* @(#)resource.h 1.1 85/05/30 SMI; from UCB 4.1 83/02/10 */ 2 | 3 | /* 4 | * Process priority specifications to get/setpriority. 5 | */ 6 | #define PRIO_MIN -20 7 | #define PRIO_MAX 20 8 | 9 | #define PRIO_PROCESS 0 10 | #define PRIO_PGRP 1 11 | #define PRIO_USER 2 12 | 13 | /* 14 | * Resource utilization information. 15 | */ 16 | 17 | #define RUSAGE_SELF 0 18 | #define RUSAGE_CHILDREN -1 19 | 20 | struct rusage { 21 | struct timeval ru_utime; /* user time used */ 22 | struct timeval ru_stime; /* system time used */ 23 | long ru_maxrss; 24 | #define ru_first ru_ixrss 25 | long ru_ixrss; /* integral shared memory size */ 26 | long ru_idrss; /* integral unshared data " */ 27 | long ru_isrss; /* integral unshared stack " */ 28 | long ru_minflt; /* page reclaims */ 29 | long ru_majflt; /* page faults */ 30 | long ru_nswap; /* swaps */ 31 | long ru_inblock; /* block input operations */ 32 | long ru_oublock; /* block output operations */ 33 | long ru_msgsnd; /* messages sent */ 34 | long ru_msgrcv; /* messages received */ 35 | long ru_nsignals; /* signals received */ 36 | long ru_nvcsw; /* voluntary context switches */ 37 | long ru_nivcsw; /* involuntary " */ 38 | #define ru_last ru_nivcsw 39 | }; 40 | 41 | /* 42 | * Resource limits 43 | */ 44 | #define RLIMIT_CPU 0 /* cpu time in milliseconds */ 45 | #define RLIMIT_FSIZE 1 /* maximum file size */ 46 | #define RLIMIT_DATA 2 /* data size */ 47 | #define RLIMIT_STACK 3 /* stack size */ 48 | #define RLIMIT_CORE 4 /* core file size */ 49 | #define RLIMIT_RSS 5 /* resident set size */ 50 | 51 | #define RLIM_NLIMITS 6 /* number of resource limits */ 52 | 53 | #define RLIM_INFINITY 0x7fffffff 54 | 55 | struct rlimit { 56 | int rlim_cur; /* current (soft) limit */ 57 | int rlim_max; /* maximum value for rlim_cur */ 58 | }; 59 | -------------------------------------------------------------------------------- /usr/src/sun/sys/netpup/raw_ether.c: -------------------------------------------------------------------------------- 1 | /* @(#)raw_ether.c 1.1 85/05/30 SMI; from UCB 1.1 85/05/30 */ 2 | 3 | #include "../h/param.h" 4 | #include "../h/mbuf.h" 5 | #include "../h/socket.h" 6 | #include "../h/protosw.h" 7 | #include "../h/socketvar.h" 8 | #include "../h/errno.h" 9 | 10 | #include "../net/if.h" 11 | #include "../net/route.h" 12 | #include "../net/raw_cb.h" 13 | 14 | #include "../netpup/ether.h" 15 | #include "../vaxif/if_en.h" 16 | 17 | /* 18 | * Raw interface to 3Mb/s Ethernet. 19 | */ 20 | 21 | struct sockaddr etherlink = { AF_ETHERLINK }; 22 | /* 23 | * Generate Ethernet header and pass packet to output 24 | * routine. The user must create a skeletal header 25 | * in order to message type. Source and destination 26 | * field are filled in from send parameters. 27 | */ 28 | raw_enoutput(m, so) 29 | register struct mbuf *m; 30 | struct socket *so; 31 | { 32 | register struct en_header *en; 33 | register struct sockaddr_en *sen; 34 | register struct rawcb *rp = sotorawcb(so); 35 | struct ifnet *ifp; 36 | int error = 0; 37 | 38 | /* 39 | * Verify user has supplied necessary space for the header. 40 | */ 41 | if ((m->m_off > MMAXOFF || m->m_len < sizeof (struct en_header)) && 42 | (m = m_pullup(m, sizeof (struct en_header))) == 0) { 43 | error = EMSGSIZE; /* XXX */ 44 | goto bad; 45 | } 46 | en = mtod(m, struct en_header *); 47 | sen = (struct sockaddr_en *)&rp->rcb_faddr; 48 | en->en_dhost = sen->sen_host; 49 | if (rp->rcb_route.ro_rt == 0) 50 | ifp = if_ifonnetof(sen->sen_net); 51 | else { 52 | rp->rcb_route.ro_rt->rt_use++; 53 | ifp = rp->rcb_route.ro_rt->rt_ifp; 54 | } 55 | if (ifp == 0) { 56 | error = ENETUNREACH; 57 | goto bad; 58 | } 59 | en->en_shost = ifp->if_host[0]; 60 | return ((*ifp->if_output)(ifp, m, ðerlink)); 61 | bad: 62 | m_freem(m); 63 | return (error); 64 | } 65 | -------------------------------------------------------------------------------- /usr/src/lib/libc/rpc/pmap_getmaps.c: -------------------------------------------------------------------------------- 1 | #ifndef lint 2 | static char sccsid[] = "@(#)pmap_getmaps.c 1.1 85/05/30 Copyr 1984 Sun Micro"; 3 | #endif 4 | 5 | /* 6 | * pmap_getmap.c 7 | * Client interface to pmap rpc service. 8 | * contains pmap_getmaps, which is only tcp service involved 9 | * 10 | * Copyright (C) 1984, Sun Microsystems, Inc. 11 | */ 12 | 13 | #include "types.h" 14 | #include 15 | #include "xdr.h" 16 | #include "auth.h" 17 | #include "clnt.h" 18 | #include "rpc_msg.h" 19 | #include "pmap_prot.h" 20 | #include "pmap_clnt.h" 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #define NAMELEN 255 29 | #define MAX_BROADCAST_SIZE 1400 30 | 31 | extern int errno; 32 | static struct timeval timeout = { 3, 0 }; 33 | static struct timeval tottimeout = { 24, 0 }; 34 | static struct sockaddr_in myaddress; 35 | 36 | /* 37 | * Get a copy of the current port maps. 38 | * Calls the pmap service remotely to do get the maps. 39 | */ 40 | struct pmaplist * 41 | pmap_getmaps(address) 42 | struct sockaddr_in *address; 43 | { 44 | struct pmaplist *head = (struct pmaplist *)NULL; 45 | int socket = -1; 46 | struct timeval minutetimeout; 47 | register CLIENT *client; 48 | 49 | minutetimeout.tv_sec = 60; 50 | minutetimeout.tv_usec = 0; 51 | address->sin_port = htons(PMAPPORT); 52 | client = clnttcp_create(address, PMAPPROG, 53 | PMAPVERS, &socket, 50, 500); 54 | if (client != (CLIENT *)NULL) { 55 | if (CLNT_CALL(client, PMAPPROC_DUMP, xdr_void, NULL, xdr_pmaplist, 56 | &head, minutetimeout) != RPC_SUCCESS) { 57 | clnt_perror(client, "pmap_getmaps rpc problem"); 58 | } 59 | CLNT_DESTROY(client); 60 | } 61 | (void)close(socket); 62 | address->sin_port = 0; 63 | return (head); 64 | } 65 | -------------------------------------------------------------------------------- /usr/src/lib/libc/Makefile: -------------------------------------------------------------------------------- 1 | # @(#)Makefile nfs.1.0 85/06/27 SAI; from UCB 4.6 83/07/02 2 | # 3 | # The system has two monitoring schemes, utilizing either ``prof'' 4 | # or ``gprof''. DFLMON determines the default profiler; mon.o 5 | # specifies that ``prof'' is the default, gmon.o specifies that 6 | # ``gprof'' is the default. 7 | # 8 | # Machine dependent routines are located in a subtree which parallels 9 | # the top directories. This subtree is identified by the machine name. 10 | # 11 | # Compatibility routines are kept in directories with a prefixing 12 | # ``compat'' (so they all sort together). 13 | # 14 | # The C run-time startup code is always machine dependent and expected 15 | # to be located in ${MACHINE}/csu 16 | # 17 | DESTDIR= 18 | INSTALL=install -m 644 19 | DFLMON= mon.o 20 | MACHINE=vax 21 | COMPAT= compat-4.1 compat-sys5 22 | ALL= gen inet net rpc rpcsvc stdio sys ${MACHINE} ${COMPAT} 23 | 24 | libc.a libc_p.a: ${MACHINE}/csu ${ALL} 25 | -mkdir tmp 26 | for i in ${ALL}; do (cd tmp; ar x ../$$i/$${i}lib); done 27 | ls tmp/*.o | sort -t/ +1 > t1 28 | ar cr libc.a `lorder \`cat t1\` | tsort` ${MACHINE}/csu/${DFLMON} 29 | ar ma flsbuf.o libc.a exit.o 30 | rm -f t1 tmp/* 31 | for i in ${ALL}; do (cd tmp; ar x ../$$i/$${i}lib_p); done 32 | ls tmp/*.o | sort -t/ +1 > t1 33 | ar cr libc_p.a `lorder \`cat t1\` | tsort` ${MACHINE}/csu/${DFLMON} 34 | ar ma flsbuf.o libc_p.a exit.o 35 | rm -rf t1 tmp 36 | 37 | ${MACHINE}/csu ${ALL}: FRC 38 | cd $@; make ${MFLAGS} 39 | 40 | FRC: 41 | 42 | clean: 43 | for i in ${MACHINE}/csu ${ALL}; do (cd $$i; make ${MFLAGS} clean); done 44 | rm -f t1 tmp/*.o 45 | -rmdir tmp 46 | 47 | install: 48 | ${INSTALL} libc.a ${DESTDIR}/lib/libc.a 49 | ranlib ${DESTDIR}/lib/libc.a 50 | ${INSTALL} libc_p.a ${DESTDIR}/usr/lib/libc_p.a 51 | ranlib ${DESTDIR}/usr/lib/libc_p.a 52 | cd ${MACHINE}/csu; make DESTDIR=${DESTDIR} install 53 | -------------------------------------------------------------------------------- /usr/man/man8/yppasswdd.8c: -------------------------------------------------------------------------------- 1 | .\" @(#)yppasswdd.8c 1.3 85/04/05 SMI 2 | .TH YPPASSWDD 8C "16 March 1985" 3 | .SH NAME 4 | yppasswdd \- server for modifying yellow pages password file 5 | .SH SYNOPSIS 6 | .B /usr/etc/rpc.yppasswdd 7 | file [ 8 | .B \-m 9 | arg1 arg2 ... ] 10 | .SH DESCRIPTION 11 | .IX "yypasswdd command" "" "\fLyppasswdd\fP \(em yellow pages password server" 12 | .IX servers yppasswdd "" "\fLyppasswdd\fP \(em yellow pages password server" 13 | .I Yppasswdd 14 | is a server that handles password change requests from 15 | .IR yppasswd (1). 16 | It changes a password entry in 17 | .IR file , 18 | which is assumed to be in the format of 19 | .IR passwd (5). 20 | An entry in 21 | .I file 22 | will only be changed if the password presented by 23 | .IR yppasswd (1) 24 | matches the encrypted password of that entry. 25 | .LP 26 | If the 27 | .B \-m 28 | option is given, then after 29 | .I file 30 | is modified, a 31 | .IR make (1) 32 | will be performed in 33 | .IR /etc/yp . 34 | Any arguments following the flag will be passed to 35 | .IR make . 36 | .LP 37 | This server is not run by default, nor can it be started up from 38 | .IR inetd (8). 39 | If it is desired to enable remote password updating for the yellow pages, 40 | then an entry for 41 | .I yppasswdd 42 | should be put in the 43 | .I /etc/rc 44 | file of the host serving as the master for the yellow pages 45 | .I passwd 46 | file. 47 | .SH EXAMPLE 48 | .LP 49 | If the yellow pages password file is stored as 50 | .IR /etc/yp/src/passwd , 51 | then to have password changes propagated immediately, 52 | the server should be invoked as 53 | .RS 54 | /usr/etc/rpc.yppasswdd /etc/yp/src/passwd \-m passwd DIR=/etc/yp/src 55 | .RE 56 | .SH FILES 57 | /etc/yp/Makefile 58 | .SH SEE ALSO 59 | yppasswd(1), passwd(5), ypfiles(5), ypmake(8) 60 | .SH CAVEAT 61 | This server will eventually be replaced with a more general 62 | service for modifying any map in the yellow pages 63 | -------------------------------------------------------------------------------- /usr/src/usr.etc/rpc.rwalld.c: -------------------------------------------------------------------------------- 1 | #ifndef lint 2 | static char sccsid[] = "@(#)rpc.rwalld.c 1.1 85/05/31 Copyr 1984 Sun Micro"; 3 | #endif 4 | 5 | /* 6 | * Copyright (c) 1984 by Sun Microsystems, Inc. 7 | */ 8 | 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | 15 | int splat(); 16 | 17 | main() 18 | { 19 | register SVCXPRT *transp; 20 | struct sockaddr_in addr; 21 | int len = sizeof(struct sockaddr_in); 22 | 23 | if (getsockname(0, &addr, &len) != 0) { 24 | perror("rstat: getsockname"); 25 | exit(1); 26 | } 27 | if ((transp = svcudp_create(0)) == NULL) { 28 | fprintf(stderr, "svc_rpc_udp_create: error\n"); 29 | exit(1); 30 | } 31 | if (!svc_register(transp, WALLPROG, WALLVERS, splat, 0)) { 32 | fprintf(stderr, "svc_rpc_register: error\n"); 33 | exit(1); 34 | } 35 | svc_run(); 36 | fprintf(stderr, "Error: svc_run shouldn't have returned\n"); 37 | } 38 | 39 | splat(rqstp, transp) 40 | register struct svc_req *rqstp; 41 | register SVCXPRT *transp; 42 | { 43 | FILE *fp, *popen(); 44 | char *msg; 45 | struct sockaddr_in addr; 46 | struct hostent *hp; 47 | char buf[256]; 48 | 49 | switch (rqstp->rq_proc) { 50 | case 0: 51 | if (svc_sendreply(transp, xdr_void, 0) == FALSE) { 52 | fprintf(stderr, "err: rusersd"); 53 | exit(1); 54 | } 55 | exit(0); 56 | case WALLPROC_WALL: 57 | if (!svc_getargs(transp, xdr_wrapstring, &msg)) { 58 | svcerr_decode(transp); 59 | exit(1); 60 | } 61 | if (svc_sendreply(transp, xdr_void, 0) == FALSE) { 62 | fprintf(stderr, "err: rusersd"); 63 | exit(1); 64 | } 65 | if (fork() == 0) {/* fork off child to do it */ 66 | fp = popen("wall", "w"); 67 | fprintf(fp, "%s", msg); 68 | pclose(fp); 69 | exit(0); 70 | } 71 | exit(0); 72 | default: 73 | svcerr_noproc(transp); 74 | exit(0); 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /usr/src/ucb/netstat/host.c: -------------------------------------------------------------------------------- 1 | #ifndef lint 2 | static char sccsid[] = "@(#)host.c 1.1 85/05/30 SMI"; /* from UCB 4.2 82/11/14 */ 3 | #endif 4 | 5 | #include 6 | #include 7 | 8 | #include 9 | #include 10 | #include 11 | 12 | #include 13 | 14 | extern int kmem; 15 | extern int nflag; 16 | extern char *inetname(); 17 | 18 | /* 19 | * Print the host tables associated with the ARPANET IMP. 20 | * Symbolic addresses are shown unless the nflag is given. 21 | */ 22 | hostpr(hostsaddr) 23 | off_t hostsaddr; 24 | { 25 | struct mbuf *hosts, mb; 26 | register struct mbuf *m; 27 | register struct hmbuf *mh; 28 | register struct host *hp; 29 | struct hostent *p; 30 | char flagbuf[10], *flags; 31 | int first = 1; 32 | 33 | if (hostsaddr == 0) { 34 | printf("hosts: symbol not in namelist\n"); 35 | return; 36 | } 37 | klseek(kmem, hostsaddr, 0); 38 | read(kmem, &hosts, sizeof (hosts)); 39 | m = hosts; 40 | printf("IMP Host Table\n"); 41 | printf("%-5.5s %-15.15s %-4.4s %-9.9s %-4.4s %s\n", 42 | "Flags", "Host", "Qcnt", "Q Address", "RFNM", "Timer"); 43 | while (m) { 44 | klseek(kmem, m, 0); 45 | read(kmem, &mb, sizeof (mb)); 46 | m = &mb; 47 | mh = mtod(m, struct hmbuf *); 48 | if (mh->hm_count == 0) { 49 | m = m->m_next; 50 | continue; 51 | } 52 | for (hp = mh->hm_hosts; hp < mh->hm_hosts + HPMBUF; hp++) { 53 | if ((hp->h_flags&HF_INUSE) == 0 && hp->h_timer == 0) 54 | continue; 55 | flags = flagbuf; 56 | *flags++ = hp->h_flags&HF_INUSE ? 'A' : 'F'; 57 | if (hp->h_flags&HF_DEAD) 58 | *flags++ = 'D'; 59 | if (hp->h_flags&HF_UNREACH) 60 | *flags++ = 'U'; 61 | *flags = '\0'; 62 | printf("%-5.5s %-15.15s %-4d %-9x %-4d %d\n", 63 | flagbuf, 64 | inetname(hp->h_addr), 65 | hp->h_qcnt, 66 | hp->h_q, 67 | hp->h_rfnm, 68 | hp->h_timer); 69 | } 70 | m = m->m_next; 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /usr/src/lib/libc/rpc/pmap_getport.c: -------------------------------------------------------------------------------- 1 | #ifndef lint 2 | static char sccsid[] = "@(#)pmap_getport.c 1.1 85/05/30 Copyr 1984 Sun Micro"; 3 | #endif 4 | 5 | /* 6 | * pmap_getport.c 7 | * Client interface to pmap rpc service. 8 | * 9 | * Copyright (C) 1984, Sun Microsystems, Inc. 10 | */ 11 | 12 | #include "types.h" 13 | #include 14 | #include "xdr.h" 15 | #include "auth.h" 16 | #include "clnt.h" 17 | #include "rpc_msg.h" 18 | #include "pmap_prot.h" 19 | #include "pmap_clnt.h" 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | #define NAMELEN 255 27 | 28 | static struct timeval timeout = { 5, 0 }; 29 | static struct timeval tottimeout = { 60, 0 }; 30 | 31 | /* 32 | * Find the mapped port for program,version. 33 | * Calls the pmap service remotely to do the lookup. 34 | * Returns 0 if no map exists. 35 | */ 36 | u_short 37 | pmap_getport(address, program, version, protocol) 38 | struct sockaddr_in *address; 39 | u_long program; 40 | u_long version; 41 | u_long protocol; 42 | { 43 | u_short port = 0; 44 | int socket = -1; 45 | register CLIENT *client; 46 | struct pmap parms; 47 | 48 | address->sin_port = htons(PMAPPORT); 49 | client = clntudp_create(address, PMAPPROG, 50 | PMAPVERS, timeout, &socket); 51 | if (client != (CLIENT *)NULL) { 52 | parms.pm_prog = program; 53 | parms.pm_vers = version; 54 | parms.pm_prot = protocol; 55 | parms.pm_port = 0; /* not needed or used */ 56 | if (CLNT_CALL(client, PMAPPROC_GETPORT, xdr_pmap, &parms, 57 | xdr_u_short, &port, tottimeout) != RPC_SUCCESS){ 58 | rpc_createerr.cf_stat = RPC_PMAPFAILURE; 59 | clnt_geterr(client, &rpc_createerr.cf_error); 60 | } else if (port == 0) { 61 | rpc_createerr.cf_stat = RPC_PROGNOTREGISTERED; 62 | } 63 | CLNT_DESTROY(client); 64 | } 65 | (void)close(socket); 66 | address->sin_port = 0; 67 | return (port); 68 | } 69 | -------------------------------------------------------------------------------- /usr/src/sun/sys/sys/kern_proc.c: -------------------------------------------------------------------------------- 1 | /* @(#)kern_proc.c 1.1 85/05/30 SMI; from UCB 4.64 83/05/27 */ 2 | 3 | #include "../machine/reg.h" 4 | #include "../machine/pte.h" 5 | #include "../machine/psl.h" 6 | 7 | #include "../h/param.h" 8 | #include "../h/systm.h" 9 | #include "../h/map.h" 10 | #include "../h/user.h" 11 | #include "../h/kernel.h" 12 | #include "../h/proc.h" 13 | #include "../h/buf.h" 14 | #include "../h/vnode.h" 15 | #include "../h/seg.h" 16 | #include "../h/acct.h" 17 | #include "../h/wait.h" 18 | #include "../h/vm.h" 19 | #include "../h/text.h" 20 | #include "../h/file.h" 21 | #include "../h/quota.h" 22 | #include "../h/uio.h" 23 | #include "../h/mbuf.h" 24 | 25 | spgrp(top, npgrp) 26 | register struct proc *top; 27 | { 28 | register struct proc *pp, *p; 29 | int f = 0; 30 | 31 | for (p = top; npgrp == -1 || u.u_uid == p->p_uid || 32 | !u.u_uid || inferior(p); p = pp) { 33 | if (npgrp == -1) { 34 | #define bit(a) (1<<(a-1)) 35 | p->p_sig &= ~(bit(SIGTSTP)|bit(SIGTTIN)|bit(SIGTTOU)); 36 | } else 37 | p->p_pgrp = npgrp; 38 | f++; 39 | /* 40 | * Search for children. 41 | */ 42 | for (pp = proc; pp < procNPROC; pp++) 43 | if (pp->p_pptr == p) 44 | goto cont; 45 | /* 46 | * Search for siblings. 47 | */ 48 | for (; p != top; p = p->p_pptr) 49 | for (pp = p + 1; pp < procNPROC; pp++) 50 | if (pp->p_pptr == p->p_pptr) 51 | goto cont; 52 | break; 53 | cont: 54 | ; 55 | } 56 | return (f); 57 | } 58 | 59 | /* 60 | * Is p an inferior of the current process? 61 | */ 62 | inferior(p) 63 | register struct proc *p; 64 | { 65 | 66 | for (; p != u.u_procp; p = p->p_pptr) 67 | if (p->p_ppid == 0) 68 | return (0); 69 | return (1); 70 | } 71 | 72 | struct proc * 73 | pfind(pid) 74 | int pid; 75 | { 76 | register struct proc *p; 77 | 78 | for (p = &proc[pidhash[PIDHASH(pid)]]; p != &proc[0]; p = &proc[p->p_idhash]) 79 | if (p->p_pid == pid) 80 | return (p); 81 | return ((struct proc *)0); 82 | } 83 | -------------------------------------------------------------------------------- /usr/src/lib/libc/rpc/clnt_simple.c: -------------------------------------------------------------------------------- 1 | #ifndef lint 2 | static char sccsid[] = "@(#)clnt_simple.c 1.1 85/05/30 Copyr 1984 Sun Micro"; 3 | #endif 4 | 5 | /* 6 | * clnt_simple.c 7 | * Simplified front end to rpc. 8 | * 9 | * Copyright (C) 1984, Sun Microsystems, Inc. 10 | */ 11 | 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | 18 | callrpc(host, prognum, versnum, procnum, inproc, in, outproc, out) 19 | char *host; 20 | xdrproc_t inproc, outproc; 21 | char *in, *out; 22 | { 23 | struct sockaddr_in server_addr; 24 | enum clnt_stat clnt_stat; 25 | struct hostent *hp; 26 | struct timeval timeout, tottimeout; 27 | 28 | static CLIENT *client; 29 | static int socket = RPC_ANYSOCK; 30 | static int oldprognum, oldversnum, valid; 31 | static char oldhost[256]; 32 | 33 | if (valid && oldprognum == prognum && oldversnum == versnum 34 | && strcmp(oldhost, host) == 0) { 35 | /* reuse old client */ 36 | } 37 | else { 38 | close(socket); 39 | socket = RPC_ANYSOCK; 40 | if (client) { 41 | clnt_destroy(client); 42 | client = NULL; 43 | } 44 | if ((hp = gethostbyname(host)) == NULL) 45 | return ((int) RPC_UNKNOWNHOST); 46 | timeout.tv_usec = 0; 47 | timeout.tv_sec = 10; 48 | bcopy(hp->h_addr, &server_addr.sin_addr, hp->h_length); 49 | server_addr.sin_family = AF_INET; 50 | server_addr.sin_port = 0; 51 | if ((client = clntudp_create(&server_addr, prognum, 52 | versnum, timeout, &socket)) == NULL) 53 | return ((int) rpc_createerr.cf_stat); 54 | valid = 1; 55 | oldprognum = prognum; 56 | oldversnum = versnum; 57 | strcpy(oldhost, host); 58 | } 59 | tottimeout.tv_sec = 25; 60 | tottimeout.tv_usec = 0; 61 | clnt_stat = clnt_call(client, procnum, inproc, in, 62 | outproc, out, tottimeout); 63 | /* 64 | * if call failed, empty cache 65 | */ 66 | if (clnt_stat != RPC_SUCCESS) 67 | valid = 0; 68 | return ((int) clnt_stat); 69 | } 70 | -------------------------------------------------------------------------------- /usr/man/man8/nfsstat.8: -------------------------------------------------------------------------------- 1 | .\" @(#)nfsstat.8 1.4 85/04/05 SMI; 2 | .TH NFSSTAT 8 "1 February 1985" 3 | .SH NAME 4 | nfsstat \- Network File System statistics 5 | .SH SYNOPSIS 6 | .B nfsstat 7 | [ 8 | .B \-csnrdz 9 | ] 10 | .SH DESCRIPTION 11 | .IX "nfsstat command" "" "\fLnfsstat\fP \(em display network statistics" 12 | .IX "NFS statistics" "display" "" "display \(em \fLnfsstat\fP" 13 | .IX "statistics of NFS" display "" "display \(em \fLnfsstat\fP" 14 | .I Nfsstat 15 | displays statistical information about the 16 | Network File System (NFS), 17 | Remote Procedure Call (RPC), 18 | and Network Disk (ND) 19 | interfaces to the kernel. 20 | It can also be used to reinitialize this information. 21 | If no options are given the default is 22 | .IP 23 | nfsstat \-csnr 24 | .PP 25 | That is, print everything except ND information, 26 | and reinitialize nothing. 27 | .SH OPTIONS 28 | .TP 29 | .B \-c 30 | Display client information. 31 | Only the client side NFS and RPC information will be printed. 32 | Can be combined with the 33 | .B \-n 34 | and 35 | .B \-r 36 | options to print client NFS or client RPC information only. 37 | .TP 38 | .B \-s 39 | Display server information. 40 | Works like the 41 | .B \-c 42 | option above. 43 | .TP 44 | .B \-n 45 | Display NFS information. 46 | NFS information for both the client and server side will be printed. 47 | Can be combined with the 48 | .B \-c 49 | and 50 | .B \-s 51 | options to print client or server NFS information only. 52 | .TP 53 | .B \-r 54 | Display RPC information. 55 | Works like the 56 | .B \-n 57 | option above. 58 | .TP 59 | .B \-d 60 | Display Network Disk (ND) information. 61 | .TP 62 | .B \-z 63 | Zero (reinitialize) statistics. 64 | Can be combined with any of the above options to 65 | zero particular sets of statistics after printing them. 66 | The user must have write permission on 67 | .I /dev/kmem 68 | for this option to work. 69 | .SH FILES 70 | .ta \w'/dev/kmem\0\0\0'u 71 | /vmunix system namelist 72 | .br 73 | /dev/kmem kernel memory 74 | -------------------------------------------------------------------------------- /usr/src/etc/fsck/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # @(#)Makefile 1.1 85/05/30 SMI from UCB 4.4 83/09/10 3 | # 4 | COPT= 5 | CFLAGS=-O 6 | 7 | fsck: fsck.o ufs_subr.o ufs_tables.o 8 | cc ${COPT} -o fsck fsck.o ufs_subr.o ufs_tables.o 9 | 10 | fscklc.o: fsck.c 11 | cc ${COPT} ${CFLAGS} -c fsck.c 12 | ld -r -o fscklc.o fsck.o -lc 13 | 14 | ufs_subr.o: /usr/src/sun/sys/ufs/ufs_subr.c 15 | cc ${COPT} ${CFLAGS} -c /usr/src/sun/sys/ufs/ufs_subr.c 16 | 17 | ufs_tables.o: /usr/src/sun/sys/ufs/ufs_tables.c 18 | cc ${COPT} ${CFLAGS} -c /usr/src/sun/sys/ufs/ufs_tables.c 19 | 20 | lint: 21 | lint fsck.c 22 | 23 | install: fsck 24 | install fsck ${DESTDIR}/etc/fsck 25 | 26 | clean: 27 | rm -f fsck fscklc.o fsck.o ufs_subr.o ufs_tables.o 28 | rm -f errs a.out core 29 | 30 | depend: 31 | echo >x.c 32 | for i in fsck; do \ 33 | (echo $$i: $$i.c >>makedep; \ 34 | /bin/grep '^#[ ]*include' x.c $$i.c | sed \ 35 | -e '/\.\.\/h/d' \ 36 | -e '/\.\.\/ufs/d' \ 37 | -e 's,<\(.*\)>,"/usr/include/\1",' \ 38 | -e 's/:[^"]*"\([^"]*\)".*/: \1/' \ 39 | -e 's/\.c//' >>makedep); done 40 | echo '/^# DO NOT DELETE THIS LINE/+2,$$d' >eddep 41 | echo '$$r makedep' >>eddep 42 | echo 'w' >>eddep 43 | cp Makefile Makefile.bak 44 | ed - Makefile < eddep 45 | rm eddep makedep x.c 46 | echo '# DEPENDENCIES MUST END AT END OF FILE' >> Makefile 47 | echo '# IF YOU PUT STUFF HERE IT WILL GO AWAY' >> Makefile 48 | echo '# see make depend above' >> Makefile 49 | 50 | # DO NOT DELETE THIS LINE -- make depend uses it 51 | 52 | fsck: fsck.c 53 | fsck: /usr/include/stdio.h 54 | fsck: /usr/include/ctype.h 55 | fsck: /usr/include/sys/param.h 56 | fsck: /usr/include/ufs/fs.h 57 | fsck: /usr/include/sys/time.h 58 | fsck: /usr/include/sys/vnode.h 59 | fsck: /usr/include/ufs/inode.h 60 | fsck: /usr/include/sys/stat.h 61 | fsck: /usr/include/sys/wait.h 62 | fsck: /usr/include/fstab.h 63 | fsck: /usr/include/sys/dir.h 64 | # DEPENDENCIES MUST END AT END OF FILE 65 | # IF YOU PUT STUFF HERE IT WILL GO AWAY 66 | # see make depend above 67 | -------------------------------------------------------------------------------- /usr/src/lib/libc/rpcsvc/yp_match.c: -------------------------------------------------------------------------------- 1 | #ifndef lint 2 | static char sccsid[] = "@(#)yp_match.c 1.1 85/05/30 Copyr 1985 Sun Micro"; 3 | #endif 4 | 5 | #include /* Pull this in first */ 6 | #undef NULL /* Remove dbm.h's definition of NULL */ 7 | extern void dbmclose(); /* Refer to dbm routine not in dbm.h */ 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | extern struct timeval _ypserv_timeout; 20 | extern int _ypclnt_domatch(); 21 | extern int _yp_dobind(); 22 | extern int _ypsleeptime; 23 | 24 | /* 25 | * Requests the yp server associated with a given domain to attempt to match 26 | * the passed key datum in the named map, and to return the associated value 27 | * datum. 28 | */ 29 | int 30 | yp_match (domain, map, key, keylen, val, vallen) 31 | char *domain; 32 | char *map; 33 | char *key; 34 | int keylen; 35 | char **val; /* returns value array */ 36 | int *vallen; /* returns bytes in val */ 37 | { 38 | int domlen; 39 | int maplen; 40 | int reason; 41 | struct dom_binding *pdomb; 42 | 43 | if ( (map == NULL) || (domain == NULL) ) { 44 | return(YPERR_BADARGS); 45 | } 46 | 47 | domlen = strlen(domain); 48 | maplen = strlen(map); 49 | 50 | if ( (domlen == 0) || (domlen > YPMAXDOMAIN) || 51 | (maplen == 0) || (maplen > YPMAXMAP) || 52 | (key == NULL) || (keylen == 0) ) { 53 | return(YPERR_BADARGS); 54 | } 55 | 56 | for (;;) { 57 | 58 | if (reason = _yp_dobind(domain, &pdomb) ) { 59 | return(reason); 60 | } 61 | 62 | reason = _ypclnt_domatch (domain, map, key, keylen, pdomb, 63 | _ypserv_timeout, val, vallen); 64 | 65 | if (reason == YPERR_RPC) { 66 | yp_unbind(domain); 67 | sleep(_ypsleeptime); 68 | } else { 69 | break; 70 | } 71 | } 72 | 73 | return(reason); 74 | 75 | } 76 | -------------------------------------------------------------------------------- /usr/src/sun/sys/netinet/tcp_fsm.h: -------------------------------------------------------------------------------- 1 | /* @(#)tcp_fsm.h 1.1 85/05/30 SMI; from UCB 4.12 81/12/21 */ 2 | 3 | /* 4 | * TCP FSM state definitions. 5 | * Per RFC793, September, 1981. 6 | */ 7 | 8 | #define TCP_NSTATES 11 9 | 10 | #define TCPS_CLOSED 0 /* closed */ 11 | #define TCPS_LISTEN 1 /* listening for connection */ 12 | #define TCPS_SYN_SENT 2 /* active, have sent syn */ 13 | #define TCPS_SYN_RECEIVED 3 /* have send and received syn */ 14 | /* states < TCPS_ESTABLISHED are those where connections not established */ 15 | #define TCPS_ESTABLISHED 4 /* established */ 16 | #define TCPS_CLOSE_WAIT 5 /* rcvd fin, waiting for close */ 17 | /* states > TCPS_CLOSE_WAIT are those where user has closed */ 18 | #define TCPS_FIN_WAIT_1 6 /* have closed, sent fin */ 19 | #define TCPS_CLOSING 7 /* closed xchd FIN; await FIN ACK */ 20 | #define TCPS_LAST_ACK 8 /* had fin and close; await FIN ACK */ 21 | /* states > TCPS_CLOSE_WAIT && < TCPS_FIN_WAIT_2 await ACK of FIN */ 22 | #define TCPS_FIN_WAIT_2 9 /* have closed, fin is acked */ 23 | #define TCPS_TIME_WAIT 10 /* in 2*msl quiet wait after close */ 24 | 25 | #define TCPS_HAVERCVDSYN(s) ((s) >= TCPS_SYN_RECEIVED) 26 | #define TCPS_HAVERCVDFIN(s) ((s) >= TCPS_TIME_WAIT) 27 | 28 | #ifdef TCPOUTFLAGS 29 | /* 30 | * Flags used when sending segments in tcp_output. 31 | * Basic flags (TH_RST,TH_ACK,TH_SYN,TH_FIN) are totally 32 | * determined by state, with the proviso that TH_FIN is sent only 33 | * if all data queued for output is included in the segment. 34 | */ 35 | u_char tcp_outflags[TCP_NSTATES] = { 36 | TH_RST|TH_ACK, 0, TH_SYN, TH_SYN|TH_ACK, 37 | TH_ACK, TH_ACK, 38 | TH_FIN|TH_ACK, TH_FIN|TH_ACK, TH_FIN|TH_ACK, TH_ACK, TH_ACK, 39 | }; 40 | #endif 41 | 42 | #ifdef KPROF 43 | int tcp_acounts[TCP_NSTATES][PRU_NREQ]; 44 | #endif 45 | 46 | #ifdef TCPSTATES 47 | char *tcpstates[] = { 48 | "CLOSED", "LISTEN", "SYN_SENT", "SYN_RCVD", 49 | "ESTABLISHED", "CLOSE_WAIT", "FIN_WAIT_1", "CLOSING", 50 | "LAST_ACK", "FIN_WAIT_2", "TIME_WAIT", 51 | }; 52 | #endif 53 | -------------------------------------------------------------------------------- /usr/src/lib/libc/rpc/xdr_reference.c: -------------------------------------------------------------------------------- 1 | #ifndef lint 2 | static char sccsid[] = "@(#)xdr_reference.c 1.1 85/05/30 Copyr 1984 Sun Micro"; 3 | #endif 4 | 5 | /* 6 | * xdr_reference.c, Generic XDR routines impelmentation. 7 | * 8 | * Copyright (C) 1984, Sun Microsystems, Inc. 9 | * 10 | * These are the "non-trivial" xdr primitives used to serialize and de-serialize 11 | * "pointers". See xdr.h for more info on the interface to xdr. 12 | */ 13 | 14 | #ifdef KERNEL 15 | #include "../h/param.h" 16 | #include "../rpc/types.h" 17 | #include "../rpc/xdr.h" 18 | #else 19 | #include "types.h" /* <> */ 20 | #include "xdr.h" /* <> */ 21 | #include 22 | #endif 23 | #define LASTUNSIGNED ((u_int)0-1) 24 | 25 | char *mem_alloc(); 26 | 27 | /* 28 | * XDR an indirect pointer 29 | * xdr_reference is for recursively translating a structure that is 30 | * referenced by a pointer inside the structure that is currently being 31 | * translated. pp references a pointer to storage. If *pp is null 32 | * the necessary storage is allocated. 33 | * size is the sizeof the referneced structure. 34 | * proc is the routine to handle the referenced structure. 35 | */ 36 | bool_t 37 | xdr_reference(xdrs, pp, size, proc) 38 | register XDR *xdrs; 39 | caddr_t *pp; /* the pointer to work on */ 40 | u_int size; /* size of the object pointed to */ 41 | xdrproc_t proc; /* xdr routine to handle the object */ 42 | { 43 | register caddr_t loc = *pp; 44 | register bool_t stat; 45 | 46 | if (loc == NULL) 47 | switch (xdrs->x_op) { 48 | case XDR_FREE: 49 | return (TRUE); 50 | 51 | case XDR_DECODE: 52 | *pp = loc = mem_alloc(size); 53 | #ifndef KERNEL 54 | if (loc == NULL) { 55 | fprintf(stderr, 56 | "xdr_reference: out of memory\n"); 57 | return (FALSE); 58 | } 59 | #endif 60 | bzero(loc, (int)size); 61 | break; 62 | } 63 | 64 | stat = (*proc)(xdrs, loc, LASTUNSIGNED); 65 | 66 | if (xdrs->x_op == XDR_FREE) { 67 | mem_free(loc, size); 68 | *pp = NULL; 69 | } 70 | return (stat); 71 | } 72 | -------------------------------------------------------------------------------- /usr/src/sun/sys/nfs/rnode.h: -------------------------------------------------------------------------------- 1 | /* @(#)rnode.h 1.1 85/05/30 SMI */ 2 | 3 | /* 4 | * Remote file information structure. 5 | * The rnode is the "inode" for remote files. It contains 6 | * all the information necessary to handle remote file on the 7 | * client side. 8 | */ 9 | struct rnode { 10 | struct rnode *r_next; /* active rnode list */ 11 | struct vnode r_vnode; /* vnode for remote file */ 12 | fhandle_t r_fh; /* file handle */ 13 | u_short r_flags; /* flags, see below */ 14 | daddr_t r_lastr; /* last block read (read-ahead) */ 15 | u_long r_size; /* file size in bytes */ 16 | struct ucred *r_cred; /* current credentials */ 17 | struct ucred *r_unlcred; /* unlinked credentials */ 18 | char *r_unlname; /* unlinked file name */ 19 | struct vnode *r_unldvp; /* parent dir of unlinked file */ 20 | struct nfsfattr r_nfsattr; /* cached nfs attributes */ 21 | struct timeval r_nfsattrtime; /* time attributed cached */ 22 | }; 23 | 24 | /* 25 | * Flags 26 | */ 27 | #define RLOCKED 0x01 /* rnode is in use */ 28 | #define RWANT 0x02 /* someone wants a wakeup */ 29 | #define RATTRVALID 0x04 /* Attributes in the rnode are valid */ 30 | #define REOF 0x08 /* EOF encountered on read */ 31 | #define RDIRTY 0x10 /* dirty buffers may be in buf cache */ 32 | #define ROPEN 0x20 /* the vnode is currently open */ 33 | 34 | /* 35 | * Convert between vnode and rnode 36 | */ 37 | #define rtov(rp) (&(rp)->r_vnode) 38 | #define vtor(vp) ((struct rnode *)((vp)->v_data)) 39 | #define vtofh(vp) (&(vtor(vp)->r_fh)) 40 | #define rtofh(rp) (&(rp)->r_fh) 41 | 42 | /* 43 | * Lock and unlock rnodes 44 | */ 45 | #define rlock(rp) { \ 46 | while ((rp)->r_flags & RLOCKED) { \ 47 | (rp)->r_flags |= RWANT; \ 48 | sleep((caddr_t)(rp), PINOD); \ 49 | } \ 50 | (rp)->r_flags |= RLOCKED; \ 51 | } 52 | 53 | #define runlock(rp) { \ 54 | (rp)->r_flags &= ~RLOCKED; \ 55 | if ((rp)->r_flags&RWANT) { \ 56 | (rp)->r_flags &= ~RWANT; \ 57 | wakeup((caddr_t)(rp)); \ 58 | } \ 59 | } 60 | -------------------------------------------------------------------------------- /usr/src/sun/sys/sys/vfs_dev.c: -------------------------------------------------------------------------------- 1 | /* @(#)vfs_dev.c 1.1 85/05/30 SMI */ 2 | 3 | #include "../h/param.h" 4 | #include "../h/systm.h" 5 | #include "../h/time.h" 6 | #include "../h/conf.h" 7 | #include "../h/buf.h" 8 | #include "../h/vfs.h" 9 | #include "../h/vnode.h" 10 | 11 | /* 12 | * Convert a dev into a vnode pointer suitable for bio. 13 | */ 14 | 15 | struct dev_vnode { 16 | struct vnode dv_vnode; 17 | struct dev_vnode *dv_link; 18 | } *dev_vnode_headp; 19 | 20 | devtovp_badop() 21 | { 22 | panic("devtovp_badop"); 23 | } 24 | 25 | int 26 | devtovp_inactive(vp) 27 | struct vnode *vp; 28 | { 29 | /* could free the vnode here */ 30 | return(0); 31 | } 32 | 33 | int 34 | devtovp_strategy(bp) 35 | struct buf *bp; 36 | { 37 | 38 | (*bdevsw[major(bp->b_vp->v_rdev)].d_strategy)(bp); 39 | return(0); 40 | } 41 | 42 | struct vnodeops dev_vnode_ops = { 43 | devtovp_badop, 44 | devtovp_badop, 45 | devtovp_badop, 46 | devtovp_badop, 47 | devtovp_badop, 48 | devtovp_badop, 49 | devtovp_badop, 50 | devtovp_badop, 51 | devtovp_badop, 52 | devtovp_badop, 53 | devtovp_badop, 54 | devtovp_badop, 55 | devtovp_badop, 56 | devtovp_badop, 57 | devtovp_badop, 58 | devtovp_badop, 59 | devtovp_badop, 60 | devtovp_badop, 61 | devtovp_badop, 62 | devtovp_inactive, 63 | devtovp_badop, 64 | devtovp_strategy 65 | }; 66 | 67 | struct vnode * 68 | devtovp(dev) 69 | dev_t dev; 70 | { 71 | register struct dev_vnode *dvp; 72 | register struct dev_vnode *endvp; 73 | 74 | endvp = (struct dev_vnode *)0; 75 | for (dvp = dev_vnode_headp; dvp; dvp = dvp->dv_link) { 76 | if (dvp->dv_vnode.v_rdev == dev) { 77 | VN_HOLD(&dvp->dv_vnode); 78 | return (&dvp->dv_vnode); 79 | } 80 | endvp = dvp; 81 | } 82 | dvp = (struct dev_vnode *) 83 | kmem_alloc(sizeof (struct dev_vnode)); 84 | bzero((caddr_t)dvp, sizeof(struct dev_vnode)); 85 | dvp->dv_vnode.v_count = 1; 86 | dvp->dv_vnode.v_op = &dev_vnode_ops; 87 | dvp->dv_vnode.v_rdev = dev; 88 | if (endvp != (struct dev_vnode *)0) { 89 | endvp->dv_link = dvp; 90 | } else { 91 | dev_vnode_headp = dvp; 92 | } 93 | return (&dvp->dv_vnode); 94 | } 95 | -------------------------------------------------------------------------------- /usr/man/man2/getdomainname.2: -------------------------------------------------------------------------------- 1 | .\" @(#)getdomainname.2 1.3 85/04/04 SMI; from UCB 4.2 2 | .TH GETDOMAINNAME 2 "5 November 1984" 3 | .SH NAME 4 | getdomainname, setdomainname \- get/set name of current domain 5 | .SH SYNOPSIS 6 | .nf 7 | .ft B 8 | getdomainname(name, namelen) 9 | char *name; 10 | int namelen; 11 | .sp .5 12 | .ft B 13 | setdomainname(name, namelen) 14 | char *name; 15 | int namelen; 16 | .fi 17 | .IX getdomainname "" \fLgetdomainname\fP 18 | .IX "processes and protection" getdomainname "" \fLgetdomainname\fP 19 | .IX domain "get name of current" 20 | .IX "get current domain name" 21 | .IX setdomainname "" \fLsetdomainname\fP 22 | .IX "processes and protection" setdomainname "" \fLsetdomainname\fP 23 | .IX domain "set name of current" 24 | .IX "set current domain name" 25 | .SH DESCRIPTION 26 | .LP 27 | .I Getdomainname 28 | returns the name of the domain for the current processor, as previously 29 | set by 30 | .IR setdomainname . 31 | The parameter 32 | .I namelen 33 | specifies the size of the 34 | .I name 35 | array. The returned name is null-terminated unless insufficient space 36 | is provided. 37 | .LP 38 | .I Setdomainname 39 | sets the domain of the host machine to be 40 | .IR name , 41 | which has length 42 | .IR namelen . 43 | This call is restricted to the super-user and is normally used only 44 | when the system is bootstrapped. 45 | .LP 46 | The purpose of domains is to enable two distinct networks that may have 47 | host names in common to merge. Each network would be distinguished by 48 | having a different domain name. At the current time, only the yellow 49 | pages service makes use of domains. 50 | .SH "RETURN VALUE 51 | If the call succeeds a value of 0 is returned. If the call fails, then 52 | a value of \-1 is returned and an error code is placed int the global 53 | location \fIerrno\fP. 54 | .SH "ERRORS 55 | The following errors may be returned by these calls: 56 | .TP 15 57 | [EFAULT] 58 | The \fIname\fP or \fInamelen\fP parameter gave an invalid address. 59 | .TP 15 60 | [EPERM] 61 | The caller was not the super-user. 62 | .SH BUGS 63 | Domain names are limited to 255 characters. 64 | -------------------------------------------------------------------------------- /usr/src/sun/sys/conf/param.c: -------------------------------------------------------------------------------- 1 | /* @(#)param.c 1.1 85/05/30 SMI; from UCB 6.1 83/07/29 */ 2 | 3 | #include "../h/param.h" 4 | #include "../h/systm.h" 5 | #include "../h/socket.h" 6 | #include "../h/user.h" 7 | #include "../h/proc.h" 8 | #include "../h/text.h" 9 | #include "../h/vnode.h" 10 | #include "../h/file.h" 11 | #include "../h/callout.h" 12 | #include "../h/clist.h" 13 | #include "../h/cmap.h" 14 | #include "../h/mbuf.h" 15 | #include "../h/quota.h" 16 | #include "../h/kernel.h" 17 | #include "../ufs/inode.h" 18 | /* 19 | * System parameter formulae. 20 | * 21 | * This file is copied into each directory where we compile 22 | * the kernel; it should be modified there to suit local taste 23 | * if necessary. 24 | * 25 | * Compiled with -DTIMEZONE=x -DDST=x -DMAXUSERS=xx 26 | */ 27 | 28 | #define HZ 50 29 | int hz = HZ; 30 | int tick = 1000000 / HZ; 31 | struct timezone tz = { TIMEZONE, DST }; 32 | #ifdef sun 33 | #define NPROC (10 + 16 * MAXUSERS) 34 | #undef MAXUPRC 35 | #define MAXUPRC (NPROC - 5) 36 | #else 37 | #define NPROC (10 + 8 * MAXUSERS) 38 | #endif 39 | int nproc = NPROC; 40 | int maxuprc = MAXUPRC; 41 | int ntext = 24 + MAXUSERS; 42 | int ninode = (NPROC + 16 + MAXUSERS) + 64; 43 | int nfile = 16 * (NPROC + 16 + MAXUSERS) / 10 + 64; 44 | int ncallout = 16 + NPROC; 45 | int nclist = 100 + 16 * MAXUSERS; 46 | int nport = NPROC / 2; 47 | #ifdef QUOTA 48 | int nquota = (MAXUSERS * 9)/7 + 3; 49 | int ndquot = (MAXUSERS*NMOUNT)/4 + NPROC; 50 | #endif 51 | 52 | /* 53 | * These are initialized at bootstrap time 54 | * to values dependent on memory size 55 | */ 56 | int nbuf, nswbuf; 57 | 58 | /* 59 | * These have to be allocated somewhere; allocating 60 | * them here forces loader errors if this file is omitted. 61 | */ 62 | struct proc *proc, *procNPROC; 63 | struct text *text, *textNTEXT; 64 | struct inode *inode, *inodeNINODE; 65 | struct file *file, *fileNFILE; 66 | struct callout *callout; 67 | struct cblock *cfree; 68 | struct buf *buf, *swbuf; 69 | short *swsize; 70 | int *swpf; 71 | char *buffers; 72 | struct cmap *cmap, *ecmap; 73 | #ifdef QUOTA 74 | struct quota *quota, *quotaNQUOTA; 75 | struct dquot *dquot, *dquotNDQUOT; 76 | #endif 77 | -------------------------------------------------------------------------------- /usr/man/man3/getnetgrent.3n: -------------------------------------------------------------------------------- 1 | .\" @(#)getnetgrent.3n 1.2 85/04/04 SMI; from UCB 4.2 2 | .TH GETNETGRENT 3N "1 February 1985" 3 | .SH NAME 4 | getnetgrent, setnetgrent, endnetgrent, innetgr \- get network group entry 5 | .SH SYNOPSIS 6 | .nf 7 | .ft B 8 | innetgr(netgroup, machine, user, domain) 9 | char *netgroup, *machine, *user, *domain; 10 | .sp.5 11 | setnetgrent(netgroup) 12 | char *netgroup 13 | .sp.5 14 | endnetgrent() 15 | .sp.5 16 | getnetgrent(machinep, userp, domainp) 17 | char **machinep, **userp, **domainp; 18 | .fi 19 | .IX "get network group entry" 20 | .IX "set network group entry" 21 | .IX "network group entry" get 22 | .IX "group entry" "get network" 23 | .IX "getnetgrent function" "" "\fLgetnetgrent\fP \(em get network group entry" 24 | .IX "setnetgrent function" "" "\fLsetnetgrent\fP \(em get network group entry" 25 | .IX "endnetgrent function" "" "\fLendnetgrent\fP \(em get network group entry" 26 | .IX "innetgr function" "" "\fLinnetgr\fP \(em get network group entry" 27 | .SH DESCRIPTION 28 | \fIInngetgr\fP returns 1 or 0, depending on whether 29 | \fInetgroup\fP contains the machine, user, domain triple as a member. 30 | Any of the three strings machine, user, or domain can be NULL, in 31 | which case it signifies a wild card. 32 | .PP 33 | \fIGetnetgrent\fP 34 | returns the next member of a network group. After the call, 35 | machinep will contain a pointer to a string containing the name 36 | of the machine part of the network group member, and similarly 37 | for userp and domainp. Getnetgrent will 38 | malloc space for the name. This space is released when a endnetgrent 39 | call is made. 40 | Getnetgrent returns 1 if it succeeding in obtaining another 41 | member of the network group, 0 if it has reached the 42 | end of the group. 43 | .PP 44 | .I Setnetgrent 45 | establishes the network group from which getnetgrent will 46 | obtain members, and also restarts calls to getnetgrent 47 | from the beginning of the list. If the previous setnetgrent 48 | call was to a different network group, a endnetgrent call is 49 | implied. 50 | .I Endnetgrent 51 | frees the space allocated during the getnetgrent calls. 52 | .SH FILES 53 | /etc/netgroup 54 | -------------------------------------------------------------------------------- /usr/man/man5/group.5: -------------------------------------------------------------------------------- 1 | .\" @(#)group.5 1.4 85/04/04 SMI; from UCB 4.2 2 | .TH GROUP 5 "1 February 1985" 3 | .SH NAME 4 | group \- group file 5 | .SH SYNOPSIS 6 | .B /etc/group 7 | .SH DESCRIPTION 8 | .IX "group file" "" "\fLgroup\fP \(em group file format" 9 | .I Group 10 | contains for each group the following information: 11 | .IP \(bu 2 12 | group name 13 | .IP \(bu 2 14 | encrypted password 15 | .IP \(bu 2 16 | numerical group ID 17 | .IP \(bu 2 18 | a comma separated list of all users allowed in the group 19 | .LP 20 | This is an 21 | .SM ASCII 22 | file. The fields are separated by colons; 23 | each group is separated from the next by a new-line. 24 | If the password field is null, no password is demanded. 25 | .LP 26 | This file resides in the 27 | .I /etc 28 | directory. Because of the encrypted passwords, 29 | it can and does have general read permission and can be 30 | used, for example, to map numerical group ID's to names. 31 | .PP 32 | A group file can have a line beginning with a plus (+), 33 | which means to incorporate entries from the yellow pages. 34 | There are two styles of + entries: 35 | All by itself, + means to insert the entire contents 36 | of the yellow pages group file at that point; 37 | .I +name 38 | means to insert the entry (if any) for 39 | .I name 40 | from the yellow pages at that point. 41 | If a + entry has a non-null password or group member field, 42 | the contents of that field will overide 43 | what is contained in the yellow pages. 44 | The numerical group ID field cannot be overridden. 45 | .SH EXAMPLE 46 | .PP 47 | .ft L 48 | .nf 49 | +myproject:::bill, steve 50 | +: 51 | .fi 52 | .PP 53 | If these entries appear at the end of a group file, then the group 54 | .I myproject 55 | will have members 56 | .IR bill and steve , 57 | and the password and group ID of the yellow pages entry for the group 58 | .IR myproject . 59 | All the groups listed in the yellow pages 60 | will be pulled in and placed after the entry for 61 | .IR myproject . 62 | .SH FILES 63 | /etc/group 64 | /etc/yp/group 65 | .SH "SEE ALSO" 66 | setgroups(2), initgroups(3), crypt(3), passwd(1), passwd(5) 67 | .SH BUGS 68 | The 69 | .IR passwd (1) 70 | command won't change group passwords. 71 | -------------------------------------------------------------------------------- /usr/man/man2/nfsmount.2: -------------------------------------------------------------------------------- 1 | .\" @(#)nfsmount.2 1.2 85/04/04 SMI; from UCB 4.2 2 | .TH NFSMOUNT 2 "1 February 1985" 3 | .SH NAME 4 | nfsmount \- mount an NFS file system 5 | .SH SYNOPSIS 6 | .nf 7 | .ft B 8 | nfsmount(addr, fh, dir, rwflag, hard) 9 | struct sockaddr_in *addr; 10 | fhandle_t *fh; 11 | char *freq; 12 | int rwflag; 13 | int hard; 14 | .fi 15 | .IX nfsmount "" \fLnfsmount\fP 16 | .IX "system operation support" nfsmount "" \fLnfsmount\fP 17 | .IX "network file system" nfsmount "" \fLnfsmount\fP 18 | .SH DESCRIPTION 19 | .I Nfsmount 20 | mounts an 21 | .IR NFS (4) 22 | file system on the directory 23 | .IR dir . 24 | .I Addr 25 | is the 26 | .IR UDP (4) 27 | address of the server that owns the file system to mount. 28 | .I Fh 29 | is a file handle, obtained from the server, 30 | to identify the root directory on the server that is being mounted. 31 | .PP 32 | The 33 | .I rwflag 34 | argument determines whether 35 | the file system can be written on; if it is 0 writing 36 | is allowed, if non-zero no writing is done. 37 | .PP 38 | The 39 | .I hard 40 | argument determines whether the remote file system 41 | is mounted hard or soft. 42 | A soft mount causes an error to be returned when a remote access times out. 43 | Hard mounts cause the access to retry until the server responds. 44 | A value of 1 indicates a hard mount. 45 | .SH "RETURN VALUE 46 | .I Nfsmount 47 | returns 0 if the action occurred, \-1 if 48 | some error occurred. 49 | .SH ERRORS 50 | .I Nfsmount 51 | will fail when one of the following occurs: 52 | .TP 15 53 | [EPERM] 54 | The caller is not the super-user or the path name given for 55 | .I dir 56 | contains characters with the high bit set. 57 | .TP 15 58 | [ENAMETOOLONG] 59 | The path name for 60 | .I dir 61 | is too long. 62 | .TP 15 63 | [ELOOP] 64 | .I Dir 65 | contains a symbolic link loop. 66 | .TP 15 67 | [ETIMEDOUT] 68 | The server at 69 | .I addr 70 | is not accessable. 71 | This can only happen if the 72 | .I hard 73 | flag is set. 74 | .TP 15 75 | [ENOTDIR] 76 | A component of the path prefix in 77 | .I dir 78 | is not a directory. 79 | .TP 15 80 | [EBUSY] 81 | Another process currently 82 | holds a reference to 83 | .IR fh . 84 | .SH "SEE ALSO" 85 | mount(2), unmount(2), mount(8) 86 | -------------------------------------------------------------------------------- /usr/src/sun/sys/net/route.h: -------------------------------------------------------------------------------- 1 | /* @(#)route.h 1.1 85/05/30 SMI; from UCB 4.10 83/05/30 */ 2 | 3 | /* 4 | * Kernel resident routing tables. 5 | * 6 | * The routing tables are initialized at boot time by 7 | * making entries for all directly connected interfaces. 8 | */ 9 | 10 | /* 11 | * A route consists of a destination address and a reference 12 | * to a routing entry. These are often held by protocols 13 | * in their control blocks, e.g. inpcb. 14 | */ 15 | struct route { 16 | struct rtentry *ro_rt; 17 | struct sockaddr ro_dst; 18 | #ifdef notdef 19 | caddr_t ro_pcb; /* not used yet */ 20 | #endif 21 | }; 22 | 23 | /* 24 | * We distinguish between routes to hosts and routes to networks, 25 | * preferring the former if available. For each route we infer 26 | * the interface to use from the gateway address supplied when 27 | * the route was entered. Routes that forward packets through 28 | * gateways are marked so that the output routines know to address the 29 | * gateway rather than the ultimate destination. 30 | */ 31 | struct rtentry { 32 | u_long rt_hash; /* to speed lookups */ 33 | struct sockaddr rt_dst; /* key */ 34 | struct sockaddr rt_gateway; /* value */ 35 | short rt_flags; /* up/down?, host/net */ 36 | short rt_refcnt; /* # held references */ 37 | u_long rt_use; /* raw # packets forwarded */ 38 | struct ifnet *rt_ifp; /* the answer: interface to use */ 39 | }; 40 | 41 | #define RTF_UP 0x1 /* route useable */ 42 | #define RTF_GATEWAY 0x2 /* destination is a gateway */ 43 | #define RTF_HOST 0x4 /* host entry (net otherwise) */ 44 | 45 | /* 46 | * Routing statistics. 47 | */ 48 | struct rtstat { 49 | short rts_badredirect; /* bogus redirect calls */ 50 | short rts_dynamic; /* routes created by redirects */ 51 | short rts_newgateway; /* routes modified by redirects */ 52 | short rts_unreach; /* lookups which failed */ 53 | short rts_wildcard; /* lookups satisfied by a wildcard */ 54 | }; 55 | 56 | #ifdef KERNEL 57 | #define RTFREE(rt) \ 58 | if ((rt)->rt_refcnt == 1) \ 59 | rtfree(rt); \ 60 | else \ 61 | (rt)->rt_refcnt--; 62 | 63 | #define RTHASHSIZ 8 64 | struct mbuf *rthost[RTHASHSIZ]; 65 | struct mbuf *rtnet[RTHASHSIZ]; 66 | struct rtstat rtstat; 67 | #endif 68 | -------------------------------------------------------------------------------- /usr/src/sun/sys/vaxif/if_ecreg.h: -------------------------------------------------------------------------------- 1 | /* @(#)if_ecreg.h 1.1 85/05/30 SMI; from UCB 6.1 83/07/29 */ 2 | 3 | /* 4 | * 3Com Ethernet controller registers. 5 | */ 6 | struct ecdevice { 7 | short ec_rcr; /* Receive Control Register */ 8 | short ec_xcr; /* Transmit Control Register */ 9 | }; 10 | 11 | /* 12 | * Control and status bits -- rcr 13 | */ 14 | #define EC_SPIE 0x8000 /* set parity interrupt enable */ 15 | #define EC_ASTEP 0x4000 /* increment address counter */ 16 | #define EC_AROM 0x2000 /* 1: Use address ROM, 0: use RAM */ 17 | #define EC_PE 0x2000 /* Parity error */ 18 | #define EC_AWCLK 0x1000 /* address write clock bit */ 19 | #define EC_PIE 0x1000 /* Parity interrupt enable (read) */ 20 | #define EC_ADATA 0x0f00 /* address/filtering */ 21 | #define EC_RDONE 0x0080 /* receive done */ 22 | #define EC_MDISAB 0x0080 /* memory disable */ 23 | #define EC_RINTEN 0x0040 /* receive interrupt enable */ 24 | #define EC_RCLR 0x0020 /* clear RDONE bit */ 25 | #define EC_RWBN 0x0010 /* submit buffer for receive */ 26 | #define EC_RBN 0x000f /* buffer number */ 27 | 28 | #define EC_RBITS "\10\16PE\15PIE\10RDONE\7RINTEN" 29 | 30 | /* 31 | * Control and status bits -- xcr 32 | */ 33 | #define EC_JAM 0x8000 /* collision dectected */ 34 | #define EC_JINTEN 0x4000 /* collision interrupt enable */ 35 | #define EC_JCLR 0x2000 /* clear collision detect */ 36 | #define EC_UECLR 0x0100 /* reset controller */ 37 | #define EC_XDONE 0x0080 /* transmit done */ 38 | #define EC_XINTEN 0x0040 /* transmit interrupt enable */ 39 | #define EC_XCLR 0x0020 /* clear XDONE bit */ 40 | #define EC_XWBN 0x0010 /* submit buffer for transmit */ 41 | #define EC_XBN 0x000f /* buffer number */ 42 | 43 | #define EC_XBITS "\10\20JAM\17JINTEN\10XDONE\7XINTEN" 44 | 45 | /* 46 | * Useful combinations 47 | */ 48 | #define EC_READ (0x600|EC_RINTEN|EC_RWBN) 49 | #define EC_WRITE (EC_JINTEN|EC_XINTEN|EC_XWBN) 50 | #define EC_CLEAR (EC_JINTEN|EC_XINTEN|EC_JCLR) 51 | 52 | /* 53 | * Buffer number definitions 54 | */ 55 | #define ECTBF 0 /* Buffer for transmit */ 56 | #define ECRLBF 1 /* First buffer for receive */ 57 | #define ECRHBF 15 /* Last buffer for receive */ 58 | 59 | #define ECRDOFF 528 /* Packet offset in read buffer */ 60 | --------------------------------------------------------------------------------