fork.c (85868995d9d82de5b0de38d695559daddffef893) | fork.c (0800d30832ddecf2d9dc40068fed9df95930a8f1) |
---|---|
1/* 2 * linux/kernel/fork.c 3 * 4 * Copyright (C) 1991, 1992 Linus Torvalds 5 */ 6 7/* 8 * 'fork.c' contains the help-routines for the 'fork' system call --- 1235 unchanged lines hidden (view full) --- 1244 } 1245 1246 if (likely(p->pid)) { 1247 add_parent(p); 1248 if (unlikely(p->ptrace & PT_PTRACED)) 1249 __ptrace_link(p, current->parent); 1250 1251 if (thread_group_leader(p)) { | 1/* 2 * linux/kernel/fork.c 3 * 4 * Copyright (C) 1991, 1992 Linus Torvalds 5 */ 6 7/* 8 * 'fork.c' contains the help-routines for the 'fork' system call --- 1235 unchanged lines hidden (view full) --- 1244 } 1245 1246 if (likely(p->pid)) { 1247 add_parent(p); 1248 if (unlikely(p->ptrace & PT_PTRACED)) 1249 __ptrace_link(p, current->parent); 1250 1251 if (thread_group_leader(p)) { |
1252 pid_t pgid = process_group(current); 1253 pid_t sid = process_session(current); 1254 | |
1255 p->signal->tty = current->signal->tty; | 1252 p->signal->tty = current->signal->tty; |
1256 p->signal->pgrp = pgid; | 1253 p->signal->pgrp = process_group(current); |
1257 set_signal_session(p->signal, process_session(current)); | 1254 set_signal_session(p->signal, process_session(current)); |
1258 attach_pid(p, PIDTYPE_PGID, find_pid(pgid)); 1259 attach_pid(p, PIDTYPE_SID, find_pid(sid)); | 1255 attach_pid(p, PIDTYPE_PGID, task_pgrp(current)); 1256 attach_pid(p, PIDTYPE_SID, task_session(current)); |
1260 1261 list_add_tail_rcu(&p->tasks, &init_task.tasks); 1262 __get_cpu_var(process_counts)++; 1263 } 1264 attach_pid(p, PIDTYPE_PID, pid); 1265 nr_threads++; 1266 } 1267 --- 414 unchanged lines hidden --- | 1257 1258 list_add_tail_rcu(&p->tasks, &init_task.tasks); 1259 __get_cpu_var(process_counts)++; 1260 } 1261 attach_pid(p, PIDTYPE_PID, pid); 1262 nr_threads++; 1263 } 1264 --- 414 unchanged lines hidden --- |