summaryrefslogtreecommitdiffstats
path: root/sys/compat
diff options
context:
space:
mode:
authormini <mini@FreeBSD.org>2002-09-24 07:03:01 +0000
committermini <mini@FreeBSD.org>2002-09-24 07:03:01 +0000
commit7a31c08874a06ca4e5a0b375518b70fef7c57656 (patch)
treefff225ae2aec25af7c2c542fa9e98087610123a0 /sys/compat
parentbe95bd58fc90c8e861fc5fc7b31fa38053635353 (diff)
downloadFreeBSD-src-7a31c08874a06ca4e5a0b375518b70fef7c57656.zip
FreeBSD-src-7a31c08874a06ca4e5a0b375518b70fef7c57656.tar.gz
Back out last commit. Linux uses the old 4.3BSD sockaddr format.
Diffstat (limited to 'sys/compat')
-rw-r--r--sys/compat/linux/linux_socket.c30
-rw-r--r--sys/compat/linux/linux_sysctl.c17
-rw-r--r--sys/compat/svr4/svr4_stream.c14
3 files changed, 15 insertions, 46 deletions
diff --git a/sys/compat/linux/linux_socket.c b/sys/compat/linux/linux_socket.c
index 23b14c9..a3af70f 100644
--- a/sys/compat/linux/linux_socket.c
+++ b/sys/compat/linux/linux_socket.c
@@ -503,7 +503,7 @@ linux_accept(struct thread *td, struct linux_accept_args *args)
bsd_args.s = linux_args.s;
bsd_args.name = (caddr_t)linux_args.addr;
bsd_args.anamelen = linux_args.namelen;
- error = accept(td, &bsd_args);
+ error = oaccept(td, &bsd_args);
if (error)
return (error);
@@ -543,7 +543,7 @@ linux_getsockname(struct thread *td, struct linux_getsockname_args *args)
bsd_args.fdes = linux_args.s;
bsd_args.asa = (caddr_t) linux_args.addr;
bsd_args.alen = linux_args.namelen;
- return (getsockname(td, &bsd_args));
+ return (ogetsockname(td, &bsd_args));
}
struct linux_getpeername_args {
@@ -556,7 +556,7 @@ static int
linux_getpeername(struct thread *td, struct linux_getpeername_args *args)
{
struct linux_getpeername_args linux_args;
- struct getpeername_args /* {
+ struct ogetpeername_args /* {
int fdes;
caddr_t asa;
int *alen;
@@ -569,7 +569,7 @@ linux_getpeername(struct thread *td, struct linux_getpeername_args *args)
bsd_args.fdes = linux_args.s;
bsd_args.asa = (caddr_t) linux_args.addr;
bsd_args.alen = linux_args.namelen;
- return (getpeername(td, &bsd_args));
+ return (ogetpeername(td, &bsd_args));
}
struct linux_socketpair_args {
@@ -615,13 +615,11 @@ static int
linux_send(struct thread *td, struct linux_send_args *args)
{
struct linux_send_args linux_args;
- struct sendto_args /* {
- int s;
+ struct osend_args /* {
+ int s;
caddr_t buf;
- size_t len;
+ int len;
int flags;
- caddr_t to;
- int tolen;
} */ bsd_args;
int error;
@@ -632,9 +630,7 @@ linux_send(struct thread *td, struct linux_send_args *args)
bsd_args.buf = linux_args.msg;
bsd_args.len = linux_args.len;
bsd_args.flags = linux_args.flags;
- bsd_args.to = NULL;
- bsd_args.tolen = 0;
- return (sendto(td, &bsd_args));
+ return (osend(td, &bsd_args));
}
struct linux_recv_args {
@@ -648,13 +644,11 @@ static int
linux_recv(struct thread *td, struct linux_recv_args *args)
{
struct linux_recv_args linux_args;
- struct recvfrom_args /* {
+ struct orecv_args /* {
int s;
caddr_t buf;
int len;
int flags;
- caddr_t from;
- int fromlen;
} */ bsd_args;
int error;
@@ -665,9 +659,7 @@ linux_recv(struct thread *td, struct linux_recv_args *args)
bsd_args.buf = linux_args.msg;
bsd_args.len = linux_args.len;
bsd_args.flags = linux_args.flags;
- bsd_args.from = NULL;
- bsd_args.fromlenaddr = NULL;
- return (recvfrom(td, &bsd_args));
+ return (orecv(td, &bsd_args));
}
struct linux_sendto_args {
@@ -742,7 +734,7 @@ linux_recvfrom(struct thread *td, struct linux_recvfrom_args *args)
bsd_args.flags = linux_to_bsd_msg_flags(linux_args.flags);
bsd_args.from = linux_args.from;
bsd_args.fromlenaddr = linux_args.fromlen;
- return (recvfrom(td, &bsd_args));
+ return (orecvfrom(td, &bsd_args));
}
struct linux_recvmsg_args {
diff --git a/sys/compat/linux/linux_sysctl.c b/sys/compat/linux/linux_sysctl.c
index 153e0ac..86a8758 100644
--- a/sys/compat/linux/linux_sysctl.c
+++ b/sys/compat/linux/linux_sysctl.c
@@ -121,20 +121,3 @@ linux_sysctl(struct thread *td, struct linux_sysctl_args *args)
free(mib, M_TEMP);
return (ENOTDIR);
}
-
-int
-linux_sethostname(struct thread *td, struct linux_sethostname_args *uap)
-{
- int name[2];
- int error;
-
- name[0] = CTL_KERN;
- name[1] = KERN_HOSTNAME;
- mtx_lock(&Giant);
- if ((error = suser_cred(td->td_ucred, PRISON_ROOT)) == 0) {
- error = userland_sysctl(td, name, 2, 0, 0, 0,
- uap->hostname, uap->len, 0);
- }
- mtx_unlock(&Giant);
- return (error);
-}
diff --git a/sys/compat/svr4/svr4_stream.c b/sys/compat/svr4/svr4_stream.c
index e204f60..1618ac1 100644
--- a/sys/compat/svr4/svr4_stream.c
+++ b/sys/compat/svr4/svr4_stream.c
@@ -2252,30 +2252,24 @@ int svr4_sys_send(td, uap)
struct thread *td;
struct svr4_sys_send_args *uap;
{
- struct sendto_args osa;
-
+ struct osend_args osa;
SCARG(&osa, s) = SCARG(uap, s);
SCARG(&osa, buf) = SCARG(uap, buf);
SCARG(&osa, len) = SCARG(uap, len);
SCARG(&osa, flags) = SCARG(uap, flags);
- SCARG(&osa, to) = NULL;
- SCARG(&osa, tolen) = 0;
- return sendto(td, &osa);
+ return osend(td, &osa);
}
int svr4_sys_recv(td, uap)
struct thread *td;
struct svr4_sys_recv_args *uap;
{
- struct recvfrom_args ora;
-
+ struct orecv_args ora;
SCARG(&ora, s) = SCARG(uap, s);
SCARG(&ora, buf) = SCARG(uap, buf);
SCARG(&ora, len) = SCARG(uap, len);
SCARG(&ora, flags) = SCARG(uap, flags);
- SCARG(&ora, from) = NULL;
- SCARG(&ora, fromlenaddr) = NULL;
- return recvfrom(td, &ora);
+ return orecv(td, &ora);
}
/*
OpenPOWER on IntegriCloud