Age | Commit message (Collapse) | Author |
|
ok mpi@ miod@
|
|
Also remove unneeded includes of <sys/poll.h> and <sys/select.h>.
Some addenda from jsg@.
OK miod@ mpi@
|
|
ok deraadt@ guenther@
|
|
* Implement EVFILT_EXCEPT for ttys for HUP condition detection.
This filter is used when pollfd.events has no read/write events.
* Add HUP condition detection to filt_ptcwrite() and filt_ttywrite()
to reflect ptcpoll() and ttpoll(). Only poll(2) and select(2) can
utilize the code; kevent(2) should behave as before with EVFILT_WRITE.
* Clear EV_EOF and __EV_HUP if the EOF/HUP condition ends.
OK mpi@
|
|
|
|
a pointer to a local variable to allow concurrent use if that ever
needs to happen in the future.
ok mpi kettenis
|
|
ok semarie@
|
|
resident set size. This replicates what the sysctl code does and fixes
a kernel crash reported by robert@
ok deraadt@
|
|
|
|
We did not reach a consensus about using SMR to unlock single_thread_set()
so there's no point in keeping this change.
|
|
Rename klist_{insert,remove}() to klist_{insert,remove}_locked().
These functions assume that the caller has locked the klist. The current
state of locking remains intact because the kernel lock is still used
with all klists.
Add new functions klist_insert() and klist_remove() that lock the klist
internally. This allows some code simplification.
OK mpi@
|
|
Currently all iterations are done under KERNEL_LOCK() and therefor use
the *_LOCKED() variant.
From and ok claudio@
|
|
ok claudio@, pirofti@
|
|
newline doesn't occur to rewind to column 0. If OPOST is inactive,
simply return 0.
ok millert
|
|
|
|
arrive in the wrong context. Found by jcs.
|
|
to hint we are doing the minimum scheduler sleep (and as side effect,
collecting potential signal status)
|
|
callers use spltty.
ok kettenis
|
|
VERASE would perform (sometimes irrelevant) compute in the kernel which
can be heavy (especially with our insufficient tty subsystem locking). Use
tsleep_nsec for 1 tick in such circumstances to yield cpu, and also bring
interruptability to ptcwrite()
https://syzkaller.appspot.com/bug?extid=462539bc18fef8fc26cc
ok kettenis millert, discussions with greg and anton
|
|
This is only done in poll-compatibility mode, when __EV_POLL is set.
ok visa@, millert@
|
|
conversion steps). it only contains kernel prototypes for 4 interfaces,
all of which legitimately belong in sys/systm.h, which are already included
by all enqueue_randomness() users.
|
|
This prevent exiting processes from hanging when a slave pseudo terminal
is close(2)d before its master.
From NetBSD via anton@.
Reported-by: syzbot+2ed25b5c40d11e4c3beb@syzkaller.appspotmail.com
ok anton@, kettenis@
|
|
for example, with locking assertions.
OK mpi@, anton@
|
|
adding more filter properties without cluttering the struct.
OK mpi@, anton@
|
|
invalidation in one place.
Store struct tty pointer in kn_hook directly to simplify the code.
OK mpi@
|
|
ok bluhm@
|
|
FIOGETOWN/SIOCGPGRP/TIOCGPGRP. Do this by determining the meaning of
the ID parameter inside the sigio code. Also add cases for FIOSETOWN
and FIOGETOWN where there have been TIOCSPGRP and TIOCGPGRP before.
These changes allow removing the ID translation from sys_fcntl() and
sys_ioctl().
Idea from NetBSD
OK mpi@, claudio@
|
|
make the structs const so that the data are put in .rodata.
OK mpi@, deraadt@, anton@, bluhm@
|
|
All callers sleep indefinitely.
With help from visa@.
ok visa@, ratchov@, kn@
|
|
As per termios(4), "VTIME is a timer of 0.1 second granularity", so
convert it to milliseconds by reducing by hz and multiplying with 1000.
Furthermore, the specification (and our implementation) define members
of the c_cc arry to be of type unsigned char, so both the previous as
well as the now used arithmetic operations are guaranteed to not
overflow.
Since the timeout_add(9) API takes an int argument, the previous long
type would always be demoted anyway, so change it to int directly.
With this and hz gone, remove the obselete comment.
While here, use more mnemonic variable names.
Feedback and OK mpi
|
|
It currently creates a lock ordering problem because SCHED_LOCK() is taken
by hardclock(). That means the "priorities" of a thread should be moved
out of the SCHED_LOCK() first in order to make progress.
Reported-by: syzbot+8e4863b3dde88eb706dc@syzkaller.appspotmail.com
via anton@ as well as by kettenis@
|
|
Note that hardclock(9) still increments p_{u,s,i}ticks without holding a
lock.
ok visa@, cheloha@
|
|
does not block the signal. If all threads block the signal, we
delivered it to the main thread. This does not conform to POSIX.
If any thread unblocks the signal, it should be delivered immediately
to this thread.
Mark such signals pending at the process instead of a single thread.
Then any thread can handle it later.
OK kettenis@ guenther@
|
|
|
|
to the namei args. This fixes a bug where chmod would be allowed when
with only READ. This also allows some further cleanup of some awkward
things like PLEDGE_STAT that will follow
Lots of assistence from semarie@ - thanks!
ok semarie@
|
|
The code was already changed to return EIO, it will now return ENOTTY since
the code is deleted.
ok sthen
|
|
unnecessary because curproc always does the locking.
OK mpi@
|
|
this gets rid of the source annotation which doesn't really add
anything other than adding complexitiy. randomess is generally
good enough that the few extra bits that the source type would
add are not worth it.
ok mikeb@ deraadt@
|
|
curproc that does the locking or unlocking, so the proc parameter
is pointless and can be dropped.
OK mpi@, deraadt@
|
|
The account flag `ASU' will no longer be set but that makes suser()
mpsafe since it no longer mess with a per-process field.
No objection from millert@, ok tedu@, bluhm@
|
|
|
|
ok deraadt@ krw@
|
|
returns EIO. The base system has been cleaned of TIOCSTI uses (collaboration
between anton and I), and the ports tree appears mostly clean. A few
stragglers may be discovered and cleaned up later...
In a month or so, we should see if the #define can be removed entirely.
ok anton tedu, support from millert
|
|
struct proc to struct process.
ok deraadt@ kettenis@
|
|
background it shall receive SIGTTOU. Handle TIOCSPGRP like we do
the other tty ioctls that change the terminal. OK deraadt@ guenther@
|
|
been opened during init(8). Only log with cnwrite() if cn_devvp
exists, otherwise use cnputc() as fallback. While there move extern
declarations to dev/cons.h.
input and OK deraadt@
|
|
torture tested on amd64, i386 and macppc
ok beck mpi stefan
"the change looks right" deraadt
|
|
|
|
Use 115200 the default speed for buffer sizing in ttymalloc(). A lot
of devices call ttymalloc(0) so this affects quite a few of them.
Increases the buffer size for 9600 < baud <= 115200 from 1k to 4k.
Make ppp use the lo/hi watermarks from the tty layer which are
adjusted according to speed + buffer size. The previous fixed values
of 100 and 400 were way too small
Make pty call ttymalloc() with baud == 1000000, which is the common
value used in the tree for "fast".
ok deraadt@
|
|
|