mirror of
https://github.com/freebsd/freebsd-src.git
synced 2026-10-28 11:25:21 +01:00
Compare commits
6
Commits
8328ca324c
...
c1bc473410
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c1bc473410 | ||
|
|
7787316e19 | ||
|
|
e29de8c40b | ||
|
|
15f2dc698a | ||
|
|
9dcc20504c | ||
|
|
fb97b4f1e3 |
No files matched your search
+1
-1
@@ -231,7 +231,7 @@ in the process specified by the
|
||||
.Fa fd
|
||||
process descriptor.
|
||||
The returned file descriptor has the
|
||||
.Va O_CLOEXEC
|
||||
.Dv O_CLOEXEC
|
||||
flag set.
|
||||
The
|
||||
.Fa flags
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
.\" SUCH DAMAGE.
|
||||
.\"
|
||||
.Dd January 14, 2026
|
||||
.Dd October 16, 2026
|
||||
.Dt TERMIOS 4
|
||||
.Os
|
||||
.Sh NAME
|
||||
@@ -160,10 +160,11 @@ creates a new session with the
|
||||
function; other processes
|
||||
remaining in the old session that had this terminal as their controlling
|
||||
terminal continue to have it.
|
||||
A process does not relinquish its
|
||||
controlling terminal simply by closing all of its file descriptors
|
||||
associated with the controlling terminal if other processes continue to
|
||||
have it open.
|
||||
Closing all file descriptors associated with the controlling terminal in
|
||||
one process does not disassociate the terminal from the session while
|
||||
another process continues to have it open.
|
||||
When the last file descriptor associated with the controlling terminal is
|
||||
closed, the terminal is disassociated from the session.
|
||||
.Pp
|
||||
When a controlling process terminates, the controlling terminal is
|
||||
disassociated from the current session, allowing it to be acquired by a
|
||||
|
||||
@@ -78,9 +78,7 @@ struct sysentvec elf64_freebsd_sysvec_la48 = {
|
||||
.sv_setregs = exec_setregs,
|
||||
.sv_fixlimit = NULL,
|
||||
.sv_maxssiz = NULL,
|
||||
.sv_flags = SV_ABI_FREEBSD | SV_ASLR | SV_LP64 | SV_SHP |
|
||||
SV_TIMEKEEP | SV_RNG_SEED_VER | SV_DSO_SIG |
|
||||
SV_SIGSYS,
|
||||
.sv_flags = SV_ABI_FREEBSD_FLAGS | SV_DSO_SIG | SV_LP64,
|
||||
.sv_set_syscall_retval = cpu_set_syscall_retval,
|
||||
.sv_fetch_syscall_args = cpu_fetch_syscall_args,
|
||||
.sv_syscallnames = syscallnames,
|
||||
@@ -121,9 +119,7 @@ struct sysentvec elf64_freebsd_sysvec_la57 = {
|
||||
.sv_setregs = exec_setregs,
|
||||
.sv_fixlimit = NULL,
|
||||
.sv_maxssiz = NULL,
|
||||
.sv_flags = SV_ABI_FREEBSD | SV_ASLR | SV_LP64 | SV_SHP |
|
||||
SV_TIMEKEEP | SV_RNG_SEED_VER | SV_DSO_SIG |
|
||||
SV_SIGSYS,
|
||||
.sv_flags = SV_ABI_FREEBSD_FLAGS | SV_DSO_SIG | SV_LP64,
|
||||
.sv_set_syscall_retval = cpu_set_syscall_retval,
|
||||
.sv_fetch_syscall_args = cpu_fetch_syscall_args,
|
||||
.sv_syscallnames = syscallnames,
|
||||
|
||||
@@ -700,8 +700,7 @@ struct sysentvec elf_linux_sysvec = {
|
||||
.sv_setregs = linux_exec_setregs,
|
||||
.sv_fixlimit = NULL,
|
||||
.sv_maxssiz = NULL,
|
||||
.sv_flags = SV_ABI_LINUX | SV_LP64 | SV_SHP | SV_SIG_DISCIGN |
|
||||
SV_SIG_WAITNDQ | SV_TIMEKEEP,
|
||||
.sv_flags = SV_ABI_LINUX_FLAGS | SV_LP64,
|
||||
.sv_set_syscall_retval = linux_set_syscall_retval,
|
||||
.sv_fetch_syscall_args = linux_fetch_syscall_args,
|
||||
.sv_syscallnames = linux_syscallnames,
|
||||
|
||||
@@ -800,8 +800,7 @@ struct sysentvec elf_linux_sysvec = {
|
||||
.sv_setregs = linux_exec_setregs,
|
||||
.sv_fixlimit = linux32_fixlimit,
|
||||
.sv_maxssiz = &linux32_maxssiz,
|
||||
.sv_flags = SV_ABI_LINUX | SV_ILP32 | SV_SHP |
|
||||
SV_SIG_DISCIGN | SV_SIG_WAITNDQ | SV_TIMEKEEP,
|
||||
.sv_flags = SV_ABI_LINUX_FLAGS | SV_ILP32,
|
||||
.sv_set_syscall_retval = linux32_set_syscall_retval,
|
||||
.sv_fetch_syscall_args = linux32_fetch_syscall_args,
|
||||
.sv_syscallnames = linux32_syscallnames,
|
||||
|
||||
@@ -84,9 +84,7 @@ struct sysentvec elf32_freebsd_sysvec = {
|
||||
.sv_setregs = exec_setregs,
|
||||
.sv_fixlimit = NULL,
|
||||
.sv_maxssiz = NULL,
|
||||
.sv_flags =
|
||||
SV_ASLR | SV_SHP | SV_TIMEKEEP | SV_RNG_SEED_VER |
|
||||
SV_ABI_FREEBSD | SV_ILP32 | SV_SIGSYS,
|
||||
.sv_flags = SV_ABI_FREEBSD_FLAGS | SV_ILP32,
|
||||
.sv_set_syscall_retval = cpu_set_syscall_retval,
|
||||
.sv_fetch_syscall_args = cpu_fetch_syscall_args,
|
||||
.sv_syscallnames = syscallnames,
|
||||
|
||||
@@ -99,8 +99,7 @@ static struct sysentvec elf64_freebsd_sysvec = {
|
||||
.sv_setregs = exec_setregs,
|
||||
.sv_fixlimit = NULL,
|
||||
.sv_maxssiz = NULL,
|
||||
.sv_flags = SV_SHP | SV_TIMEKEEP | SV_ABI_FREEBSD | SV_LP64 |
|
||||
SV_ASLR | SV_RNG_SEED_VER | SV_SIGSYS,
|
||||
.sv_flags = SV_ABI_FREEBSD_FLAGS | SV_LP64,
|
||||
.sv_set_syscall_retval = cpu_set_syscall_retval,
|
||||
.sv_fetch_syscall_args = cpu_fetch_syscall_args,
|
||||
.sv_syscallnames = syscallnames,
|
||||
|
||||
@@ -448,8 +448,7 @@ struct sysentvec elf_linux_sysvec = {
|
||||
.sv_setregs = linux_exec_setregs,
|
||||
.sv_fixlimit = NULL,
|
||||
.sv_maxssiz = NULL,
|
||||
.sv_flags = SV_ABI_LINUX | SV_LP64 | SV_SHP | SV_SIG_DISCIGN |
|
||||
SV_SIG_WAITNDQ | SV_TIMEKEEP,
|
||||
.sv_flags = SV_ABI_LINUX_FLAGS | SV_LP64,
|
||||
.sv_set_syscall_retval = linux_set_syscall_retval,
|
||||
.sv_fetch_syscall_args = linux_fetch_syscall_args,
|
||||
.sv_syscallnames = linux_syscallnames,
|
||||
|
||||
@@ -126,9 +126,7 @@ struct sysentvec ia32_freebsd_sysvec = {
|
||||
.sv_setregs = ia32_setregs,
|
||||
.sv_fixlimit = ia32_fixlimit,
|
||||
.sv_maxssiz = &ia32_maxssiz,
|
||||
.sv_flags = SV_ABI_FREEBSD | SV_ASLR | SV_ILP32 |
|
||||
SV_SHP | SV_TIMEKEEP | SV_RNG_SEED_VER |
|
||||
SV_DSO_SIG | SV_SIGSYS,
|
||||
.sv_flags = SV_ABI_FREEBSD_FLAGS | SV_DSO_SIG | SV_ILP32,
|
||||
.sv_set_syscall_retval = ia32_set_syscall_retval,
|
||||
.sv_fetch_syscall_args = ia32_fetch_syscall_args,
|
||||
.sv_syscallnames = freebsd32_syscallnames,
|
||||
|
||||
@@ -59,6 +59,7 @@
|
||||
#include <sys/stat.h>
|
||||
#include <sys/sx.h>
|
||||
#include <sys/sysctl.h>
|
||||
#include <sys/sysent.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/ttycom.h>
|
||||
#include <sys/unistd.h>
|
||||
@@ -716,8 +717,13 @@ devfs_close(struct vop_close_args *ap)
|
||||
* process' controlling terminal. In that case,
|
||||
* if the reference count is 2 (this last descriptor
|
||||
* plus the session), release the reference from the session.
|
||||
*
|
||||
* Some ABIs keep the controlling terminal after the last
|
||||
* slave descriptor is closed. A closer with SV_PERSISTENT_CTTY
|
||||
* leaves the session reference in place.
|
||||
*/
|
||||
if (de->de_usecount == 2 && td != NULL) {
|
||||
if (!SV_PROC_FLAG(curproc, SV_PERSISTENT_CTTY) &&
|
||||
de->de_usecount == 2 && td != NULL) {
|
||||
p = td->td_proc;
|
||||
PROC_LOCK(p);
|
||||
if (vp == p->p_session->s_ttyvp) {
|
||||
|
||||
@@ -74,8 +74,7 @@ struct sysentvec elf32_freebsd_sysvec = {
|
||||
.sv_setregs = exec_setregs,
|
||||
.sv_fixlimit = NULL,
|
||||
.sv_maxssiz = NULL,
|
||||
.sv_flags = SV_ABI_FREEBSD | SV_ASLR | SV_ILP32 |
|
||||
SV_SHP | SV_TIMEKEEP | SV_RNG_SEED_VER | SV_SIGSYS,
|
||||
.sv_flags = SV_ABI_FREEBSD_FLAGS | SV_ILP32,
|
||||
.sv_set_syscall_retval = cpu_set_syscall_retval,
|
||||
.sv_fetch_syscall_args = cpu_fetch_syscall_args,
|
||||
.sv_syscallnames = syscallnames,
|
||||
|
||||
@@ -597,7 +597,7 @@ struct sysentvec linux_sysvec = {
|
||||
.sv_fixlimit = NULL,
|
||||
.sv_maxssiz = NULL,
|
||||
.sv_flags = SV_ABI_LINUX | SV_AOUT | SV_ILP32 |
|
||||
SV_SIG_DISCIGN | SV_SIG_WAITNDQ,
|
||||
SV_SIG_DISCIGN | SV_SIG_WAITNDQ | SV_PERSISTENT_CTTY,
|
||||
.sv_set_syscall_retval = linux_set_syscall_retval,
|
||||
.sv_fetch_syscall_args = linux_fetch_syscall_args,
|
||||
.sv_syscallnames = linux_syscallnames,
|
||||
@@ -640,8 +640,7 @@ struct sysentvec elf_linux_sysvec = {
|
||||
.sv_setregs = linux_exec_setregs,
|
||||
.sv_fixlimit = NULL,
|
||||
.sv_maxssiz = NULL,
|
||||
.sv_flags = SV_ABI_LINUX | SV_ILP32 | SV_SHP |
|
||||
SV_SIG_DISCIGN | SV_SIG_WAITNDQ | SV_TIMEKEEP,
|
||||
.sv_flags = SV_ABI_LINUX_FLAGS | SV_ILP32,
|
||||
.sv_set_syscall_retval = linux_set_syscall_retval,
|
||||
.sv_fetch_syscall_args = linux_fetch_syscall_args,
|
||||
.sv_syscallnames = NULL,
|
||||
|
||||
@@ -123,8 +123,7 @@ struct sysentvec elf32_freebsd_sysvec = {
|
||||
.sv_fixlimit = NULL,
|
||||
#endif
|
||||
.sv_maxssiz = NULL,
|
||||
.sv_flags = SV_ABI_FREEBSD | SV_ILP32 | SV_SHP | SV_ASLR |
|
||||
SV_TIMEKEEP | SV_RNG_SEED_VER | SV_SIGSYS,
|
||||
.sv_flags = SV_ABI_FREEBSD_FLAGS | SV_ILP32,
|
||||
.sv_set_syscall_retval = cpu_set_syscall_retval,
|
||||
.sv_fetch_syscall_args = cpu_fetch_syscall_args,
|
||||
.sv_shared_page_base = FREEBSD32_SHAREDPAGE,
|
||||
|
||||
@@ -85,8 +85,7 @@ struct sysentvec elf64_freebsd_sysvec_v1 = {
|
||||
.sv_setregs = exec_setregs_funcdesc,
|
||||
.sv_fixlimit = NULL,
|
||||
.sv_maxssiz = NULL,
|
||||
.sv_flags = SV_ABI_FREEBSD | SV_LP64 | SV_SHP | SV_ASLR |
|
||||
SV_TIMEKEEP | SV_RNG_SEED_VER | SV_SIGSYS,
|
||||
.sv_flags = SV_ABI_FREEBSD_FLAGS | SV_LP64,
|
||||
.sv_set_syscall_retval = cpu_set_syscall_retval,
|
||||
.sv_fetch_syscall_args = cpu_fetch_syscall_args,
|
||||
.sv_syscallnames = syscallnames,
|
||||
@@ -129,8 +128,7 @@ struct sysentvec elf64_freebsd_sysvec_v2 = {
|
||||
.sv_setregs = exec_setregs,
|
||||
.sv_fixlimit = NULL,
|
||||
.sv_maxssiz = NULL,
|
||||
.sv_flags = SV_ABI_FREEBSD | SV_LP64 | SV_SHP | SV_ASLR |
|
||||
SV_TIMEKEEP | SV_RNG_SEED_VER | SV_SIGSYS,
|
||||
.sv_flags = SV_ABI_FREEBSD_FLAGS | SV_LP64,
|
||||
.sv_set_syscall_retval = cpu_set_syscall_retval,
|
||||
.sv_fetch_syscall_args = cpu_fetch_syscall_args,
|
||||
.sv_syscallnames = syscallnames,
|
||||
|
||||
@@ -82,8 +82,7 @@ static struct sysentvec elf64_freebsd_sysvec = {
|
||||
.sv_setregs = exec_setregs,
|
||||
.sv_fixlimit = NULL,
|
||||
.sv_maxssiz = NULL,
|
||||
.sv_flags = SV_ABI_FREEBSD | SV_LP64 | SV_SHP | SV_TIMEKEEP |
|
||||
SV_ASLR | SV_RNG_SEED_VER | SV_SIGSYS,
|
||||
.sv_flags = SV_ABI_FREEBSD_FLAGS | SV_LP64,
|
||||
.sv_set_syscall_retval = cpu_set_syscall_retval,
|
||||
.sv_fetch_syscall_args = cpu_fetch_syscall_args,
|
||||
.sv_syscallnames = syscallnames,
|
||||
|
||||
+18
-12
@@ -163,18 +163,19 @@ struct sysentvec {
|
||||
struct regset **sv_regset_end;
|
||||
};
|
||||
|
||||
#define SV_ILP32 0x000100 /* 32-bit executable. */
|
||||
#define SV_LP64 0x000200 /* 64-bit executable. */
|
||||
#define SV_RESERVED0 0x004000 /* Formerly SV_IA32 */
|
||||
#define SV_AOUT 0x008000 /* a.out executable. */
|
||||
#define SV_SHP 0x010000 /* Shared page. */
|
||||
#define SV_SIGSYS 0x020000 /* SIGSYS for non-existing syscall */
|
||||
#define SV_TIMEKEEP 0x040000 /* Shared page timehands. */
|
||||
#define SV_ASLR 0x080000 /* ASLR allowed. */
|
||||
#define SV_RNG_SEED_VER 0x100000 /* random(4) reseed generation. */
|
||||
#define SV_SIG_DISCIGN 0x200000 /* Do not discard ignored signals */
|
||||
#define SV_SIG_WAITNDQ 0x400000 /* Wait does not dequeue SIGCHLD */
|
||||
#define SV_DSO_SIG 0x800000 /* Signal trampoline packed in dso */
|
||||
#define SV_ILP32 0x00000100 /* 32-bit executable. */
|
||||
#define SV_LP64 0x00000200 /* 64-bit executable. */
|
||||
#define SV_RESERVED0 0x00004000 /* Formerly SV_IA32 */
|
||||
#define SV_AOUT 0x00008000 /* a.out executable. */
|
||||
#define SV_SHP 0x00010000 /* Shared page. */
|
||||
#define SV_SIGSYS 0x00020000 /* SIGSYS for non-existing syscall */
|
||||
#define SV_TIMEKEEP 0x00040000 /* Shared page timehands. */
|
||||
#define SV_ASLR 0x00080000 /* ASLR allowed. */
|
||||
#define SV_RNG_SEED_VER 0x00100000 /* random(4) reseed generation. */
|
||||
#define SV_SIG_DISCIGN 0x00200000 /* Do not discard ignored signals */
|
||||
#define SV_SIG_WAITNDQ 0x00400000 /* Wait does not dequeue SIGCHLD */
|
||||
#define SV_DSO_SIG 0x00800000 /* Signal trampoline packed in dso */
|
||||
#define SV_PERSISTENT_CTTY 0x01000000 /* Keep ctty after the last close */
|
||||
|
||||
#define SV_ABI_MASK 0xff
|
||||
#define SV_PROC_FLAG(p, x) ((p)->p_sysent->sv_flags & (x))
|
||||
@@ -186,6 +187,11 @@ struct sysentvec {
|
||||
#define SV_ABI_FREEBSD 9
|
||||
#define SV_ABI_UNDEF 255
|
||||
|
||||
#define SV_ABI_FREEBSD_FLAGS (SV_ABI_FREEBSD | SV_ASLR | SV_SHP | \
|
||||
SV_TIMEKEEP | SV_RNG_SEED_VER | SV_SIGSYS)
|
||||
#define SV_ABI_LINUX_FLAGS (SV_ABI_LINUX | SV_SHP | SV_SIG_DISCIGN | \
|
||||
SV_SIG_WAITNDQ | SV_TIMEKEEP | SV_PERSISTENT_CTTY)
|
||||
|
||||
/* sv_coredump flags */
|
||||
#define SVC_PT_COREDUMP 0x00000001 /* dump requested by ptrace(2) */
|
||||
#define SVC_NOCOMPRESS 0x00000002 /* disable compression. */
|
||||
|
||||
Reference in new issue
Block a user