4.1155-freebsd-126-freebsd-12freebsd-9.3
Last change
on this file since 6ad03bf was
6ad03bf,
checked in by Joel Sherrill <joel.sherrill@…>, on 03/08/12 at 16:31:56
|
Remove rtems/ from includes of RTEMS specific files
|
-
Property mode set to
100644
|
File size:
958 bytes
|
Line | |
---|
1 | /** |
---|
2 | * @file |
---|
3 | * |
---|
4 | * @ingroup rtems_bsd_rtems |
---|
5 | * |
---|
6 | * @brief TODO. |
---|
7 | */ |
---|
8 | |
---|
9 | /* |
---|
10 | * Copyright (c) 2010 embedded brains GmbH. All rights reserved. |
---|
11 | * |
---|
12 | * embedded brains GmbH |
---|
13 | * Obere Lagerstr. 30 |
---|
14 | * 82178 Puchheim |
---|
15 | * Germany |
---|
16 | * <rtems@embedded-brains.de> |
---|
17 | * |
---|
18 | * The license and distribution terms for this file may be |
---|
19 | * found in the file LICENSE in this distribution or at |
---|
20 | * http://www.rtems.com/license/LICENSE. |
---|
21 | */ |
---|
22 | |
---|
23 | #include <freebsd/machine/rtems-bsd-config.h> |
---|
24 | |
---|
25 | #include <freebsd/sys/types.h> |
---|
26 | #include <freebsd/sys/sysctl.h> |
---|
27 | |
---|
28 | int sysctl( |
---|
29 | int *name, |
---|
30 | u_int namelen, |
---|
31 | void *oldp, |
---|
32 | size_t *oldlenp, |
---|
33 | void *newp, |
---|
34 | size_t newlen |
---|
35 | ) |
---|
36 | { |
---|
37 | int eno = EINVAL; |
---|
38 | |
---|
39 | if (namelen <= CTL_MAXNAME) { |
---|
40 | int namedup [CTL_MAXNAME]; |
---|
41 | |
---|
42 | memcpy(namedup, name, namelen * sizeof(*name)); |
---|
43 | |
---|
44 | eno = kernel_sysctl( |
---|
45 | NULL, |
---|
46 | namedup, |
---|
47 | namelen, |
---|
48 | oldp, |
---|
49 | oldlenp, |
---|
50 | newp, |
---|
51 | newlen, |
---|
52 | oldlenp, |
---|
53 | 0 |
---|
54 | ); |
---|
55 | } |
---|
56 | |
---|
57 | if (eno == 0) { |
---|
58 | return 0; |
---|
59 | } else { |
---|
60 | errno = eno; |
---|
61 | |
---|
62 | return -1; |
---|
63 | } |
---|
64 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.