diff --git a/net/local/local.h b/net/local/local.h index 244e33296d..b37795fc89 100644 --- a/net/local/local.h +++ b/net/local/local.h @@ -664,6 +664,16 @@ int local_pollsetup(FAR struct socket *psock, FAR struct pollfd *fds); int local_pollteardown(FAR struct socket *psock, FAR struct pollfd *fds); +/**************************************************************************** + * Name: local_generate_instance_id + * + * Description: + * Generate instance ID for stream + * + ****************************************************************************/ + +int32_t local_generate_instance_id(void); + #undef EXTERN #ifdef __cplusplus } diff --git a/net/local/local_connect.c b/net/local/local_connect.c index 403200fe68..cbff13df02 100644 --- a/net/local/local_connect.c +++ b/net/local/local_connect.c @@ -45,26 +45,6 @@ * Private Functions ****************************************************************************/ -/**************************************************************************** - * Name: local_generate_instance_id - ****************************************************************************/ - -static int32_t local_generate_instance_id(void) -{ - static int32_t g_next_instance_id = 0; - int32_t id; - - /* Called from local_connect with net_lock held. */ - - id = g_next_instance_id++; - if (g_next_instance_id < 0) - { - g_next_instance_id = 0; - } - - return id; -} - /**************************************************************************** * Name: _local_semtake() and _local_semgive() * @@ -216,6 +196,30 @@ errout_with_fifos: * Public Functions ****************************************************************************/ +/**************************************************************************** + * Name: local_generate_instance_id + * + * Description: + * Generate instance ID for stream + * + ****************************************************************************/ + +int32_t local_generate_instance_id(void) +{ + static int32_t g_next_instance_id = 0; + int32_t id; + + /* Called from local_connect with net_lock held. */ + + id = g_next_instance_id++; + if (g_next_instance_id < 0) + { + g_next_instance_id = 0; + } + + return id; +} + /**************************************************************************** * Name: psock_local_connect *