Back out last commit. Linux uses the old 4.3BSD sockaddr format.

This commit is contained in:
Jonathan Mini 2002-09-24 07:03:01 +00:00
parent c18ef4c018
commit 044af7c357
7 changed files with 25 additions and 60 deletions

View File

@ -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 {

View File

@ -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);
}

View File

@ -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);
}
/*

View File

@ -223,10 +223,6 @@ struct linux_sigsuspend_args {
struct linux_sigpending_args {
char mask_l_[PADL_(l_osigset_t *)]; l_osigset_t * mask; char mask_r_[PADR_(l_osigset_t *)];
};
struct linux_sethostname_args {
char hostname_l_[PADL_(char *)]; char * hostname; char hostname_r_[PADR_(char *)];
char len_l_[PADL_(u_int)]; u_int len; char len_r_[PADR_(u_int)];
};
struct linux_setrlimit_args {
char resource_l_[PADL_(l_uint)]; l_uint resource; char resource_r_[PADR_(l_uint)];
char rlim_l_[PADL_(struct l_rlimit *)]; struct l_rlimit * rlim; char rlim_r_[PADR_(struct l_rlimit *)];
@ -695,7 +691,6 @@ int linux_setreuid16(struct thread *, struct linux_setreuid16_args *);
int linux_setregid16(struct thread *, struct linux_setregid16_args *);
int linux_sigsuspend(struct thread *, struct linux_sigsuspend_args *);
int linux_sigpending(struct thread *, struct linux_sigpending_args *);
int linux_sethostname(struct thread *, struct linux_sethostname_args *);
int linux_setrlimit(struct thread *, struct linux_setrlimit_args *);
int linux_old_getrlimit(struct thread *, struct linux_old_getrlimit_args *);
int linux_getgroups16(struct thread *, struct linux_getgroups16_args *);

View File

@ -71,7 +71,7 @@
#define LINUX_SYS_linux_setregid16 71
#define LINUX_SYS_linux_sigsuspend 72
#define LINUX_SYS_linux_sigpending 73
#define LINUX_SYS_linux_sethostname 74
#define LINUX_SYS_osethostname 74
#define LINUX_SYS_linux_setrlimit 75
#define LINUX_SYS_linux_old_getrlimit 76
#define LINUX_SYS_getrusage 77
@ -81,7 +81,7 @@
#define LINUX_SYS_linux_setgroups16 81
#define LINUX_SYS_linux_old_select 82
#define LINUX_SYS_linux_symlink 83
#define LINUX_SYS_stat 84
#define LINUX_SYS_ostat 84
#define LINUX_SYS_linux_readlink 85
#define LINUX_SYS_linux_uselib 86
#define LINUX_SYS_swapon 87
@ -90,7 +90,7 @@
#define LINUX_SYS_linux_mmap 90
#define LINUX_SYS_munmap 91
#define LINUX_SYS_linux_truncate 92
#define LINUX_SYS_ftruncate 93
#define LINUX_SYS_oftruncate 93
#define LINUX_SYS_fchmod 94
#define LINUX_SYS_fchown 95
#define LINUX_SYS_getpriority 96

View File

@ -91,7 +91,7 @@ struct sysent linux_sysent[] = {
{ AS(linux_setregid16_args), (sy_call_t *)linux_setregid16 }, /* 71 = linux_setregid16 */
{ AS(linux_sigsuspend_args), (sy_call_t *)linux_sigsuspend }, /* 72 = linux_sigsuspend */
{ AS(linux_sigpending_args), (sy_call_t *)linux_sigpending }, /* 73 = linux_sigpending */
{ AS(linux_sethostname_args), (sy_call_t *)linux_sethostname }, /* 74 = linux_sethostname */
{ SYF_MPSAFE | AS(sethostname_args), (sy_call_t *)osethostname }, /* 74 = osethostname */
{ AS(linux_setrlimit_args), (sy_call_t *)linux_setrlimit }, /* 75 = linux_setrlimit */
{ AS(linux_old_getrlimit_args), (sy_call_t *)linux_old_getrlimit }, /* 76 = linux_old_getrlimit */
{ AS(getrusage_args), (sy_call_t *)getrusage }, /* 77 = getrusage */
@ -101,7 +101,7 @@ struct sysent linux_sysent[] = {
{ AS(linux_setgroups16_args), (sy_call_t *)linux_setgroups16 }, /* 81 = linux_setgroups16 */
{ AS(linux_old_select_args), (sy_call_t *)linux_old_select }, /* 82 = linux_old_select */
{ AS(linux_symlink_args), (sy_call_t *)linux_symlink }, /* 83 = linux_symlink */
{ AS(stat_args), (sy_call_t *)stat }, /* 84 = stat */
{ AS(ostat_args), (sy_call_t *)ostat }, /* 84 = ostat */
{ AS(linux_readlink_args), (sy_call_t *)linux_readlink }, /* 85 = linux_readlink */
{ AS(linux_uselib_args), (sy_call_t *)linux_uselib }, /* 86 = linux_uselib */
{ AS(swapon_args), (sy_call_t *)swapon }, /* 87 = swapon */
@ -110,7 +110,7 @@ struct sysent linux_sysent[] = {
{ AS(linux_mmap_args), (sy_call_t *)linux_mmap }, /* 90 = linux_mmap */
{ AS(munmap_args), (sy_call_t *)munmap }, /* 91 = munmap */
{ AS(linux_truncate_args), (sy_call_t *)linux_truncate }, /* 92 = linux_truncate */
{ AS(ftruncate_args), (sy_call_t *)ftruncate }, /* 93 = ftruncate */
{ AS(oftruncate_args), (sy_call_t *)oftruncate }, /* 93 = oftruncate */
{ AS(fchmod_args), (sy_call_t *)fchmod }, /* 94 = fchmod */
{ AS(fchown_args), (sy_call_t *)fchown }, /* 95 = fchown */
{ AS(getpriority_args), (sy_call_t *)getpriority }, /* 96 = getpriority */

View File

@ -121,7 +121,8 @@
72 STD LINUX { int linux_sigsuspend(l_int hist0, l_int hist1, \
l_osigset_t mask); }
73 STD LINUX { int linux_sigpending(l_osigset_t *mask); }
74 STD LINUX { int linux_sethostname(char *hostname, u_int len); }
74 MNOPROTO LINUX { int osethostname(char *hostname, u_int len); } \
osethostname sethostname_args int
75 STD LINUX { int linux_setrlimit(l_uint resource, \
struct l_rlimit *rlim); }
76 STD LINUX { int linux_old_getrlimit(l_uint resource, \
@ -138,7 +139,7 @@
82 STD LINUX { int linux_old_select(struct l_old_select_argv \
*ptr); }
83 STD LINUX { int linux_symlink(char *path, char *to); }
84 NOPROTO LINUX { int stat(char *path, struct ostat *up); }
84 NOPROTO LINUX { int ostat(char *path, struct ostat *up); }
85 STD LINUX { int linux_readlink(char *name, char *buf, \
l_int count); }
86 STD LINUX { int linux_uselib(char *library); }
@ -150,7 +151,7 @@
90 STD LINUX { int linux_mmap(struct l_mmap_argv *ptr); }
91 NOPROTO LINUX { int munmap(caddr_t addr, int len); }
92 STD LINUX { int linux_truncate(char *path, l_ulong length); }
93 NOPROTO LINUX { int ftruncate(int fd, long length); }
93 NOPROTO LINUX { int oftruncate(int fd, long length); }
94 NOPROTO LINUX { int fchmod(int fd, int mode); }
95 NOPROTO LINUX { int fchown(int fd, int uid, int gid); }
96 NOPROTO LINUX { int getpriority(int which, int who); }