Commit Graph

98 Commits

Author SHA1 Message Date
jdp
0cb5f57c86 Fix a couple of out-of-bounds array references in mapping between
Linux and FreeBSD signal numbers.  Also, check signal numbers passed
in from application programs for validity.  Without these checks,
it is trivial to panic the system from a Linux program.
1998-10-11 04:54:16 +00:00
jfieber
e68efb754d Make async I/O on a socket work.
Although the current Sybase license does not permit running under
emulation, FreeBSD 3.0 is now "Sybase Ready" should the license change.
1998-10-05 16:37:36 +00:00
sos
539ef73f47 In linux_newuname bzero the right type of struct (linux_newuname_t). 1998-10-05 12:40:42 +00:00
jfieber
9ea5962bb8 Add several missing ioctl handlers. One needed by Sybase, the others
found while looking for the one.
1998-09-30 01:42:53 +00:00
jkh
25eee1002c MF22: revert time bogon. 1998-09-24 13:25:43 +00:00
jkh
9300e60427 return time in proper format for linux. 1998-09-23 14:50:26 +00:00
jkh
a609b4947d Argh! *Now* the correct 3.0 fix is committed. 1998-08-31 10:53:33 +00:00
jkh
53522a7a3d Whoops! Stamp out a 2.2-ism that snuck between branches here. 1998-08-31 10:51:19 +00:00
jkh
de92572118 Initial support for using linux X servers under emulation - to use an
XFree86 server, users need to create the following links in their
/compat/linux/dev directory (assuming kernel configured with 4 VTs).

lrwxrwxrwx  1 root  wheel  7 Aug 30 22:59 tty0 -> console
lrwxrwxrwx  1 root  wheel  5 Aug 30 22:45 tty1 -> ttyv0
lrwxrwxrwx  1 root  wheel  5 Aug 30 22:45 tty2 -> ttyv1
lrwxrwxrwx  1 root  wheel  5 Aug 30 22:45 tty3 -> ttyv2
lrwxrwxrwx  1 root  wheel  5 Aug 30 22:45 tty4 -> ttyv3

VT switching is still not yet supported. Attempting to switch VT
currently will cause Xserver bus error.

Submitted by:	Chain Lee <chain@110.net>
1998-08-31 06:55:02 +00:00
bde
9841490daf Use [u]intptr_t instead of [u_]long for casts between pointers and
integers.  Don't forget to cast to (void *) as well.
1998-08-16 01:21:52 +00:00
bde
001030c3c7 Oops, the previous fix confused Linux's sigset_t with a pointer type.
It can be integral or a struct in POSIX, so it is difficult to print,
but it is actually declared as unsigned long.  Assume that it is
unsigned integral.
1998-08-15 22:29:43 +00:00
bde
cc74ac14f5 Converted the second last instance of hzto() to tvtohz().
Fixed nearby bugs (in linux_alarm()):
- the itimer for the alarm was relative to the epoch instead of relative
  to the boot time.  This was harmless because the itimer's interval is 0.
- the seconds arg was not checked for validity before converting it to a
  possibly different value.
- printf format errors.

Improvements:
Don't use splclock().  splsoftclock() suffices.  Don't complicate things
by micro-optimizing interrupt latency.

Minor improvements:
Various micro-optimizations to exploit the specialness of the alarm itimer
and the value 0.
1998-08-05 16:44:30 +00:00
bde
db1476d7dd Fixed print format errors. 1998-07-29 16:43:00 +00:00
jkh
32f3637395 Quick and dirty support for Linux's mremap. Not used by anything
but quake2 AFAIK.

Submitted by:   Luoqi Chen <luoqi@watermarkgroup.com>
1998-07-10 22:30:08 +00:00
jmg
002e169c30 remove option LINUX as it did nothing, add DEBUG_LINUX to debug the
linux emulation...

(actually moved LINUX to opt_dontuse.h)
1998-06-30 08:40:33 +00:00
dfr
92449ad5fa This commit fixes various 64bit portability problems required for
FreeBSD/alpha.  The most significant item is to change the command
argument to ioctl functions from int to u_long.  This change brings us
inline with various other BSD versions.  Driver writers may like to
use (__FreeBSD_version == 300003) to detect this change.

The prototype FreeBSD/alpha machdep will follow in a couple of days
time.
1998-06-07 17:13:14 +00:00
jkh
201edd7cf8 ".. x11amp appears to be calling shmctl(id, IPC_RMID, 0) and the emulation
layer does not like the null shmid_ds buffer pointer.  The emulation layer
returned an error without ever calling FreeBSD's shmctl, so the segments
were not being deleted when the reference count went to zero."

Submitted by:	Kevin Street <street@iname.com>
1998-06-02 12:38:31 +00:00
phk
2bea7e6614 s/nanoruntime/nanouptime/g
s/microruntime/microuptime/g

Reviewed by:	bde
1998-05-17 11:53:46 +00:00
phk
225ef02d03 Make a kernel version of the timer* functions called timerval* to be
more consistent.

OK'ed by:	bde
1998-04-06 08:26:08 +00:00
phk
1c636e681c Use microruntime() rather than doing it by hand. 1998-04-04 18:56:54 +00:00
phk
8396c1d18d Eradicate the variable "time" from the kernel, using various measures.
"time" wasn't a atomic variable, so splfoo() protection were needed
around any access to it, unless you just wanted the seconds part.

Most uses of time.tv_sec now uses the new variable time_second instead.

gettime() changed to getmicrotime(0.

Remove a couple of unneeded splfoo() protections, the new getmicrotime()
is atomic, (until Bruce sets a breakpoint in it).

A couple of places needed random data, so use read_random() instead
of mucking about with time which isn't random.

Add a new nfs_curusec() function.

Mark a couple of bogosities involving the now disappeard time variable.

Update ffs_update() to avoid the weird "== &time" checks, by fixing the
one remaining call that passwd &time as args.

Change profiling in ncr.c to use ticks instead of time.  Resolution is
the same.

Add new function "tvtohz()" to avoid the bogus "splfoo(), add time, call
hzto() which subtracts time" sequences.

Reviewed by:	bde
1998-03-30 09:56:58 +00:00
peter
3f4ac65efc The linux chown syscall is more like lchown, a new chown syscall that
follows links was added.
1998-03-29 07:59:10 +00:00
bde
878d31d269 Moved some #includes from <sys/param.h> nearer to where they are actually
used.
1998-03-28 10:33:27 +00:00
bde
43853a093f Removed redundant test against MAXDSIZ (the rlimit test is stronger). 1998-02-25 05:33:06 +00:00
msmith
9108b625e7 In the words of the submitter:
----
I've worked to enhance the connect() patches.

I've just tested this with the Linux JDK appletviewer on an applet
that does a lot of connects, and it works as well as during my
previous tests.

The connect() patch is now a merge between my older patch and the
OpenBSD stuff. It ensures that any async error is returned by
connect() instead of getsockopt(SOL_SOCKET, SO_ERROR) as reasonnable
systems do.

There are also minor patches to implement IPPROTO_TCP for
get/setsocktopt(). These are also tested (with Linux Apache).
----

I would appreciate any feedback regarding these changes, as they'd
be very useful in 2.2.6.

Submitted by:	pb@fasterix.freenix.org (Pierre Beyssac)
1998-02-07 02:13:27 +00:00
bde
66b660aec3 Changed inline' to __inline' so that this file can be compiled by
`gcc -ansi'.

Changed NULL to 0 so that this file is more self-sufficient (now
only <sys/types.h> is a prerequisite).
1998-02-03 20:14:35 +00:00
jmb
aed0becde6 sigh....forgot to update the DEBUG printf
to show both the path and the length args
	to linux emulation truncate()

Submitted by:		jmb
1998-01-05 01:17:42 +00:00
jmb
5319086203 length argument to truncate() in linux emulation
was not being set copied to the bsd arguments..
	frequently, resulting in files of over 100MB of NULs

PR:	386/5044
Reviewed by:		jmb
Submitted by:		(Richard Winkel) rich@math.missouri.edu
1998-01-05 01:05:15 +00:00
eivind
ac406a3b8c Make hidden COMPAT_43 dependencies explict. Options in headers is a
pain in the backside.
1997-12-16 18:49:23 +00:00
eivind
2ad60b3a3a Make COMPAT_43 and COMPAT_SUNOS new-style options. 1997-12-16 17:40:42 +00:00
msmith
04291f9975 As described by the submitter:
These patches enables us to play quake2 .

Support linux keyboard ioctl for setting RAW, MEDIUMRAW and XLATE.

Support linux virtual terminal operations:
 OPENQRY, GETMODE, SETMODE, GETSTATE, ACTIVATE, and WAITACTIVE.

Submitted by:	Amancio Hasty <hasty@rah.star-gate.com>
1997-12-15 06:09:11 +00:00
msmith
096e020c94 As described by the submitter:
- emulate Linux IP_HDRINCL behaviour in sendto(): byte order fixed
	  Note that we do an extra getsockopt() on every sendto()
	  to check if the option is set because we don't keep state
	  in the emulator code. Is there a better way to implement
	  this?
	- correct a bug (value of "name" not passed) with
	  getsockopt()

Submitted by:	pb@fasterix.freenix.org (Pierre Beyssac)
1997-12-14 03:17:54 +00:00
bde
c8333ea8e9 Don't include <sys/lock.h> in headers when only `struct simplelock' is
required.  Fixed everything that depended on the pollution.
1997-12-05 19:55:52 +00:00
ahasty
4e81320d9f Added support for linux sound ioctls:
LINUX_SNDCTL_DSP_GETOPTR
LINUX_SNDCTL_DSP_GETIPTR
LINUX_SNDCTL_DSP_SETTRIGGER
LINUX_SNDCTL_DSP_GETCAPS

With this rev level the linux realaudio player 5 and xquake should work.
1997-11-17 04:00:32 +00:00
phk
5f349f6779 Move the "retval" (3rd) parameter from all syscall functions and put
it in struct proc instead.

This fixes a boatload of compiler warning, and removes a lot of cruft
from the sources.

I have not removed the /*ARGSUSED*/, they will require some looking at.

libkvm, ps and other userland struct proc frobbing programs will need
recompiled.
1997-11-06 19:29:57 +00:00
kato
1dc53032d6 Securelevel and formatting fixes, and trapframe simplification.
Reviewed by:	sos
Submitted by:	bde
1997-10-30 10:53:30 +00:00
kato
d1b6d9eb5d Implement linux_iopl and linux_nice. 1997-10-29 08:17:14 +00:00
kato
e0a4484f92 Implement linux_semop, linux_semget and linux_semctl.
PR:		4355
1997-10-28 10:50:02 +00:00
gibbs
55680d2617 Update for changes in the callout interface. 1997-09-21 21:43:54 +00:00
kato
a9c3fa858b Moved include files which are independent of bs driver. 1997-08-28 09:23:57 +00:00
sos
d82e30bd08 Ops the arguments to copyin was in the wrong order..
This has survived since the first version, sigh.
1997-08-10 18:15:20 +00:00
bde
7bc215cb0b Removed unused #includes. 1997-07-20 16:06:08 +00:00
dfr
86bca521f8 Make this thing actually compile. 1997-06-02 10:43:41 +00:00
msmith
95cf85f152 Oops, remove some bogus debugging code that crept in with the last commit. 1997-06-02 06:33:22 +00:00
msmith
0583b1b939 Add support for the SIOCGIFHWADDR ioctl, commonly used by
license managers to obtain the host's ethernet address as
a key.

Note that this implementation takes the first hardware address for
the first ethernet interface found, and disregards the interface name
that may be passed in, as linux ethernet devices are all "ethX".
1997-06-02 06:31:49 +00:00
msmith
08afaf7cdf Always include PROT_READ for Linux mmap operations.
Submitted by:	Hannu Savolainen <hannu@voxware.pp.fi> via jkh
1997-04-28 02:53:17 +00:00
dfr
1ee56436b6 Remove dependancy on UFS' DIRBLKSIZ definition.
2.2 candidate.

Submitted by:	bde
1997-04-06 10:10:50 +00:00
dfr
415b2611ae Fix linux_getdents so that it can cope with filesystems which translate
the directory format (ext2fs, cd9660).  For these filesystems, it must use
cookies to find the correct offset to use for subsequent reads.  Without it,
linux /bin/ls tends to loop re-reading the same block over and over again.

2.2 candidate.
1997-04-05 14:50:56 +00:00
bde
4b6089e564 Removed potentially harmful garbage <vm/lock.h> and fixed bogus
use of it.  It was actually harmless because the use was null due
to fortuitous include orders and identical (wrong) idempotency
macros.
1997-04-01 08:39:07 +00:00
bde
78f771822e Don't include <sys/ioctl.h> in the kernel. Stage 3: include
<sys/filio.h> instead of <sys/ioctl.h> in non-network non-tty files.
1997-03-24 11:37:53 +00:00