summaryrefslogtreecommitdiffstats
path: root/sys/compat
diff options
context:
space:
mode:
authornetchild <netchild@FreeBSD.org>2006-03-21 21:56:04 +0000
committernetchild <netchild@FreeBSD.org>2006-03-21 21:56:04 +0000
commite29c4e80fd7361560c782a5d2034987165c0395d (patch)
tree434b87f04514fbf40b7f54c68d82407a077f02a1 /sys/compat
parent01ea11e4890bb7b1baf1ee0486027a6d2e74d411 (diff)
downloadFreeBSD-src-e29c4e80fd7361560c782a5d2034987165c0395d.zip
FreeBSD-src-e29c4e80fd7361560c782a5d2034987165c0395d.tar.gz
Fix the LINT build on alpha:
- rename some file local structure definitions, the names clash with autogenerated names - on !alpha add some compatibility defines for those renamed structures - make some functions globally visible on alpha
Diffstat (limited to 'sys/compat')
-rw-r--r--sys/compat/linux/linux_socket.c114
1 files changed, 82 insertions, 32 deletions
diff --git a/sys/compat/linux/linux_socket.c b/sys/compat/linux/linux_socket.c
index e7e98f8..6e30b43 100644
--- a/sys/compat/linux/linux_socket.c
+++ b/sys/compat/linux/linux_socket.c
@@ -72,6 +72,12 @@ static int do_sa_get(struct sockaddr **, const struct osockaddr *, int *,
struct malloc_type *);
static int linux_to_bsd_domain(int);
+#ifdef __alpha__
+#define STATIC
+#else
+#define STATIC static
+#endif
+
/*
* Reads a linux sockaddr and does any necessary translation.
* Linux sockaddrs don't have a length field, only a family.
@@ -193,7 +199,6 @@ linux_to_bsd_domain(int domain)
return (-1);
}
-#ifndef __alpha__
static int
bsd_to_linux_domain(int domain)
{
@@ -239,6 +244,7 @@ bsd_to_linux_sockopt_level(int level)
return (level);
}
+#ifndef __alpha__
static int
linux_to_bsd_ip_sockopt(int opt)
{
@@ -296,6 +302,7 @@ linux_to_bsd_so_sockopt(int opt)
}
return (-1);
}
+#endif /* !__alpha__*/
static int
linux_to_bsd_msg_flags(int flags)
@@ -447,6 +454,7 @@ bad:
return (error);
}
+#ifndef __alpha__
/* Return 0 if IP_HDRINCL is set for the given socket. */
static int
linux_check_hdrincl(struct thread *td, int s)
@@ -612,19 +620,22 @@ linux_bind(struct thread *td, struct linux_bind_args *args)
return (kern_bind(td, linux_args.s, sa));
}
+#endif /* !__alpha__*/
-struct linux_connect_args {
+struct l_connect_args {
int s;
l_uintptr_t name;
int namelen;
};
+#ifndef __alpha__
+#define linux_connect_args l_connect_args
int linux_connect(struct thread *, struct linux_connect_args *);
#endif /* !__alpha__*/
int
linux_connect(struct thread *td, struct linux_connect_args *args)
{
- struct linux_connect_args linux_args;
+ struct l_connect_args linux_args;
struct socket *so;
struct sockaddr *sa;
u_int fflag;
@@ -670,7 +681,6 @@ linux_connect(struct thread *td, struct linux_connect_args *args)
}
#ifndef __alpha__
-
struct linux_listen_args {
int s;
int backlog;
@@ -693,17 +703,22 @@ linux_listen(struct thread *td, struct linux_listen_args *args)
bsd_args.backlog = linux_args.backlog;
return (listen(td, &bsd_args));
}
+#endif /* !__alpha__*/
-struct linux_accept_args {
+struct l_accept_args {
int s;
l_uintptr_t addr;
l_uintptr_t namelen;
};
-static int
+#ifndef __alpha__
+#define linux_accept_args l_accept_args
+#endif
+
+STATIC int
linux_accept(struct thread *td, struct linux_accept_args *args)
{
- struct linux_accept_args linux_args;
+ struct l_accept_args linux_args;
struct accept_args /* {
int s;
struct sockaddr * __restrict name;
@@ -745,16 +760,20 @@ linux_accept(struct thread *td, struct linux_accept_args *args)
return (0);
}
-struct linux_getsockname_args {
+struct l_getsockname_args {
int s;
l_uintptr_t addr;
l_uintptr_t namelen;
};
-static int
+#ifndef __alpha__
+#define linux_getsockname_args l_getsockname_args
+#endif
+
+STATIC int
linux_getsockname(struct thread *td, struct linux_getsockname_args *args)
{
- struct linux_getsockname_args linux_args;
+ struct l_getsockname_args linux_args;
struct getsockname_args /* {
int fdes;
struct sockaddr * __restrict asa;
@@ -779,16 +798,20 @@ linux_getsockname(struct thread *td, struct linux_getsockname_args *args)
return (0);
}
-struct linux_getpeername_args {
+struct l_getpeername_args {
int s;
l_uintptr_t addr;
l_uintptr_t namelen;
};
-static int
+#ifndef __alpha__
+#define linux_getpeername_args l_getpeername_args
+#endif
+
+STATIC int
linux_getpeername(struct thread *td, struct linux_getpeername_args *args)
{
- struct linux_getpeername_args linux_args;
+ struct l_getpeername_args linux_args;
struct getpeername_args /* {
int fdes;
caddr_t asa;
@@ -812,17 +835,21 @@ linux_getpeername(struct thread *td, struct linux_getpeername_args *args)
return (0);
}
-struct linux_socketpair_args {
+struct l_socketpair_args {
int domain;
int type;
int protocol;
l_uintptr_t rsv;
};
-static int
+#ifndef __alpha__
+#define linux_socketpair_args l_socketpair_args
+#endif
+
+STATIC int
linux_socketpair(struct thread *td, struct linux_socketpair_args *args)
{
- struct linux_socketpair_args linux_args;
+ struct l_socketpair_args linux_args;
struct socketpair_args /* {
int domain;
int type;
@@ -844,17 +871,21 @@ linux_socketpair(struct thread *td, struct linux_socketpair_args *args)
return (socketpair(td, &bsd_args));
}
-struct linux_send_args {
+struct l_send_args {
int s;
l_uintptr_t msg;
int len;
int flags;
};
-static int
+#ifndef __alpha__
+#define linux_send_args l_send_args
+#endif
+
+STATIC int
linux_send(struct thread *td, struct linux_send_args *args)
{
- struct linux_send_args linux_args;
+ struct l_send_args linux_args;
struct sendto_args /* {
int s;
caddr_t buf;
@@ -877,17 +908,21 @@ linux_send(struct thread *td, struct linux_send_args *args)
return sendto(td, &bsd_args);
}
-struct linux_recv_args {
+struct l_recv_args {
int s;
l_uintptr_t msg;
int len;
int flags;
};
-static int
+#ifndef __alpha__
+#define linux_recv_args l_recv_args
+#endif
+
+STATIC int
linux_recv(struct thread *td, struct linux_recv_args *args)
{
- struct linux_recv_args linux_args;
+ struct l_recv_args linux_args;
struct recvfrom_args /* {
int s;
caddr_t buf;
@@ -910,6 +945,7 @@ linux_recv(struct thread *td, struct linux_recv_args *args)
return (recvfrom(td, &bsd_args));
}
+#ifndef __alpha__
static int
linux_sendto(struct thread *td, struct linux_sendto_args *args)
{
@@ -937,8 +973,9 @@ linux_sendto(struct thread *td, struct linux_sendto_args *args)
UIO_USERSPACE);
return (error);
}
+#endif /* !__alpha__*/
-struct linux_recvfrom_args {
+struct l_recvfrom_args {
int s;
l_uintptr_t buf;
int len;
@@ -947,10 +984,14 @@ struct linux_recvfrom_args {
l_uintptr_t fromlen;
};
-static int
+#ifndef __alpha__
+#define linux_recvfrom_args l_recvfrom_args
+#endif
+
+STATIC int
linux_recvfrom(struct thread *td, struct linux_recvfrom_args *args)
{
- struct linux_recvfrom_args linux_args;
+ struct l_recvfrom_args linux_args;
struct recvfrom_args /* {
int s;
caddr_t buf;
@@ -991,16 +1032,20 @@ linux_recvfrom(struct thread *td, struct linux_recvfrom_args *args)
return (0);
}
-struct linux_sendmsg_args {
+struct l_sendmsg_args {
int s;
l_uintptr_t msg;
int flags;
};
-static int
+#ifndef __alpha__
+#define linux_sendmsg_args l_sendmsg_args
+#endif
+
+STATIC int
linux_sendmsg(struct thread *td, struct linux_sendmsg_args *args)
{
- struct linux_sendmsg_args linux_args;
+ struct l_sendmsg_args linux_args;
struct msghdr msg;
struct iovec *iov;
int error;
@@ -1024,16 +1069,20 @@ linux_sendmsg(struct thread *td, struct linux_sendmsg_args *args)
return (error);
}
-struct linux_recvmsg_args {
+struct l_recvmsg_args {
int s;
l_uintptr_t msg;
int flags;
};
-static int
+#ifndef __alpha__
+#define linux_recvmsg_args l_recvmsg_args
+#endif
+
+STATIC int
linux_recvmsg(struct thread *td, struct linux_recvmsg_args *args)
{
- struct linux_recvmsg_args linux_args;
+ struct l_recvmsg_args linux_args;
struct recvmsg_args /* {
int s;
struct msghdr *msg;
@@ -1075,6 +1124,7 @@ linux_recvmsg(struct thread *td, struct linux_recvmsg_args *args)
return (error);
}
+#ifndef __alpha__
struct linux_shutdown_args {
int s;
int how;
@@ -1259,4 +1309,4 @@ linux_socketcall(struct thread *td, struct linux_socketcall_args *args)
uprintf("LINUX: 'socket' typ=%d not implemented\n", args->what);
return (ENOSYS);
}
-#endif /*!__alpha__*/
+#endif /*!__alpha__*/
OpenPOWER on IntegriCloud