UNIX
OPERATING
SYSTEM
SOURCE
CODE
LEVEL
SIX
J. Lions
Department of Computer Science
The University of New South Wales.
June, 1977
This booklet has been produced for studets at the University
of New South Wales taking courses 6.602B and 6.657G.
It containes a specially edited selection of the UNIX Operating
System source code, such as might be used on a typical
PDP11/40 computer installation.
The UNIX Software System was written by K. Thompson and
D. Ritchie of Bell Telephone Laboratories, Murray Hill, NJ. It
has been made available to the University of New South Wales
under a licence from the Western Electric Company.
THIS VERSION WAS PRODUCED BY REVERTING THE SEVENTH
EDITION KERNEL SOURCE CODE AND A PROGRAM WRITTEN TO
GENERATE THE INDEX AND CROSS REFERENCE
BY BRIAN S. WALDEN WH 3A-327 AUGUST 1988
Sep 1 09:31 1988 UNIX Operating System Procedures Sorted Alphabetically Page 1
3439 setuid2855 nosys3472 getgid6746 access
8201 sgtty4999 notavil6181 getmdev6956 alloc
3949 signal1771 nseg3480 getpid0734 aretu:
2066 sleep6577 nulldev3413 getswit1012 backup:
3595 smdate2864 nullsys3452 getuid7040 badblock
6086 smount5765 open4136 grow4856 bawrite
1293 spl0:5804 open13420 gtime6585 bcopy
1297 spl1:6702 openi8165 gtty4836 bdwrite
1302 spl4:6791 owner7067 ialloc5229 bflush
1303 spl5:2416 panic1284 idle:5055 binit
1308 spl6:6517 passc7134 ifree6415 bmap
1313 spl7:8669 pcclose7276 iget4754 bread
3614 ssig8763 pcleader6922 iinit4773 breada
5979 sslep8648 pcopen4899 incore4869 brelse
6028 stat8748 pcoutput0895 incupc:4809 bwrite
6045 stat18739 pcpint5018 iodone8274 canon
3428 stime8682 pcread6364 iomove3538 chdir
4016 stop8719 pcrint4982 iowait3560 chmod
8183 stty8710 pcstart7344 iput3575 chown
0827 subyte:8701 pcwrite3991 issig8234 cinit
0826 suibyte:5259 physio7414 itrunc0676 clearseg:
0860 suiword:7723 pipe7374 iupdat3725 clock
6144 sumount7862 plock3630 kill5846 close
1739 sureg2433 prdev8055 klclose6643 closef
6811 suser7882 prele8023 klopen6672 closei
0861 suword:2340 printf8062 klread5038 clrbuf
5196 swap2369 printn8078 klrint1244 copyin:
2178 swtch4204 procxmt8090 klsgtty1252 copyout:
3486 sync3667 profil8066 klwrite0696 copyseg:
3845 timeout4043 psig8070 klxint4094 core
3656 times3963 psignal1393 ldiv:6542 cpass
2693 trap4164 ptrace5909 link5781 creat
2841 trap10967 putc:8879 lpcanon2447 deverror
8535 ttread2386 putchar8863 lpclose5096 devstart
8486 ttrstrt5731 rdwr8976 lpint0890 display:
8505 ttstart5711 read8850 lpopen1319 dpadd:
8550 ttwrite6221 readi8986 lpoutput1327 dpcmp:
8333 ttyinput7758 readp8967 lpstart6069 dup
8373 ttyoutput0740 retu:8870 lpwrite1650 estabur
8577 ttystty3205 rexit1401 lrem:3020 exec
7689 uchar5123 rhstart1410 lshift:3219 exit
6824 ufalloc5420 rkaddr1550 main2268 expand
3510 unlink5451 rkintr7455 maknode6847 falloc
7201 update5476 rkread2528 malloc8252 flushtty
3270 wait5440 rkstart5156 mapalloc3322 fork
2113 wakeup5389 rkstrategy5182 mapfree7000 free
7477 wdir5483 rkwrite6326 max6014 fstat
8217 wflushtty0889 savfp:2556 mfree0815 fubyte:
5720 write0725 savu:6339 min0814 fuibyte:
6276 writei3354 sbreak5952 mknod0844 fuiword:
7805 writep7679 schar9016 mmread0845 fuword:
4433 xalloc1940 sched9042 mmwrite4921 getblk
4490 xccdec5861 seek7518 namei0930 getc:
4398 xfree3460 setgid1826 newproc5336 geterror
4368 xswap2156 setpri3493 nice6619 getf
2134 setrun6566 nodev7167 getfs
Sep 1 09:31 1988 UNIX Operating System Files and Procedures Page 1
7679 schar5861 seek4136 growFile prf.c File param.h
7689 uchar5909 link4164 ptrace2340 printf File systm.h
File pipe.c5952 mknod4204 procxmt2369 printn File seg.h
7723 pipe5979 sslepFile text.h2386 putchar File proc.h
7758 readpFile sys3.cFile text.c2416 panic File user.h
7805 writep6014 fstat4368 xswap2433 prdev File low.s
7862 plock6028 stat4398 xfree2447 deverror File m40.s
7882 prele6045 stat14433 xallocFile malloc.c0676 _clearseg:
File tty.h6069 dup4490 xccdec2528 malloc0696 _copyseg:
File kl.c6086 smountFile buf.h2556 mfree0725 _savu:
8023 klopen6144 sumountFile conf.hFile reg.h0734 _aretu:
8055 klclose6181 getmdevFile conf.cFile trap.c0740 _retu:
8062 klreadFile rdwri.cFile bio.c2693 trap0814 _fuibyte:
8066 klwrite6221 readi4754 bread2841 trap10815 _fubyte:
8070 klxint6276 writei4773 breada2855 nosys0826 _suibyte:
8078 klrint6326 max4809 bwrite2864 nullsys0827 _subyte:
8090 klsgtty6339 min4836 bdwriteFile sysent.c0844 _fuiword:
File tty.c6364 iomove4856 bawriteFile sys1.c0845 _fuword:
8165 gttyFile subr.c4869 brelse3020 exec0860 _suiword:
8183 stty6415 bmap4899 incore3205 rexit0861 _suword:
8201 sgtty6517 passc4921 getblk3219 exit0889 _savfp:
8217 wflushtty6542 cpass4982 iowait3270 wait0890 _display:
8234 cinit6566 nodev4999 notavil3322 fork0895 _incupc:
8252 flushtty6577 nulldev5018 iodone3354 sbreak0930 _getc:
8274 canon6585 bcopy5038 clrbufFile sys4.c0967 _putc:
8333 ttyinputFile fio.c5055 binit3413 getswit1012 _backup:
8373 ttyoutput6619 getf5096 devstart3420 gtime1244 _copyin:
8486 ttrstrt6643 closef5123 rhstart3428 stime1252 _copyout:
8505 ttstart6672 closei5156 mapalloc3439 setuid1284 _idle:
8535 ttread6702 openi5182 mapfree3452 getuid1293 _spl0:
8550 ttwrite6746 access5196 swap3460 setgid1297 _spl1:
8577 ttystty6791 owner5229 bflush3472 getgid1302 _spl4:
File pc.c6811 suser5259 physio3480 getpid1303 _spl5:
8648 pcopen6824 ufalloc5336 geterror3486 sync1308 _spl6:
8669 pcclose6847 fallocFile rk.c3493 nice1313 _spl7:
8682 pcreadFile alloc.c5389 rkstrategy3510 unlink1319 _dpadd:
8701 pcwrite6922 iinit5420 rkaddr3538 chdir1327 _dpcmp:
8710 pcstart6956 alloc5440 rkstart3560 chmod1393 _ldiv:
8719 pcrint7000 free5451 rkintr3575 chown1401 _lrem:
8739 pcpint7040 badblock5476 rkread3595 smdate1410 _lshift:
8748 pcoutput7067 ialloc5483 rkwrite3614 ssig File main.c
8763 pcleader7134 ifreeFile file.h3630 kill1550 main
File lp.c7167 getfsFile filsys.h3656 times1650 estabur
8850 lpopen7201 updateFile ino.h3667 profil1739 sureg
8863 lpcloseFile iget.cFile inode.hFile clock.c1771 nseg
8870 lpwrite7276 igetFile sys2.c3725 clock File slp.c
8879 lpcanon7344 iput5711 read3845 timeout1826 newproc
8967 lpstart7374 iupdat5720 writeFile sig.c1940 sched
8976 lpint7414 itrunc5731 rdwr3949 signal2066 sleep
8986 lpoutput7455 maknode5765 open3963 psignal2113 wakeup
File mem.c7477 wdir5781 creat3991 issig2134 setrun
9016 mmreadFile nami.c5804 open14016 stop2156 setpri
9042 mmwrite7518 namei5846 close4043 psig2178 swtch
4094 core2268 expand
Sep 1 09:31 1988 UNIX Operating System Defined Symbols Page 1
0117 SIGINS 4020000 5365 NRKBLK 48725690 IFCHR40470 EINTR01005372 ARDY
0115 SIGINT 220040000 0113 NSIG5622 IFDIR0487 EINVAL 227993 ASLEEP 0100
0119 SIGIOT 640040000 0145 NTEXT5689 IFDIR50471 EIO0407992 BUSY
0122 SIGKIL 90060000 0104 NULL5621 IFMT04000 0486 EISDIR 218617 BUSY
0126 SIGPIPE 130100060000 7972 ODDP5688 IFMT028842 EJECT4584 B_ASYNC 0400
0116 SIGQIT 304010000 8843 OPEN5625 ILARG8820 EJLINE 604576 B_BUSY 010
010000 8607 PCADDR 0177550 0124 SIGSEG 115692 ILARG4586 B_DELWRI 01000 0489 EMFILE 24
0125 SIGSYS 128624 PCIHWAT 250015679 ILOCK0496 EMLINK 314574 B_DONE 02
0118 SIGTRC 58620 PCIPRI 305682 IMOUNT 0100488 ENFILE 234575 B_ERROR 04
200138 SINCR8623 PCOHWAT 1000108844 IND0484 ENODEV 190404579 B_MAP
010391 SLOAD8622 PCOLWAT 503914 IPCPRI (-1)0468 ENOENT 24577 B_PHYS 020
040393 SLOCK8621 PCOPRI 4004005629 IREAD0474 ENOEXEC 84573 B_READ 01
0142 SMAPSIZ 100-900155 PINOD04005696 IREAD0478 ENOMEM 124583 B_RELOC 0200
30384 SRUN02000 7715 PIPSIZ 40965627 ISGID0493 ENOSPC 284581 B_WANTED 0100
200137 SSIZE102000 0157 PPIPE5694 ISGID0480 ENOTBLK 154572 B_WRITE 0
0382 SSLEEP 10156 PRIBIO -507987 ISOPEN 040485 ENOTDIR 200140 CANBSIZ 256
0177776 7988 SSTART 01004000 0164 PS5626 ISUID0490 ENOTTY 25018840 CAP
60387 SSTOP9004000 0159 PSLEP5693 ISUID60472 ENXIO7990 CARR_ON 020
0100394 SSWAP-10001000 0154 PSWP5628 ISVTX38612 EOF0047955 CEOT
020392 SSYS10001000 0160 PUSER5695 ISVTX10467 EPERM7954 CERASE ’#’
0200395 STRC400158 PWAIT0405684 ITEXT320497 EPIPE01777958 CINTR
01775700166 SW(0)2605 R0025680 IUPD300495 EROFS’@’7956 CKILL
20383 SWAIT(-2)2606 R10200100000 5683 IWANT1509 CLOCK1 0177546 8618 ERROR
0400396 SWTED(-9)2607 R25630 IWRITE 02001510 CLOCK2 0172540 0494 ESPIPE 29
01044002661 SYS(-8)2608 R35697 IWRITE 020030469 ESRCH8609 CLOSED 0
50386 SZOMB(-7)0177560 2609 R40165 KL0491 ETXTBSY 260141 CMAPSIZ 100
7975 TBDELAY 006000(-6)8008 KLADDR 0177560 2610 R502007973 EVENP0347957 CQUIT
0202615 TBIT(-3)8009 KLBASE 0176500 2611 R6187976 CRDELAY 030000 0483 EXDEV
7984 TIMEOUT 01(1)2612 R7047968 LCASE-13018 EXPRI0207970 CRMOD
7961 TTHIWAT 500408812 LPADDR 0177514 7971 RAW0148847 FORM5374 CTLRDY 0200
7951 TTIPRI 10045094 RCOM8819 LPHWAT 100045519 FPIPE0107 DIRSIZ 14
7962 TTLOWAT 308014 RDRENB 018818 LPLWAT 50018010 DLBASE 0175610 5517 FREAD
7952 TTOPRI 208614 RDRENB 01108817 LPPRI5518 FWRITE 0202007980 DONE
7963 TTYHOG 2568611 READING 28821 MAXCOL 80015095 GO02008616 DONE
01702000311 UBMAP00135 MAXMEM (64*32) 5367 RESET015368 GO02008815 DONE
01776600308 UDSA5121 RHRCOM 070150130 NBUF017966 HUPCL5369 DRESET 014
01776400306 UISA5120 RHWCOM 060200143 NCALL600147 HZ02005371 DRY
01776005363 RKADDR 0177400 0304 UISD0146 NCLIST 100045681 IACC028013 DSRDY
01700002659 UMODE020315 RO05620 IALLOC 0100000 8012 NDL1170473 E2BIG
01700003706 UMODE0106 ROOTINO 135687 IALLOC 0100000 0134 NEXEC0479 EACCES 13
0202662 USER(2)2613 RPS1000132 NFILE5092 IENABLE 01000477 EAGAIN 11
160103 USIZE060317 RW0131 NINODE 1005370 IENABLE 010090475 EBADF
7977 VTDELAY 0400003707 SCHMAG 1018011 NKL117981 IENABLE 010012658 EBIT
0170011 8610 WAITING 17974 NLDELAY 001400 2660 SETD8615 IENABLE 0100160481 EBUSY
025093 WCOM40385 SIDL0133 NMOUNT 58814 IENABLE 01000476 ECHILD 10
0200005373 WLO0123 SIGBUS 10(-1)0105 NODEV01005631 IEXEC0107969 ECHO
040316 WO0120 SIGEMT 70139 NOFILE 1501005698 IEXEC0100318 ED
027985 WOPEN0121 SIGFPT 850060000 0144 NPROC5624 IFBLK0482 EEXIST 17
027967 XTABS0114 SIGHUP 14060000 5364 NRK5691 IFBLK0466 EFAULT 106
0200005623 IFCHR270492 EFBIG