From b3244df7991c71d2888bfd3bfd90213cf201bca5 Mon Sep 17 00:00:00 2001 From: Gleb Smirnoff Date: Wed, 7 Jun 2017 01:48:11 +0000 Subject: [PATCH] Provide typedef for socket upcall function. While here change so_gen_t type to modern uint64_t. --- sys/kern/uipc_socket.c | 3 +-- sys/sys/socketvar.h | 8 ++++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c index f8a2e86ee8b..f66b32518bf 100644 --- a/sys/kern/uipc_socket.c +++ b/sys/kern/uipc_socket.c @@ -3559,8 +3559,7 @@ sodupsockaddr(const struct sockaddr *sa, int mflags) * Register per-socket buffer upcalls. */ void -soupcall_set(struct socket *so, int which, - int (*func)(struct socket *, void *, int), void *arg) +soupcall_set(struct socket *so, int which, so_upcall_t func, void *arg) { struct sockbuf *sb; diff --git a/sys/sys/socketvar.h b/sys/sys/socketvar.h index 46fe04d513a..8ecb912d6e0 100644 --- a/sys/sys/socketvar.h +++ b/sys/sys/socketvar.h @@ -55,7 +55,8 @@ struct vnet; * handle on protocol and pointer to protocol * private data and error information. */ -typedef u_quad_t so_gen_t; +typedef uint64_t so_gen_t; +typedef int so_upcall_t(struct socket *, void *, int); struct socket; @@ -400,9 +401,8 @@ int sosend_generic(struct socket *so, struct sockaddr *addr, int flags, struct thread *td); int soshutdown(struct socket *so, int how); void sotoxsocket(struct socket *so, struct xsocket *xso); -void soupcall_clear(struct socket *so, int which); -void soupcall_set(struct socket *so, int which, - int (*func)(struct socket *, void *, int), void *arg); +void soupcall_clear(struct socket *, int); +void soupcall_set(struct socket *, int, so_upcall_t, void *); void sowakeup(struct socket *so, struct sockbuf *sb); void sowakeup_aio(struct socket *so, struct sockbuf *sb); int selsocket(struct socket *so, int events, struct timeval *tv,