tty_pts.c (f28526e9466cd60ed33053e922238ba1c9040341) | tty_pts.c (ef9ffb8594eee294334ced627755bf5b46b48f9f) |
---|---|
1/*- 2 * SPDX-License-Identifier: BSD-2-Clause 3 * 4 * Copyright (c) 2008 Ed Schouten <ed@FreeBSD.org> 5 * All rights reserved. 6 * 7 * Portions of this software were developed under sponsorship from Snow 8 * B.V., the Netherlands. --- 474 unchanged lines hidden (view full) --- 483 kn->kn_flags |= EV_EOF; 484 return (1); 485 } else { 486 kn->kn_data = ttydisc_rint_poll(tp); 487 return (kn->kn_data > 0); 488 } 489} 490 | 1/*- 2 * SPDX-License-Identifier: BSD-2-Clause 3 * 4 * Copyright (c) 2008 Ed Schouten <ed@FreeBSD.org> 5 * All rights reserved. 6 * 7 * Portions of this software were developed under sponsorship from Snow 8 * B.V., the Netherlands. --- 474 unchanged lines hidden (view full) --- 483 kn->kn_flags |= EV_EOF; 484 return (1); 485 } else { 486 kn->kn_data = ttydisc_rint_poll(tp); 487 return (kn->kn_data > 0); 488 } 489} 490 |
491static struct filterops pts_kqops_read = { | 491static const struct filterops pts_kqops_read = { |
492 .f_isfd = 1, 493 .f_detach = pts_kqops_read_detach, 494 .f_event = pts_kqops_read_event, 495}; | 492 .f_isfd = 1, 493 .f_detach = pts_kqops_read_detach, 494 .f_event = pts_kqops_read_event, 495}; |
496static struct filterops pts_kqops_write = { | 496static const struct filterops pts_kqops_write = { |
497 .f_isfd = 1, 498 .f_detach = pts_kqops_write_detach, 499 .f_event = pts_kqops_write_event, 500}; 501 502static int 503ptsdev_kqfilter(struct file *fp, struct knote *kn) 504{ --- 87 unchanged lines hidden (view full) --- 592 tp = fp->f_data; 593 kif->kf_un.kf_pts.kf_pts_dev = tty_udev(tp); 594 kif->kf_un.kf_pts.kf_pts_dev_freebsd11 = 595 kif->kf_un.kf_pts.kf_pts_dev; /* truncate */ 596 strlcpy(kif->kf_path, tty_devname(tp), sizeof(kif->kf_path)); 597 return (0); 598} 599 | 497 .f_isfd = 1, 498 .f_detach = pts_kqops_write_detach, 499 .f_event = pts_kqops_write_event, 500}; 501 502static int 503ptsdev_kqfilter(struct file *fp, struct knote *kn) 504{ --- 87 unchanged lines hidden (view full) --- 592 tp = fp->f_data; 593 kif->kf_un.kf_pts.kf_pts_dev = tty_udev(tp); 594 kif->kf_un.kf_pts.kf_pts_dev_freebsd11 = 595 kif->kf_un.kf_pts.kf_pts_dev; /* truncate */ 596 strlcpy(kif->kf_path, tty_devname(tp), sizeof(kif->kf_path)); 597 return (0); 598} 599 |
600static struct fileops ptsdev_ops = { | 600static const struct fileops ptsdev_ops = { |
601 .fo_read = ptsdev_read, 602 .fo_write = ptsdev_write, 603 .fo_truncate = invfo_truncate, 604 .fo_ioctl = ptsdev_ioctl, 605 .fo_poll = ptsdev_poll, 606 .fo_kqfilter = ptsdev_kqfilter, 607 .fo_stat = ptsdev_stat, 608 .fo_close = ptsdev_close, --- 261 unchanged lines hidden --- | 601 .fo_read = ptsdev_read, 602 .fo_write = ptsdev_write, 603 .fo_truncate = invfo_truncate, 604 .fo_ioctl = ptsdev_ioctl, 605 .fo_poll = ptsdev_poll, 606 .fo_kqfilter = ptsdev_kqfilter, 607 .fo_stat = ptsdev_stat, 608 .fo_close = ptsdev_close, --- 261 unchanged lines hidden --- |