svn commit: r319641 - in head/sys: kern sys
Gleb Smirnoff
glebius at FreeBSD.org
Wed Jun 7 01:48:13 UTC 2017
Author: glebius
Date: Wed Jun 7 01:48:11 2017
New Revision: 319641
URL: https://svnweb.freebsd.org/changeset/base/319641
Log:
Provide typedef for socket upcall function.
While here change so_gen_t type to modern uint64_t.
Modified:
head/sys/kern/uipc_socket.c
head/sys/sys/socketvar.h
Modified: head/sys/kern/uipc_socket.c
==============================================================================
--- head/sys/kern/uipc_socket.c Wed Jun 7 01:21:34 2017 (r319640)
+++ head/sys/kern/uipc_socket.c Wed Jun 7 01:48:11 2017 (r319641)
@@ -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;
Modified: head/sys/sys/socketvar.h
==============================================================================
--- head/sys/sys/socketvar.h Wed Jun 7 01:21:34 2017 (r319640)
+++ head/sys/sys/socketvar.h Wed Jun 7 01:48:11 2017 (r319641)
@@ -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
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,
More information about the svn-src-all
mailing list