History log of /openbsd-src/sys/kern/tty.c (Results 1 – 25 of 178)
Revision Date Author Comments
# b9ae17a0 30-Dec-2024 guenther <guenther@openbsd.org>

All the device and file type ioctl routines just ignore FIONBIO,
so stop calling down into those layer from fcntl(F_SETFL) or
ioctl(FIONBIO) and delete the "do nothing for this" stubs in all
the *ioc

All the device and file type ioctl routines just ignore FIONBIO,
so stop calling down into those layer from fcntl(F_SETFL) or
ioctl(FIONBIO) and delete the "do nothing for this" stubs in all
the *ioctl routines.

ok dlg@

show more ...


# 241d6723 08-Jul-2024 claudio <claudio@openbsd.org>

Rework per proc and per process time usage accounting

For procs (threads) the accounting happens now lockless by curproc using
a generation counter. Callers need to use tu_enter() and tu_leave() for

Rework per proc and per process time usage accounting

For procs (threads) the accounting happens now lockless by curproc using
a generation counter. Callers need to use tu_enter() and tu_leave() for this.
To read the proc p_tu struct tuagg_get_proc() should be used. It ensures
that the values read is consistent.

For processes only the time of exited threads is accumulated in ps_tu and
to get the proper process time usage tuagg_get_process() needs to be called.
tuagg_get_process() will sum up all procs p_tu plus the ps_tu.

This removes another SCHED_LOCK() dependency. Adjust the code in
exit1() and exit2() to correctly account for the full run time.
For this adjust sched_exit() to do the runtime accounting like it is done
in mi_switch().

OK jca@ dlg@

show more ...


# 0d280c5f 14-Aug-2022 jsg <jsg@openbsd.org>

remove unneeded includes in sys/kern
ok mpi@ miod@


# 1525749f 02-Jul-2022 visa <visa@openbsd.org>

Remove unused device poll functions.

Also remove unneeded includes of <sys/poll.h> and <sys/select.h>.

Some addenda from jsg@.

OK miod@ mpi@


# c562e85a 15-Feb-2022 jsg <jsg@openbsd.org>

unifdef TIOCHPCL, 4.3BSD compat ioctl
ok deraadt@ guenther@


# 5a74f403 15-Dec-2021 visa <visa@openbsd.org>

Adjust pty and tty event filters

* 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

Adjust pty and tty event filters

* 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@

show more ...


# 15092f82 14-Dec-2021 visa <visa@openbsd.org>

Cover all state checks and updates with spltty() in filt_ttyread().


# 6871ed8f 02-Dec-2021 deraadt <deraadt@openbsd.org>

firstc() and nextc() use an int of global static storage. Make this
a pointer to a local variable to allow concurrent use if that ever
needs to happen in the future.
ok mpi kettenis


# da571ddd 24-Oct-2021 jsg <jsg@openbsd.org>

use NULL not 0 for pointer values in kern
ok semarie@


# 2c417a9e 19-May-2021 kettenis <kettenis@openbsd.org>

In ttyinfo() check that ps_vmspace isn't NULL before calculating the
resident set size. This replicates what the sysctl code does and fixes
a kernel crash reported by robert@

ok deraadt@


# 4123b6a7 16-May-2021 deraadt <deraadt@openbsd.org>

panic does not require a \n at the end. When one is provided, it looks wrong.


# 193f316c 08-Feb-2021 mpi <mpi@openbsd.org>

Revert the convertion of per-process thread into a SMR_TAILQ.

We did not reach a consensus about using SMR to unlock single_thread_set()
so there's no point in keeping this change.


# 9b0cf67b 25-Dec-2020 visa <visa@openbsd.org>

Refactor klist insertion and removal

Rename klist_{insert,remove}() to klist_{insert,remove}_locked().
These functions assume that the caller has locked the klist. The current
state of locking remai

Refactor klist insertion and removal

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@

show more ...


# b21c774f 07-Dec-2020 mpi <mpi@openbsd.org>

Convert the per-process thread list into a SMR_TAILQ.

Currently all iterations are done under KERNEL_LOCK() and therefor use
the *_LOCKED() variant.

From and ok claudio@


# 26c3009c 09-Sep-2020 mpi <mpi@openbsd.org>

Introduce a helper to check if a signal is ignored or masked by a thread.

ok claudio@, pirofti@


# 739ba58d 22-Jul-2020 deraadt <deraadt@openbsd.org>

pstat -t was showing bogus column data on ttys, in modes where
newline doesn't occur to rewind to column 0. If OPOST is inactive,
simply return 0.
ok millert


# 610b9993 20-Jul-2020 deraadt <deraadt@openbsd.org>

cleanup ttrstrt; no functional change; ok dlg


# 2df268a1 20-Jul-2020 deraadt <deraadt@openbsd.org>

Sigh. Only the ptyc case should tsleep in ttyretype, since others can
arrive in the wrong context. Found by jcs.


# e65f1ede 15-Jul-2020 deraadt <deraadt@openbsd.org>

Scott Cheloha convinces me the newly added tsleep_nsec should be tsleep,
to hint we are doing the minimum scheduler sleep (and as side effect,
collecting potential signal status)


# 056d7610 14-Jul-2020 deraadt <deraadt@openbsd.org>

Use a rwlock to protect the ttylist, rather than having ttymalloc/ttyfree
callers use spltty.
ok kettenis


# 8bdc3b62 14-Jul-2020 deraadt <deraadt@openbsd.org>

A pty write containing VDISCARD, VREPRINT, or various retyping cases of
VERASE would perform (sometimes irrelevant) compute in the kernel which
can be heavy (especially with our insufficient tty subs

A pty write containing VDISCARD, VREPRINT, or various retyping cases of
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

show more ...


# 2b88cdaf 15-Jun-2020 mpi <mpi@openbsd.org>

Set __EV_HUP when the conditions matching poll(2)'s POLLUP are found.

This is only done in poll-compatibility mode, when __EV_POLL is set.

ok visa@, millert@


# c8f27247 29-May-2020 deraadt <deraadt@openbsd.org>

dev/rndvar.h no longer has statistical interfaces (removed during various
conversion steps). it only contains kernel prototypes for 4 interfaces,
all of which legitimately belong in sys/systm.h, whi

dev/rndvar.h no longer has statistical interfaces (removed during various
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.

show more ...


# 7bb4371d 08-May-2020 mpi <mpi@openbsd.org>

Do not wait indefinitely for flushing when closing a tty.

This prevent exiting processes from hanging when a slave pseudo terminal
is close(2)d before its master.

From NetBSD via anton@.

Reported-

Do not wait indefinitely for flushing when closing a tty.

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@

show more ...


# 9c969c9a 07-Apr-2020 visa <visa@openbsd.org>

Abstract the head of knote lists. This allows extending the lists,
for example, with locking assertions.

OK mpi@, anton@


12345678