mirror of
https://github.com/DoctorWkt/pdp7-unix.git
synced 2026-02-01 22:42:59 +00:00
pbsh.s: try making shell interruptable when reading from a file
This commit is contained in:
@@ -52,19 +52,17 @@
|
||||
" argptr, and copy the names up).
|
||||
maxargs=10
|
||||
|
||||
lac d1
|
||||
sys intrp " make shell uninterruptable
|
||||
|
||||
" see if reading from a special file
|
||||
cla; sys seek; 1; 0 " try seeking stdin forward
|
||||
cla; sys seek; 1; 0 " try seeking stdin forward one word
|
||||
sna " new offset non-zero?
|
||||
jmp 1f " no: input is a special file (ttyin,keyboard)
|
||||
dzm prompt " yes: regular file, kill prompt
|
||||
cla; sys seek; 0; 0 " seek file back to start
|
||||
jmp newline
|
||||
|
||||
" stdin is a special file, see if superuser
|
||||
1: sys getuid
|
||||
1: lac d1
|
||||
sys intrp " make shell uninterruptable
|
||||
sys getuid
|
||||
sma " <0?
|
||||
jmp newline " no
|
||||
lac hash " yes: superuser
|
||||
|
||||
Reference in New Issue
Block a user