-static int unp_attach(struct socket *);
-static void unp_detach(struct unpcb *);
-static int unp_bind(struct unpcb *,struct sockaddr *, struct proc *);
-static int unp_connect(struct socket *,struct sockaddr *, struct proc *);
-static void unp_disconnect(struct unpcb *);
-static void unp_shutdown(struct unpcb *);
-static void unp_drop(struct unpcb *, int);
-static void unp_gc(void);
-static void unp_scan(struct mbuf *, void (*)(struct fileglob *));
-static void unp_mark(struct fileglob *);
-static void unp_discard(struct fileglob *);
-static void unp_discard_fdlocked(struct fileglob *, struct proc *);
-static int unp_internalize(struct mbuf *, struct proc *);
-static int unp_listen(struct unpcb *, struct proc *);
-
+static int unp_attach(struct socket *);
+static void unp_detach(struct unpcb *);
+static int unp_bind(struct unpcb *, struct sockaddr *, proc_t);
+static int unp_connect(struct socket *, struct sockaddr *, proc_t);
+static void unp_disconnect(struct unpcb *);
+static void unp_shutdown(struct unpcb *);
+static void unp_drop(struct unpcb *, int);
+static void unp_gc(void);
+static void unp_scan(struct mbuf *, void (*)(struct fileglob *));
+static void unp_mark(struct fileglob *);
+static void unp_discard(struct fileglob *);
+static void unp_discard_fdlocked(struct fileglob *, proc_t);
+static int unp_internalize(struct mbuf *, proc_t);
+static int unp_listen(struct unpcb *, proc_t);
+
+/* TODO: this should be in header file */
+extern int fdgetf_noref(proc_t, int, struct fileproc **);