Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F109849617
D31566.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D31566.diff
View Options
Index: sys/kern/kern_prot.c
===================================================================
--- sys/kern/kern_prot.c
+++ sys/kern/kern_prot.c
@@ -158,24 +158,36 @@
#endif
int
sys_getpgid(struct thread *td, struct getpgid_args *uap)
+{
+ pid_t pgid;
+ int error;
+
+ error = kern_getpgid(td, uap->pid, &pgid);
+ if (error == 0)
+ td->td_retval[0] = pgid;
+ return (error);
+}
+
+int
+kern_getpgid(struct thread *td, pid_t pid, pid_t *pgid)
{
struct proc *p;
int error;
- if (uap->pid == 0) {
+ if (pid == 0) {
p = td->td_proc;
PROC_LOCK(p);
} else {
- p = pfind(uap->pid);
+ p = pfind(pid);
if (p == NULL)
return (ESRCH);
error = p_cansee(td, p);
- if (error) {
+ if (error != 0) {
PROC_UNLOCK(p);
return (error);
}
}
- td->td_retval[0] = p->p_pgrp->pg_id;
+ *pgid = p->p_pgrp->pg_id;
PROC_UNLOCK(p);
return (0);
}
Index: sys/sys/syscallsubr.h
===================================================================
--- sys/sys/syscallsubr.h
+++ sys/sys/syscallsubr.h
@@ -158,6 +158,7 @@
int kern_getfsstat(struct thread *td, struct statfs **buf, size_t bufsize,
size_t *countp, enum uio_seg bufseg, int mode);
int kern_getitimer(struct thread *, u_int, struct itimerval *);
+int kern_getpgid(struct thread *, pid_t, pid_t *);
int kern_getppid(struct thread *);
int kern_getpeername(struct thread *td, int fd, struct sockaddr **sa,
socklen_t *alen);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Feb 11, 8:02 AM (10 h, 54 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
16591477
Default Alt Text
D31566.diff (1 KB)
Attached To
Mode
D31566: Split sys_getpgid on two counterparts.
Attached
Detach File
Event Timeline
Log In to Comment