Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 7 Jun 2017 01:48:12 +0000 (UTC)
From:      Gleb Smirnoff <glebius@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r319641 - in head/sys: kern sys
Message-ID:  <201706070148.v571mCwE017431@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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,



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201706070148.v571mCwE017431>