summaryrefslogtreecommitdiffstats
path: root/libc/inet/ifaddrs.c
diff options
context:
space:
mode:
author"Steven J. Hill" <sjhill@realitydiluted.com>2006-02-25 04:03:33 +0000
committer"Steven J. Hill" <sjhill@realitydiluted.com>2006-02-25 04:03:33 +0000
commitcb6a88484ce0b5ffba2fe98a40e2d51f4af92eb8 (patch)
tree520f8e8d113184cfa7954ebd274564b8c255fa9a /libc/inet/ifaddrs.c
parente4461be66e2655058aef358b00050bc70ac72861 (diff)
downloaduClibc-alpine-cb6a88484ce0b5ffba2fe98a40e2d51f4af92eb8.tar.bz2
uClibc-alpine-cb6a88484ce0b5ffba2fe98a40e2d51f4af92eb8.tar.xz
Merge from trunk. Going pretty good so far. Kind of. Okay, not really.
Diffstat (limited to 'libc/inet/ifaddrs.c')
-rw-r--r--libc/inet/ifaddrs.c32
1 files changed, 18 insertions, 14 deletions
diff --git a/libc/inet/ifaddrs.c b/libc/inet/ifaddrs.c
index 74f3622f8..b9f3cbd0e 100644
--- a/libc/inet/ifaddrs.c
+++ b/libc/inet/ifaddrs.c
@@ -17,16 +17,8 @@
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
-#define time __time
-#define sendto __sendto
-#define recvmsg __recvmsg
-#define bind __bind
-#define mempcpy __mempcpy
-#define getsockname __getsockname
-
#define __FORCE_GLIBC
#include <features.h>
-#define __USE_GNU
#include <alloca.h>
#include <assert.h>
#include <errno.h>
@@ -37,6 +29,7 @@
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
+#include <stdio.h>
#include <string.h>
#include <sys/ioctl.h>
#include <sys/socket.h>
@@ -46,6 +39,17 @@
#include "netlinkaccess.h"
+libc_hidden_proto(socket)
+libc_hidden_proto(close)
+libc_hidden_proto(time)
+libc_hidden_proto(sendto)
+libc_hidden_proto(recvmsg)
+libc_hidden_proto(bind)
+libc_hidden_proto(memset)
+libc_hidden_proto(mempcpy)
+libc_hidden_proto(getsockname)
+libc_hidden_proto(fclose)
+libc_hidden_proto(abort)
#ifndef __libc_use_alloca
# define __libc_use_alloca(x) (x < __MAX_ALLOCA_CUTOFF)
@@ -116,7 +120,7 @@ __netlink_sendreq (struct netlink_handle *h, int type)
memset (&nladdr, '\0', sizeof (nladdr));
nladdr.nl_family = AF_NETLINK;
- return TEMP_FAILURE_RETRY (__sendto (h->fd, (void *) &req, sizeof (req), 0,
+ return TEMP_FAILURE_RETRY (sendto (h->fd, (void *) &req, sizeof (req), 0,
(struct sockaddr *) &nladdr,
sizeof (nladdr)));
}
@@ -167,7 +171,7 @@ __netlink_request (struct netlink_handle *h, int type)
0
};
- read_len = TEMP_FAILURE_RETRY (__recvmsg (h->fd, &msg, 0));
+ read_len = TEMP_FAILURE_RETRY (recvmsg (h->fd, &msg, 0));
if (read_len < 0)
goto out_fail;
@@ -282,7 +286,7 @@ __netlink_close (struct netlink_handle *h)
{
/* Don't modify errno. */
int serrno = errno;
- __close(h->fd);
+ close(h->fd);
__set_errno(serrno);
}
@@ -293,13 +297,13 @@ __netlink_open (struct netlink_handle *h)
{
struct sockaddr_nl nladdr;
- h->fd = __socket (PF_NETLINK, SOCK_RAW, NETLINK_ROUTE);
+ h->fd = socket (PF_NETLINK, SOCK_RAW, NETLINK_ROUTE);
if (h->fd < 0)
goto out;
memset (&nladdr, '\0', sizeof (nladdr));
nladdr.nl_family = AF_NETLINK;
- if (__bind (h->fd, (struct sockaddr *) &nladdr, sizeof (nladdr)) < 0)
+ if (bind (h->fd, (struct sockaddr *) &nladdr, sizeof (nladdr)) < 0)
{
close_and_out:
__netlink_close (h);
@@ -313,7 +317,7 @@ __netlink_open (struct netlink_handle *h)
It is not necessarily the PID if there is more than one socket
open. */
socklen_t addr_len = sizeof (nladdr);
- if (__getsockname (h->fd, (struct sockaddr *) &nladdr, &addr_len) < 0)
+ if (getsockname (h->fd, (struct sockaddr *) &nladdr, &addr_len) < 0)
goto close_and_out;
h->pid = nladdr.nl_pid;
return 0;