| 1546 | } |
| 1547 | |
| 1548 | static int |
| 1549 | sysctl_out_proc(struct proc *p, struct sysctl_req *req, int flags) |
| 1550 | { |
| 1551 | struct sbuf sb; |
| 1552 | struct kinfo_proc ki; |
| 1553 | int error, error2; |
| 1554 | |
| 1555 | if (req->oldptr == NULL) |
| 1556 | return (SYSCTL_OUT(req, 0, kern_proc_out_size(p, flags))); |
| 1557 | |
| 1558 | sbuf_new_for_sysctl(&sb, (char *)&ki, sizeof(ki), req); |
| 1559 | sbuf_clear_flags(&sb, SBUF_INCLUDENUL); |
| 1560 | error = kern_proc_out(p, &sb, flags); |
| 1561 | error2 = sbuf_finish(&sb); |
| 1562 | sbuf_delete(&sb); |
| 1563 | if (error != 0) |
| 1564 | return (error); |
| 1565 | else if (error2 != 0) |
| 1566 | return (error2); |
| 1567 | return (0); |
| 1568 | } |
| 1569 | |
| 1570 | int |
| 1571 | proc_iterate(int (*cb)(struct proc *, void *), void *cbarg) |
no test coverage detected