-/* $OpenBSD: proc.c,v 1.13 2014/12/16 03:35:49 millert Exp $ */
+/* $OpenBSD: proc.c,v 1.14 2015/10/14 14:51:57 reyk Exp $ */
/*
* Copyright (c) 2010 - 2014 Reyk Floeter <reyk@openbsd.org>
void proc_open(struct privsep *, struct privsep_proc *,
struct privsep_proc *, size_t);
void proc_close(struct privsep *);
-int proc_ispeer(struct privsep_proc *, u_int, enum privsep_procid);
+int proc_ispeer(struct privsep_proc *, unsigned int, enum privsep_procid);
void proc_shutdown(struct privsep_proc *);
void proc_sig_handler(int, short, void *);
void proc_range(struct privsep *, enum privsep_procid, int *, int *);
int
-proc_ispeer(struct privsep_proc *procs, u_int nproc, enum privsep_procid type)
+proc_ispeer(struct privsep_proc *procs, unsigned int nproc,
+ enum privsep_procid type)
{
- u_int i;
+ unsigned int i;
for (i = 0; i < nproc; i++)
if (procs[i].p_id == type)
}
void
-proc_init(struct privsep *ps, struct privsep_proc *procs, u_int nproc)
+proc_init(struct privsep *ps, struct privsep_proc *procs, unsigned int nproc)
{
- u_int i, j, src, dst;
+ unsigned int i, j, src, dst;
struct privsep_pipes *pp;
/*
proc_kill(struct privsep *ps)
{
pid_t pid;
- u_int i;
+ unsigned int i;
if (privsep_process != PROC_PARENT)
return;
{
struct privsep_pipes *pa, *pb;
int fds[2];
- u_int i, j, src, proc;
+ unsigned int i, j, src, proc;
if (p == NULL)
src = privsep_process; /* parent */
void
proc_listen(struct privsep *ps, struct privsep_proc *procs, size_t nproc)
{
- u_int i, dst, src, n, m;
+ unsigned int i, dst, src, n, m;
struct privsep_pipes *pp;
/*
for (src = 0; src < PROC_MAX; src++) {
for (n = 0; n < ps->ps_instances[src]; n++) {
/* Ingore current process */
- if (src == (u_int)privsep_process &&
+ if (src == (unsigned int)privsep_process &&
n == ps->ps_instance)
continue;
void
proc_close(struct privsep *ps)
{
- u_int dst, n;
+ unsigned int dst, n;
struct privsep_pipes *pp;
if (ps == NULL)
pid_t
proc_run(struct privsep *ps, struct privsep_proc *p,
- struct privsep_proc *procs, u_int nproc,
+ struct privsep_proc *procs, unsigned int nproc,
void (*init)(struct privsep *, struct privsep_proc *, void *), void *arg)
{
pid_t pid;
struct passwd *pw;
const char *root;
struct control_sock *rcs;
- u_int n;
+ unsigned int n;
if (ps->ps_noaction)
return (0);
}
int
-imsg_compose_event(struct imsgev *iev, u_int16_t type, u_int32_t peerid,
- pid_t pid, int fd, void *data, u_int16_t datalen)
+imsg_compose_event(struct imsgev *iev, uint16_t type, uint32_t peerid,
+ pid_t pid, int fd, void *data, uint16_t datalen)
{
int ret;
}
int
-imsg_composev_event(struct imsgev *iev, u_int16_t type, u_int32_t peerid,
+imsg_composev_event(struct imsgev *iev, uint16_t type, uint32_t peerid,
pid_t pid, int fd, const struct iovec *iov, int iovcnt)
{
int ret;
int
proc_compose_imsg(struct privsep *ps, enum privsep_procid id, int n,
- u_int16_t type, int fd, void *data, u_int16_t datalen)
+ uint16_t type, int fd, void *data, uint16_t datalen)
{
int m;
int
proc_composev_imsg(struct privsep *ps, enum privsep_procid id, int n,
- u_int16_t type, int fd, const struct iovec *iov, int iovcnt)
+ uint16_t type, int fd, const struct iovec *iov, int iovcnt)
{
int m;