summaryrefslogtreecommitdiffstats
path: root/sys/compat
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>1995-12-15 03:06:57 +0000
committerpeter <peter@FreeBSD.org>1995-12-15 03:06:57 +0000
commitefe4e33b175e71e1db7760bd963299b28c614238 (patch)
tree89d97bd1290f280cb93c906673b5bf6b4d8f3d24 /sys/compat
parentaa26c3750494d91e254cf0acf32198ae0cfd9d7f (diff)
downloadFreeBSD-src-efe4e33b175e71e1db7760bd963299b28c614238.zip
FreeBSD-src-efe4e33b175e71e1db7760bd963299b28c614238.tar.gz
Clean up some warnings by using the generated structures in <sys/sysproto.h>
for passing to the bsd system calls, rather than inveninting our own equivalent structures.
Diffstat (limited to 'sys/compat')
-rw-r--r--sys/compat/linux/linux_file.c30
-rw-r--r--sys/compat/linux/linux_ioctl.c28
-rw-r--r--sys/compat/linux/linux_misc.c47
-rw-r--r--sys/compat/linux/linux_signal.c20
-rw-r--r--sys/compat/linux/linux_socket.c62
5 files changed, 93 insertions, 94 deletions
diff --git a/sys/compat/linux/linux_file.c b/sys/compat/linux/linux_file.c
index 8bdb3a7..0918f22 100644
--- a/sys/compat/linux/linux_file.c
+++ b/sys/compat/linux/linux_file.c
@@ -25,7 +25,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: linux_file.c,v 1.3 1995/10/10 23:13:27 swallace Exp $
+ * $Id: linux_file.c,v 1.4 1995/11/22 07:43:45 bde Exp $
*/
#include <sys/param.h>
@@ -55,11 +55,11 @@ struct linux_creat_args {
int
linux_creat(struct proc *p, struct linux_creat_args *args, int *retval)
{
- struct {
+ struct open_args /* {
char *path;
int flags;
int mode;
- } bsd_open_args;
+ } */ bsd_open_args;
#ifdef DEBUG
printf("Linux-emul(%d): creat(%s, %d)\n",
@@ -80,11 +80,11 @@ struct linux_open_args {
int
linux_open(struct proc *p, struct linux_open_args *args, int *retval)
{
- struct {
+ struct open_args /* {
char *path;
int flags;
int mode;
- } bsd_open_args;
+ } */ bsd_open_args;
int error;
#ifdef DEBUG
@@ -189,11 +189,11 @@ int
linux_fcntl(struct proc *p, struct linux_fcntl_args *args, int *retval)
{
int error, result;
- struct fcntl_args {
+ struct fcntl_args /* {
int fd;
int cmd;
int arg;
- } fcntl_args;
+ } */ fcntl_args;
struct linux_flock linux_flock;
struct flock *bsd_flock =
(struct flock *)ua_alloc_init(sizeof(struct flock));
@@ -289,24 +289,22 @@ int
linux_lseek(struct proc *p, struct linux_lseek_args *args, int *retval)
{
- struct lseek_args {
- int fdes;
+ struct lseek_args /* {
+ int fd;
int pad;
- off_t off;
+ off_t offset;
int whence;
- } tmp_args;
- off_t tmp_retval;
+ } */ tmp_args;
int error;
#ifdef DEBUG
printf("Linux-emul(%d): lseek(%d, %d, %d)\n",
p->p_pid, args->fdes, args->off, args->whence);
#endif
- tmp_args.fdes = args->fdes;
- tmp_args.off = (off_t)args->off;
+ tmp_args.fd = args->fdes;
+ tmp_args.offset = (off_t)args->off;
tmp_args.whence = args->whence;
- error = lseek(p, &tmp_args, &tmp_retval);
- *retval = (int)tmp_retval;
+ error = lseek(p, &tmp_args, retval);
return error;
}
diff --git a/sys/compat/linux/linux_ioctl.c b/sys/compat/linux/linux_ioctl.c
index e018051..ebdc850 100644
--- a/sys/compat/linux/linux_ioctl.c
+++ b/sys/compat/linux/linux_ioctl.c
@@ -25,7 +25,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: linux_ioctl.c,v 1.1 1995/06/25 17:32:35 sos Exp $
+ * $Id: linux_ioctl.c,v 1.2 1995/11/22 07:43:46 bde Exp $
*/
#include <sys/param.h>
@@ -405,55 +405,55 @@ linux_ioctl(struct proc *p, struct linux_ioctl_args *args, int *retval)
case LINUX_TIOCGPGRP:
args->cmd = TIOCGPGRP;
- return ioctl(p, args, retval);
+ return ioctl(p, (struct ioctl_args *)args, retval);
case LINUX_TIOCSPGRP:
args->cmd = TIOCSPGRP;
- return ioctl(p, args, retval);
+ return ioctl(p, (struct ioctl_args *)args, retval);
case LINUX_TIOCGWINSZ:
args->cmd = TIOCGWINSZ;
- return ioctl(p, args, retval);
+ return ioctl(p, (struct ioctl_args *)args, retval);
case LINUX_TIOCSWINSZ:
args->cmd = TIOCSWINSZ;
- return ioctl(p, args, retval);
+ return ioctl(p, (struct ioctl_args *)args, retval);
case LINUX_FIONREAD:
args->cmd = FIONREAD;
- return ioctl(p, args, retval);
+ return ioctl(p, (struct ioctl_args *)args, retval);
case LINUX_FIONBIO:
args->cmd = FIONBIO;
- return ioctl(p, args, retval);
+ return ioctl(p, (struct ioctl_args *)args, retval);
case LINUX_FIOASYNC:
args->cmd = FIOASYNC;
- return ioctl(p, args, retval);
+ return ioctl(p, (struct ioctl_args *)args, retval);
case LINUX_FIONCLEX:
args->cmd = FIONCLEX;
- return ioctl(p, args, retval);
+ return ioctl(p, (struct ioctl_args *)args, retval);
case LINUX_FIOCLEX:
args->cmd = FIOCLEX;
- return ioctl(p, args, retval);
+ return ioctl(p, (struct ioctl_args *)args, retval);
case LINUX_TIOCEXCL:
args->cmd = TIOCEXCL;
- return ioctl(p, args, retval);
+ return ioctl(p, (struct ioctl_args *)args, retval);
case LINUX_TIOCNXCL:
args->cmd = TIOCNXCL;
- return ioctl(p, args, retval);
+ return ioctl(p, (struct ioctl_args *)args, retval);
case LINUX_TIOCCONS:
args->cmd = TIOCCONS;
- return ioctl(p, args, retval);
+ return ioctl(p, (struct ioctl_args *)args, retval);
case LINUX_TIOCNOTTY:
args->cmd = TIOCNOTTY;
- return ioctl(p, args, retval);
+ return ioctl(p, (struct ioctl_args *)args, retval);
case LINUX_TIOCSETD:
switch (args->arg) {
diff --git a/sys/compat/linux/linux_misc.c b/sys/compat/linux/linux_misc.c
index 31995c5..cce887e 100644
--- a/sys/compat/linux/linux_misc.c
+++ b/sys/compat/linux/linux_misc.c
@@ -25,7 +25,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: linux_misc.c,v 1.6 1995/12/09 08:17:24 peter Exp $
+ * $Id: linux_misc.c,v 1.7 1995/12/14 22:35:45 bde Exp $
*/
#include <sys/param.h>
@@ -74,6 +74,7 @@ int
linux_alarm(struct proc *p, struct linux_alarm_args *args, int *retval)
{
struct itimerval it, old_it;
+ struct timeval tv;
int s;
#ifdef DEBUG
@@ -85,18 +86,20 @@ linux_alarm(struct proc *p, struct linux_alarm_args *args, int *retval)
it.it_interval.tv_usec = 0;
s = splclock();
old_it = p->p_realtimer;
+ tv = time;
if (timerisset(&old_it.it_value))
- if (timercmp(&old_it.it_value, &time, <))
+ if (timercmp(&old_it.it_value, &tv, <))
timerclear(&old_it.it_value);
else
- timevalsub(&old_it.it_value, &time);
+ timevalsub(&old_it.it_value, &tv);
splx(s);
if (itimerfix(&it.it_value) || itimerfix(&it.it_interval))
return EINVAL;
s = splclock();
untimeout(realitexpire, (caddr_t)p);
+ tv = time;
if (timerisset(&it.it_value)) {
- timevaladd(&it.it_value, &time);
+ timevaladd(&it.it_value, &tv);
timeout(realitexpire, (caddr_t)p, hzto(&it.it_value));
}
p->p_realtimer = it;
@@ -141,16 +144,16 @@ linux_brk(struct proc *p, struct linux_brk_args *args, int *retval)
#else
struct vmspace *vm = p->p_vmspace;
vm_offset_t new, old;
- struct obreak_args {
- vm_offset_t newsize;
- } tmp;
+ struct obreak_args /* {
+ char * nsize;
+ } */ tmp;
#ifdef DEBUG
printf("Linux-emul(%d): brk(%08x)\n", p->p_pid, args->dsend);
#endif
old = (vm_offset_t)vm->vm_daddr + ctob(vm->vm_dsize);
new = (vm_offset_t)args->dsend;
- tmp.newsize = new;
+ tmp.nsize = (char *) new;
if (((caddr_t)new > vm->vm_daddr) && !obreak(p, &tmp, retval))
retval[0] = (int)new;
else
@@ -348,13 +351,13 @@ linux_select(struct proc *p, struct linux_select_args *args, int *retval)
fd_set *exceptfds;
struct timeval *timeout;
} linux_args;
- struct {
+ struct select_args /* {
unsigned int nd;
fd_set *in;
fd_set *ou;
fd_set *ex;
struct timeval *tv;
- } bsd_args;
+ } */ bsd_args;
int error;
if ((error = copyin((caddr_t)args->ptr, (caddr_t)&linux_args,
@@ -426,7 +429,7 @@ linux_mmap(struct proc *p, struct linux_mmap_args *args, int *retval)
int fd;
int pos;
} linux_args;
- struct {
+ struct mmap_args /* {
caddr_t addr;
size_t len;
int prot;
@@ -434,7 +437,7 @@ linux_mmap(struct proc *p, struct linux_mmap_args *args, int *retval)
int fd;
long pad;
off_t pos;
- } bsd_args;
+ } */ bsd_args;
int error;
if ((error = copyin((caddr_t)args->ptr, (caddr_t)&linux_args,
@@ -577,10 +580,10 @@ struct linux_utime_args {
int
linux_utime(struct proc *p, struct linux_utime_args *args, int *retval)
{
- struct bsd_utimes_args {
- char *fname;
+ struct utimes_args /* {
+ char *path;
struct timeval *tptr;
- } bsdutimes;
+ } */ bsdutimes;
struct timeval tv;
#ifdef DEBUG
@@ -589,7 +592,7 @@ linux_utime(struct proc *p, struct linux_utime_args *args, int *retval)
tv.tv_sec = (long)args->timeptr;
tv.tv_usec = 0;
bsdutimes.tptr = &tv;
- bsdutimes.fname = args->fname;
+ bsdutimes.path = args->fname;
return utimes(p, &bsdutimes, retval);
}
@@ -602,13 +605,12 @@ struct linux_waitpid_args {
int
linux_waitpid(struct proc *p, struct linux_waitpid_args *args, int *retval)
{
- struct wait4_args {
+ struct wait_args /* {
int pid;
int *status;
int options;
struct rusage *rusage;
- int compat;
- } tmp;
+ } */ tmp;
int error, tmpstat;
#ifdef DEBUG
@@ -619,7 +621,6 @@ linux_waitpid(struct proc *p, struct linux_waitpid_args *args, int *retval)
tmp.status = args->status;
tmp.options = args->options;
tmp.rusage = NULL;
- tmp.compat = 0;
if (error = wait4(p, &tmp, retval))
return error;
@@ -644,13 +645,12 @@ struct linux_wait4_args {
int
linux_wait4(struct proc *p, struct linux_wait4_args *args, int *retval)
{
- struct wait4_args {
+ struct wait_args /* {
int pid;
int *status;
int options;
struct rusage *rusage;
- int compat;
- } tmp;
+ } */ tmp;
int error, tmpstat;
#ifdef DEBUG
@@ -661,7 +661,6 @@ linux_wait4(struct proc *p, struct linux_wait4_args *args, int *retval)
tmp.status = args->status;
tmp.options = args->options;
tmp.rusage = args->rusage;
- tmp.compat = 0;
if (error = wait4(p, &tmp, retval))
return error;
diff --git a/sys/compat/linux/linux_signal.c b/sys/compat/linux/linux_signal.c
index 1c63681..fc5c2cd 100644
--- a/sys/compat/linux/linux_signal.c
+++ b/sys/compat/linux/linux_signal.c
@@ -25,7 +25,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: linux_signal.c,v 1.1 1995/06/25 17:32:40 sos Exp $
+ * $Id: linux_signal.c,v 1.2 1995/11/22 07:43:50 bde Exp $
*/
#include <sys/param.h>
@@ -74,11 +74,11 @@ linux_sigaction(struct proc *p, struct linux_sigaction_args *args, int *retval)
{
linux_sigaction_t linux_sa;
struct sigaction *nsa = NULL, *osa = NULL, bsd_sa;
- struct sigaction_args {
- int sig;
+ struct sigaction_args /* {
+ int signum;
struct sigaction *nsa;
struct sigaction *osa;
- } sa;
+ } */ sa;
int error;
#ifdef DEBUG
@@ -103,7 +103,7 @@ linux_sigaction(struct proc *p, struct linux_sigaction_args *args, int *retval)
if (error = copyout(&bsd_sa, nsa, sizeof(struct sigaction)))
return error;
}
- sa.sig = linux_to_bsd_signal[args->sig];
+ sa.signum = linux_to_bsd_signal[args->sig];
sa.nsa = nsa;
sa.osa = osa;
if ((error = sigaction(p, &sa, retval)))
@@ -227,12 +227,14 @@ struct linux_sigsuspend_args {
int
linux_sigsuspend(struct proc *p, struct linux_sigsuspend_args *args,int *retval)
{
- sigset_t tmp;
+ struct sigsuspend_args /* {
+ int mask;
+ } */ tmp;
#ifdef DEBUG
printf("Linux-emul(%d): sigsuspend(%08x)\n", p->p_pid, args->mask);
#endif
- tmp = linux_to_bsd_sigmask(args->mask);
+ tmp.mask = linux_to_bsd_sigmask(args->mask);
return sigsuspend(p, &tmp , retval);
}
@@ -244,10 +246,10 @@ struct linux_kill_args {
int
linux_kill(struct proc *p, struct linux_kill_args *args, int *retval)
{
- struct {
+ struct kill_args /* {
int pid;
int signum;
- } tmp;
+ } */ tmp;
#ifdef DEBUG
printf("Linux-emul(%d): kill(%d, %d)\n",
diff --git a/sys/compat/linux/linux_socket.c b/sys/compat/linux/linux_socket.c
index b803111..da4668c 100644
--- a/sys/compat/linux/linux_socket.c
+++ b/sys/compat/linux/linux_socket.c
@@ -25,7 +25,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: linux_socket.c,v 1.1 1995/06/25 17:32:41 sos Exp $
+ * $Id: linux_socket.c,v 1.2 1995/11/22 07:43:50 bde Exp $
*/
/* XXX we use functions that might not exist. */
@@ -130,11 +130,11 @@ static int
linux_socket(struct proc *p, struct linux_socket_args *args, int *retval)
{
struct linux_socket_args linux_args;
- struct {
+ struct socket_args /* {
int domain;
int type;
int protocol;
- } bsd_args;
+ } */ bsd_args;
int error;
if ((error=copyin((caddr_t)args, (caddr_t)&linux_args, sizeof(linux_args))))
@@ -157,11 +157,11 @@ static int
linux_bind(struct proc *p, struct linux_bind_args *args, int *retval)
{
struct linux_bind_args linux_args;
- struct {
+ struct bind_args /* {
int s;
caddr_t name;
int namelen;
- } bsd_args;
+ } */ bsd_args;
int error;
if ((error=copyin((caddr_t)args, (caddr_t)&linux_args, sizeof(linux_args))))
@@ -182,11 +182,11 @@ static int
linux_connect(struct proc *p, struct linux_connect_args *args, int *retval)
{
struct linux_connect_args linux_args;
- struct {
+ struct connect_args /* {
int s;
caddr_t name;
int namelen;
- } bsd_args;
+ } */ bsd_args;
int error;
if ((error=copyin((caddr_t)args, (caddr_t)&linux_args, sizeof(linux_args))))
@@ -206,10 +206,10 @@ static int
linux_listen(struct proc *p, struct linux_listen_args *args, int *retval)
{
struct linux_listen_args linux_args;
- struct {
+ struct listen_args /* {
int s;
int backlog;
- } bsd_args;
+ } */ bsd_args;
int error;
if ((error=copyin((caddr_t)args, (caddr_t)&linux_args, sizeof(linux_args))))
@@ -229,11 +229,11 @@ static int
linux_accept(struct proc *p, struct linux_accept_args *args, int *retval)
{
struct linux_accept_args linux_args;
- struct accept_args {
+ struct accept_args /* {
int s;
caddr_t name;
int *anamelen;
- } bsd_args;
+ } */ bsd_args;
int error;
if ((error=copyin((caddr_t)args, (caddr_t)&linux_args, sizeof(linux_args))))
@@ -254,11 +254,11 @@ static int
linux_getsockname(struct proc *p, struct linux_getsockname_args *args, int *retval)
{
struct linux_getsockname_args linux_args;
- struct {
+ struct getsockname_args /* {
int fdes;
caddr_t asa;
int *alen;
- } bsd_args;
+ } */ bsd_args;
int error;
if ((error=copyin((caddr_t)args, (caddr_t)&linux_args, sizeof(linux_args))))
@@ -279,11 +279,11 @@ static int
linux_getpeername(struct proc *p, struct linux_getpeername_args *args, int *retval)
{
struct linux_getpeername_args linux_args;
- struct getpeername_args {
+ struct ogetpeername_args /* {
int fdes;
caddr_t asa;
int *alen;
- } bsd_args;
+ } */ bsd_args;
int error;
if ((error=copyin((caddr_t)args, (caddr_t)&linux_args, sizeof(linux_args))))
@@ -305,12 +305,12 @@ static int
linux_socketpair(struct proc *p, struct linux_socketpair_args *args, int *retval)
{
struct linux_socketpair_args linux_args;
- struct {
+ struct socketpair_args /* {
int domain;
int type;
int protocol;
int *rsv;
- } bsd_args;
+ } */ bsd_args;
int error;
if ((error=copyin((caddr_t)args, (caddr_t)&linux_args, sizeof(linux_args))))
@@ -335,12 +335,12 @@ static int
linux_send(struct proc *p, struct linux_send_args *args, int *retval)
{
struct linux_send_args linux_args;
- struct {
+ struct osend_args /* {
int s;
caddr_t buf;
int len;
int flags;
- } bsd_args;
+ } */ bsd_args;
int error;
if ((error=copyin((caddr_t)args, (caddr_t)&linux_args, sizeof(linux_args))))
@@ -363,12 +363,12 @@ static int
linux_recv(struct proc *p, struct linux_recv_args *args, int *retval)
{
struct linux_recv_args linux_args;
- struct {
+ struct orecv_args /* {
int s;
caddr_t buf;
int len;
int flags;
- } bsd_args;
+ } */ bsd_args;
int error;
if ((error=copyin((caddr_t)args, (caddr_t)&linux_args, sizeof(linux_args))))
@@ -393,14 +393,14 @@ static int
linux_sendto(struct proc *p, struct linux_sendto_args *args, int *retval)
{
struct linux_sendto_args linux_args;
- struct {
+ struct sendto_args /* {
int s;
caddr_t buf;
size_t len;
int flags;
caddr_t to;
int tolen;
- } bsd_args;
+ } */ bsd_args;
int error;
if ((error=copyin((caddr_t)args, (caddr_t)&linux_args, sizeof(linux_args))))
@@ -427,14 +427,14 @@ static int
linux_recvfrom(struct proc *p, struct linux_recvfrom_args *args, int *retval)
{
struct linux_recvfrom_args linux_args;
- struct {
+ struct recvfrom_args /* {
int s;
caddr_t buf;
size_t len;
int flags;
caddr_t from;
int *fromlenaddr;
- } bsd_args;
+ } */ bsd_args;
int error;
if ((error=copyin((caddr_t)args, (caddr_t)&linux_args, sizeof(linux_args))))
@@ -457,10 +457,10 @@ static int
linux_shutdown(struct proc *p, struct linux_shutdown_args *args, int *retval)
{
struct linux_shutdown_args linux_args;
- struct {
+ struct shutdown_args /* {
int s;
int how;
- } bsd_args;
+ } */ bsd_args;
int error;
if ((error=copyin((caddr_t)args, (caddr_t)&linux_args, sizeof(linux_args))))
@@ -482,13 +482,13 @@ static int
linux_setsockopt(struct proc *p, struct linux_setsockopt_args *args, int *retval)
{
struct linux_setsockopt_args linux_args;
- struct {
+ struct setsockopt_args /* {
int s;
int level;
int name;
caddr_t val;
int valsize;
- } bsd_args;
+ } */ bsd_args;
int error, name;
if ((error=copyin((caddr_t)args, (caddr_t)&linux_args, sizeof(linux_args))))
@@ -525,13 +525,13 @@ static int
linux_getsockopt(struct proc *p, struct linux_getsockopt_args *args, int *retval)
{
struct linux_getsockopt_args linux_args;
- struct {
+ struct getsockopt_args /* {
int s;
int level;
int name;
caddr_t val;
int *avalsize;
- } bsd_args;
+ } */ bsd_args;
int error, name;
if ((error=copyin((caddr_t)args, (caddr_t)&linux_args, sizeof(linux_args))))
OpenPOWER on IntegriCloud