mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2025-12-11 10:03:40 +00:00
2004-04-26 Ralf Corsepius <ralf_corsepius@rtems.org>
* libnetworking/kern/kern_sysctl.c: Partial updates from FreeBSD.
This commit is contained in:
@@ -1,3 +1,7 @@
|
|||||||
|
2004-04-26 Ralf Corsepius <ralf_corsepius@rtems.org>
|
||||||
|
|
||||||
|
* libnetworking/kern/kern_sysctl.c: Partial updates from FreeBSD.
|
||||||
|
|
||||||
2004-04-26 Ralf Corsepius <ralf_corsepius@rtems.org>
|
2004-04-26 Ralf Corsepius <ralf_corsepius@rtems.org>
|
||||||
|
|
||||||
* libnetworking/netinet/igmp_var.h: Cosmetic updates from FreeBSD.
|
* libnetworking/netinet/igmp_var.h: Cosmetic updates from FreeBSD.
|
||||||
|
|||||||
@@ -95,7 +95,7 @@ static struct sx sysctllock;
|
|||||||
#else
|
#else
|
||||||
#define SYSCTL_LOCK() sx_xlock(&sysctllock)
|
#define SYSCTL_LOCK() sx_xlock(&sysctllock)
|
||||||
#define SYSCTL_UNLOCK() sx_xunlock(&sysctllock)
|
#define SYSCTL_UNLOCK() sx_xunlock(&sysctllock)
|
||||||
#define SYSCTL_INIT() sx_init(&sysctllock, "sysctl sysctllock")
|
#define SYSCTL_INIT() sx_init(&sysctllock, "sysctl lock")
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static int sysctl_root(SYSCTL_HANDLER_ARGS);
|
static int sysctl_root(SYSCTL_HANDLER_ARGS);
|
||||||
@@ -423,7 +423,7 @@ sysctl_add_oid(struct sysctl_ctx_list *clist, struct sysctl_oid_list *parent,
|
|||||||
*/
|
*/
|
||||||
SET_DECLARE(sysctl_set, struct sysctl_oid);
|
SET_DECLARE(sysctl_set, struct sysctl_oid);
|
||||||
|
|
||||||
void
|
static void
|
||||||
sysctl_register_all(void *arg)
|
sysctl_register_all(void *arg)
|
||||||
{
|
{
|
||||||
struct sysctl_oid **oidp;
|
struct sysctl_oid **oidp;
|
||||||
@@ -587,7 +587,7 @@ sysctl_sysctl_next_ls(struct sysctl_oid_list *lsp, int *name, u_int namelen,
|
|||||||
if (!sysctl_sysctl_next_ls(lsp, 0, 0, next+1,
|
if (!sysctl_sysctl_next_ls(lsp, 0, 0, next+1,
|
||||||
len, level+1, oidpp))
|
len, level+1, oidpp))
|
||||||
return 0;
|
return 0;
|
||||||
goto next;
|
goto emptynode;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (oidp->oid_number < *name)
|
if (oidp->oid_number < *name)
|
||||||
@@ -616,6 +616,7 @@ sysctl_sysctl_next_ls(struct sysctl_oid_list *lsp, int *name, u_int namelen,
|
|||||||
return (0);
|
return (0);
|
||||||
next:
|
next:
|
||||||
namelen = 1;
|
namelen = 1;
|
||||||
|
emptynode:
|
||||||
*len = level;
|
*len = level;
|
||||||
}
|
}
|
||||||
return 1;
|
return 1;
|
||||||
@@ -1077,7 +1078,7 @@ sysctl_new_user(struct sysctl_req *req, void *p, size_t l)
|
|||||||
* a place to save it in the sysctl_req structure so that the matching
|
* a place to save it in the sysctl_req structure so that the matching
|
||||||
* amount of memory can be unwired in the sysctl exit code.
|
* amount of memory can be unwired in the sysctl exit code.
|
||||||
*/
|
*/
|
||||||
void
|
int
|
||||||
sysctl_wire_old_buffer(struct sysctl_req *req, size_t len)
|
sysctl_wire_old_buffer(struct sysctl_req *req, size_t len)
|
||||||
{
|
{
|
||||||
if (req->lock == REQ_LOCKED && req->oldptr &&
|
if (req->lock == REQ_LOCKED && req->oldptr &&
|
||||||
@@ -1087,6 +1088,7 @@ sysctl_wire_old_buffer(struct sysctl_req *req, size_t len)
|
|||||||
#endif
|
#endif
|
||||||
req->lock = REQ_WIRED;
|
req->lock = REQ_WIRED;
|
||||||
}
|
}
|
||||||
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
|
|||||||
Reference in New Issue
Block a user