summaryrefslogtreecommitdiff
path: root/sys/compat
diff options
context:
space:
mode:
authorAlexander Leidinger <netchild@FreeBSD.org>2007-07-08 08:26:10 +0000
committerAlexander Leidinger <netchild@FreeBSD.org>2007-07-08 08:26:10 +0000
commit81871f5fc69ee04c29fafc4457221ddef3beb16e (patch)
tree16d20861dce1660634b8d2c9f869e19604f5ffff /sys/compat
parent887e9ef11b1037e94fb97fa3a22aab10c8321182 (diff)
Notes
Diffstat (limited to 'sys/compat')
-rw-r--r--sys/compat/linprocfs/linprocfs.c10
-rw-r--r--sys/compat/linux/linux_file.c1
-rw-r--r--sys/compat/linux/linux_getcwd.c2
-rw-r--r--sys/compat/linux/linux_misc.c17
-rw-r--r--sys/compat/linux/linux_socket.c4
-rw-r--r--sys/compat/linux/linux_uid16.c7
6 files changed, 24 insertions, 17 deletions
diff --git a/sys/compat/linprocfs/linprocfs.c b/sys/compat/linprocfs/linprocfs.c
index 344ecd83a8ae..a2ca011d0653 100644
--- a/sys/compat/linprocfs/linprocfs.c
+++ b/sys/compat/linprocfs/linprocfs.c
@@ -517,6 +517,7 @@ linprocfs_doversion(PFS_FILL_ARGS)
static int
linprocfs_doloadavg(PFS_FILL_ARGS)
{
+
sbuf_printf(sb,
"%d.%02d %d.%02d %d.%02d %d/%d %d\n",
(int)(averunnable.ldavg[0] / averunnable.fscale),
@@ -529,7 +530,6 @@ linprocfs_doloadavg(PFS_FILL_ARGS)
nprocs, /* number of tasks */
lastpid /* the last pid */
);
-
return (0);
}
@@ -858,8 +858,8 @@ linprocfs_doproccmdline(PFS_FILL_ARGS)
static int
linprocfs_doprocenviron(PFS_FILL_ARGS)
{
- sbuf_printf(sb, "doprocenviron\n%c", '\0');
+ sbuf_printf(sb, "doprocenviron\n%c", '\0');
return (0);
}
@@ -937,9 +937,9 @@ linprocfs_doprocmaps(PFS_FILL_ARGS)
ref_count = 0;
shadow_count = 0;
}
-
+
/*
- * format:
+ * format:
* start, end, access, offset, major, minor, inode, name.
*/
snprintf(mebuffer, sizeof mebuffer,
@@ -1017,6 +1017,7 @@ linprocfs_doscsidevinfo(PFS_FILL_ARGS)
static int
linprocfs_doscsiscsi(PFS_FILL_ARGS)
{
+
return (0);
}
@@ -1046,6 +1047,7 @@ linprocfs_dodevices(PFS_FILL_ARGS)
static int
linprocfs_docmdline(PFS_FILL_ARGS)
{
+
sbuf_printf(sb, "BOOT_IMAGE=%s", kernelname);
sbuf_printf(sb, " ro root=302\n");
return (0);
diff --git a/sys/compat/linux/linux_file.c b/sys/compat/linux/linux_file.c
index 1c5419fddb9f..84195c1f4097 100644
--- a/sys/compat/linux/linux_file.c
+++ b/sys/compat/linux/linux_file.c
@@ -495,6 +495,7 @@ linux_access(struct thread *td, struct linux_access_args *args)
#endif
error = kern_access(td, path, UIO_SYSSPACE, args->flags);
LFREEPATH(path);
+
return (error);
}
diff --git a/sys/compat/linux/linux_getcwd.c b/sys/compat/linux/linux_getcwd.c
index d79d33139808..2835d5c51bdb 100644
--- a/sys/compat/linux/linux_getcwd.c
+++ b/sys/compat/linux/linux_getcwd.c
@@ -386,7 +386,7 @@ linux_getcwd_common (lvp, rvp, bpp, bufp, limit, flags, td)
error = linux_getcwd_scandir(&lvp, &uvp, &bp, bufp, td);
if (error)
goto out;
-#if DIAGNOSTIC
+#ifdef DIAGNOSTIC
if (lvp != NULL)
panic("getcwd: oops, forgot to null lvp");
if (bufp && (bp <= bufp)) {
diff --git a/sys/compat/linux/linux_misc.c b/sys/compat/linux/linux_misc.c
index cbd5c24cc4da..23c26167af8f 100644
--- a/sys/compat/linux/linux_misc.c
+++ b/sys/compat/linux/linux_misc.c
@@ -155,7 +155,7 @@ linux_sysinfo(struct thread *td, struct linux_sysinfo_args *args)
sysinfo.bufferram = 0;
swap_pager_status(&i, &j);
- sysinfo.totalswap= i * PAGE_SIZE;
+ sysinfo.totalswap = i * PAGE_SIZE;
sysinfo.freeswap = (i - j) * PAGE_SIZE;
sysinfo.procs = nprocs;
@@ -215,7 +215,7 @@ linux_brk(struct thread *td, struct linux_brk_args *args)
#endif
old = (vm_offset_t)vm->vm_daddr + ctob(vm->vm_dsize);
new = (vm_offset_t)args->dsend;
- tmp.nsize = (char *) new;
+ tmp.nsize = (char *)new;
if (((caddr_t)new > vm->vm_daddr) && !obreak(td, &tmp))
td->td_retval[0] = (long)new;
else
@@ -291,6 +291,7 @@ linux_uselib(struct thread *td, struct linux_uselib_args *args)
if ((vp->v_mount->mnt_flag & MNT_NOEXEC) ||
((attr.va_mode & 0111) == 0) || (attr.va_type != VREG)) {
+ /* EACCESS is what exec(2) returns. */
error = ENOEXEC;
goto cleanup;
}
@@ -343,10 +344,10 @@ linux_uselib(struct thread *td, struct linux_uselib_args *args)
/* Set file/virtual offset based on a.out variant. */
switch ((int)(a_out->a_magic & 0xffff)) {
- case 0413: /* ZMAGIC */
+ case 0413: /* ZMAGIC */
file_offset = 1024;
break;
- case 0314: /* QMAGIC */
+ case 0314: /* QMAGIC */
file_offset = 0;
break;
default:
@@ -446,8 +447,8 @@ linux_uselib(struct thread *td, struct linux_uselib_args *args)
goto cleanup;
}
#ifdef DEBUG
- printf("mem=%08lx = %08lx %08lx\n", (long)vmaddr, ((long*)vmaddr)[0],
- ((long*)vmaddr)[1]);
+ printf("mem=%08lx = %08lx %08lx\n", (long)vmaddr, ((long *)vmaddr)[0],
+ ((long *)vmaddr)[1]);
#endif
if (bss_size != 0) {
/* Calculate BSS start address */
@@ -728,6 +729,7 @@ linux_newuname(struct thread *td, struct linux_newuname_args *args)
#ifdef __i386__
{
const char *class;
+
switch (cpu_class) {
case CPUCLASS_686:
class = "i686";
@@ -1047,8 +1049,7 @@ linux_setgroups(struct thread *td, struct linux_setgroups_args *args)
bsd_gidset[ngrp + 1] = linux_gidset[ngrp];
ngrp--;
}
- }
- else
+ } else
newcred->cr_ngroups = 1;
setsugid(p);
diff --git a/sys/compat/linux/linux_socket.c b/sys/compat/linux/linux_socket.c
index ce1135c25d73..1472d396136c 100644
--- a/sys/compat/linux/linux_socket.c
+++ b/sys/compat/linux/linux_socket.c
@@ -615,6 +615,10 @@ linux_connect(struct thread *td, struct linux_connect_args *args)
* Linux doesn't return EISCONN the first time it occurs,
* when on a non-blocking socket. Instead it returns the
* error getsockopt(SOL_SOCKET, SO_ERROR) would return on BSD.
+ *
+ * XXXRW: Instead of using fgetsock(), check that it is a
+ * socket and use the file descriptor reference instead of
+ * creating a new one.
*/
NET_LOCK_GIANT();
error = fgetsock(td, linux_args.s, &so, &fflag);
diff --git a/sys/compat/linux/linux_uid16.c b/sys/compat/linux/linux_uid16.c
index 52a6df288148..c16a7d448b98 100644
--- a/sys/compat/linux/linux_uid16.c
+++ b/sys/compat/linux/linux_uid16.c
@@ -197,10 +197,9 @@ linux_getgroups16(struct thread *td, struct linux_getgroups16_args *args)
/*
* The FreeBSD native getgid(2) and getuid(2) also modify td->td_retval[1]
- * when COMPAT_43 is defined. This globbers registers that
- * are assumed to be preserved. The following lightweight syscalls fixes
- * this. See also linux_getpid(2), linux_getgid(2) and linux_getuid(2) in
- * linux_misc.c
+ * when COMPAT_43 is defined. This clobbers registers that are assumed to
+ * be preserved. The following lightweight syscalls fixes this. See also
+ * linux_getpid(2), linux_getgid(2) and linux_getuid(2) in linux_misc.c
*
* linux_getgid16() - MP SAFE
* linux_getuid16() - MP SAFE