Commit Graph

201 Commits

Author SHA1 Message Date
fvdl a377495cfb Only free cookiebuf when sure that the vop actually allocated it. 1998-03-03 13:44:48 +00:00
fvdl e5bc90f40c Merge with Lite2 + local changes 1998-03-01 02:20:01 +00:00
mycroft 26c238db7d Linux's getsid(2) does in fact return a pid, not a pointer. 1998-02-20 18:09:04 +00:00
kleink 96f0dccbdd * Use sys___posix_{chown,fchown}() instead of sys_{chown,fchown}().
* Change reference from sys_posix_rename() to sys___posix_rename().
1998-02-14 21:57:02 +00:00
thorpej 821a4fec46 Add a comment clearly describing that Linux's getsid(2) differs from
the XPG4.2 definition in that it returns the kernel virtual address
of the session structure, rather than the process group ID of the
session leader.
1998-02-14 01:28:15 +00:00
kleink 552ec236a0 Map ENOMSG. 1998-02-10 14:37:38 +00:00
mikel 4de16acd9c update errno maps, we now have EIDRM 1998-02-06 08:26:02 +00:00
mycroft 9dd67a9098 Prototype new functions. 1998-01-24 12:39:37 +00:00
mycroft 72623d8443 Use linux_setregs(). 1998-01-24 12:32:15 +00:00
mycroft 769c9d4707 Clean this up a bit. 1998-01-22 16:33:57 +00:00
christos 05d3f8a2e9 PR/4794: Urban Boquist: Linux cdrom ioctls are missing 1998-01-15 14:52:11 +00:00
perry 3c47900572 RCSID Police. 1998-01-05 17:51:27 +00:00
fvdl af221f1c41 msync -> __msync13 1997-10-21 00:57:38 +00:00
thorpej 14cd99880c Fix the shared library versioning snafu caused by the recent changes
to the stat(2) family and msync(2).  This uses a primitive function
versioning scheme.

This reverts the libc shared library major version from 13 to 12, and
adds a few new interfaces to bring us to libc version 12.20.

From Frank van der Linden <fvdl@NetBSD.ORG>.
1997-10-20 22:05:06 +00:00
mycroft 762d77e123 Fix bogosity in mknod(2) translation. 1997-10-19 18:35:09 +00:00
christos 79acd83ca5 check for st_nlink overflow 1997-10-16 23:54:40 +00:00
fvdl d85f38cbec Fix braino in my interpretation of the eof flag to VOP_READDIR. 1997-10-10 22:16:04 +00:00
mycroft 523d84775a Emulate mremap(2) by returning ENOMEM for now. This should be sufficient for
realloc(3) and other uses.  From Matthias Scheler in PR 3920.
1997-10-10 06:25:34 +00:00
fvdl d6e5e295fa Signal error when getting a 64 bit offset cookie that can't be stored
in 32 bits. Provide an error message to the user, and return EINVAL.
Also, pay attention to the EOF flag from VOP_READDIR. Correct a
misspell in a panic message.
1997-10-10 01:42:21 +00:00
kleink c80051ee4e Add missing preparation of F_GETLK parameters in linux_sys_fcntl(); fixes PR
port-i386/4083 from Matthias Scheler <tron@lyssa.owl.de>, but vastly cleaned
up as previously suggested by myself.
1997-09-05 01:49:12 +00:00
bouyer 1cd83a5971 Fix "missing entries" bug when reading large directories: When reading a
directory and running out of space in the dest buffer, off should point to the
current entry (which was not saved) and not to the next.
I discovered this bug using linux and SunOS emulation over NFS, but seems to
affect other emulations as well.
1997-08-04 09:48:07 +00:00
augustss 9745684ebe Changes to the sudio system:
- It is now possible to handle devices that want "looping" DMA,
    e.g. the SoundBlaster correctly.  The WSS and SB drivers use this.
    To do this several new methods were introduced in audio_hw_if.
  - Different silence handling (forced by previous change).
  - The audio driver can now be mmap()-ed, but due to problems in
    the VM system only for writing for now.
  - The OSS (Linux) audio emulation takes advantage of some of the
    new features.
1997-07-27 01:16:32 +00:00
kleink 96588fead9 Use sys_posix_rename() instead of sys_rename() as it's the behaviour of the
native implementation.
1997-06-27 05:29:34 +00:00
kleink 5482ee2d93 Fixed copyin() argument botch in shmctl() IPC_STAT handling. 1997-05-08 14:33:11 +00:00
augustss bc5c0f6530 Add Linux nice() syscall. 1997-04-07 14:13:16 +00:00
augustss 32801cf383 * Move the Linux audio emulation into its own directory and rename it
OSS (aka VoxWare) audio emulation.
* Use the OSS audio emulation for Linux and FreeBSD.
* Add mixer emulation to the OSS emulator.
1997-04-04 15:35:54 +00:00
mycroft eb41ccd5fe Emulate the SOUND_PCM_WRITE_CHANNELS ioctl. From PR 3356, by Lennart
Augustsson.  Also add hooks for mixer ioctls.
1997-03-19 05:12:13 +00:00
fvdl bb31faf853 Make this compile again, including Politically Correct const handling. 1996-12-22 23:00:02 +00:00
fvdl 2452eadc60 Avoid compiler warnings when none of the SYSV* options is defined. 1996-11-15 09:51:25 +00:00
christos d551a4edf9 catch up with Jason's exec.h inclusion. 1996-10-13 18:30:05 +00:00
christos 5476886e52 printf -> kprintf, sprintf -> ksprintf 1996-10-10 17:47:29 +00:00
cgd 912e6fef44 include <sys/exec.h> rather than <machine/exec.h> 1996-10-07 21:47:33 +00:00
jtk fb2727b7e6 update to compile; needs new enum name 'Elf_sht_progbits' 1996-10-05 00:12:49 +00:00
cgd 65148dea43 kill (re)definitions of EXEC_ELF32. They're no longer necessary
(because of the EXEC_* option changes), and now cause warnings.
1996-10-03 05:02:05 +00:00
thorpej 8dd444adbd Fix a section header check that didn't get updated with the elf32/elf64
changes.  Make this compile again with the new EXEC_* options.
1996-10-03 02:16:18 +00:00
christos 76f9ea8676 Elf32_sht_progbits -> Elf_sht_progbits 1996-09-30 23:56:01 +00:00
cgd 7c3255776d slightly clean up some of the changes made when ELF64 support went in 1996-09-27 18:14:23 +00:00
cgd 9c3e274c7b adapt ELF-using compat code to use new ELF definitions/code. At this point,
these are restricted to 32-bit ELF, and should be severely cleaned.
1996-09-26 20:52:42 +00:00
mycroft a8fd25767d Define execv() and execve() consistently across emulations.
Do path name translation.
1996-09-03 03:12:17 +00:00
mycroft 118b9b478d sys/dir.h -> sys/dirent.h 1996-08-10 09:08:26 +00:00
mycroft 365a977533 Catch up with setre[ug]id() changes. 1996-06-23 11:13:32 +00:00
christos d83602c110 Simplify and add comments. 1996-06-13 19:27:01 +00:00
christos 4d9a6e0930 - Pass the Elf32_Ehdr in the linux probe function, and use it!
Since linux binaries are (mostly) always compiled with gcc, look for
the gcc signature in the .comment section header: "\0 GCC: (GNU) ".
I've changed the probe order in kern/exec_elf.c to probe for linux ELF
binaries first and fall back to SVR4 binaries. This makes statically
linked binaries work for both linux and svr4. Note that gcc-compiled
svr4 binaries, still contain the operating system signature first and
then the GCC signature, so there is no conflict. Yes this is a hack.
1996-06-13 18:42:01 +00:00
fvdl 69761c2aa8 Update list of Linux syscalls and implement the ones that are likely to be
used and doable.
1996-05-20 01:59:09 +00:00
christos 151fa70f78 Prototyping changes. 1996-04-05 00:01:10 +00:00
christos d7130e8385 - Prototyping changes
- Fix bug that gcc -Wall found in linux_sys_getpgid()
1996-04-04 23:56:01 +00:00
christos 363777341c - Add missing prototypes
- Fix bugs with reversed arguments that prototyping discovered
1996-04-04 23:51:36 +00:00
mycroft 46c087980e Add explicit return types. 1996-04-03 08:55:20 +00:00
mycroft 6bc0baa1ce Separate ioctl emulation by group. Add (minimal) audio emulation. 1996-03-08 04:55:59 +00:00
mycroft 5cdb5e8ebe Map SIOCGIFFLAGS and SIOCGIFADDR (et al). 1996-02-27 08:18:16 +00:00
mycroft 48ec0383a3 Use OSIOCGIFCONF in previous. 1996-02-27 07:25:34 +00:00
mycroft 4b2741c436 Map SIOCGIFCONF. 1996-02-27 05:51:05 +00:00
fvdl 2df1785997 msync, readv and writev were recently added to the Linux kernel; add them
to the emulation as well.
1995-12-18 14:35:08 +00:00
mycroft 9df1f90849 We don't need a private version of fork() here any more. 1995-12-09 04:01:42 +00:00
thorpej b2f1fb085b Fix transposed copyin() args, from Niklas Hallqvist <niklas@appli.se>. 1995-11-16 18:42:05 +00:00
mycroft 652c9eff74 Use cookies for directory offset, mostly from Greg Hudson. 1995-10-09 11:23:57 +00:00
fvdl 82079ba5b3 Work around calling the NetBSD fcntl(F_{G,S}ETOWN) for now; it is too
restrictive to implement the Linux equivalent (and perhaps too restrictive
overall).
1995-10-08 22:53:43 +00:00
fvdl 7292169d66 Avoid unnecessary copyin() of shmid_ds struct for shmctl(IPC_RMID) 1995-10-08 22:49:29 +00:00
mycroft 245f292fed Prefix names of system call implementation functions with `sys_'. 1995-10-07 06:25:19 +00:00
thorpej e1da0d5390 Make system calls conform to a standard prototype and bring those
prototypes into scope.
1995-09-19 22:37:27 +00:00
fvdl 788a8655bc Update offset elsewhere in linux_getdents(); still emulate a bug in
Linux, but avoid endless loops.
1995-09-13 21:51:14 +00:00
fvdl a396a097b7 Fix some bugs & typing problems. 1995-09-07 21:48:59 +00:00
fvdl d308963c5d Add a hook for MD ioctl calls, plus a couple of more changes to make
svgalib binaries work on the i386
1995-08-27 20:51:48 +00:00
fvdl 28d9d64235 Emulate some syscalls that appear in Linux 1.3: a select() with normal args,
getdents() and flock().
1995-08-23 20:17:28 +00:00
fvdl 7cd62a508c Check for status NULL argument in wait4 and waitpid. From PR #1392
by Thomas EberHardt.
1995-08-21 23:15:51 +00:00
mycroft 9a0cd13442 Implement the old and older uname(2) calls. 1995-08-21 03:42:09 +00:00
mycroft 2c03307168 If updating the timeval would make it negative, zero it instead. 1995-08-16 04:50:17 +00:00
mycroft dc41c4257e Allow bogus timevals, per Linux. 1995-08-16 04:29:49 +00:00
mycroft 54c148fda5 Convert 230400 baud. 1995-08-16 04:14:51 +00:00
fvdl 02b3c95be6 Implement the rest of the sysv ipc calls ({sem,msg}*()) 1995-08-15 21:14:32 +00:00
mycroft e9d68a777e Export bsd_to_linux_sig[], and use it. 1995-08-14 02:58:29 +00:00
mycroft 9b899c17cd Export bsd_to_linux_sig[], and use it. 1995-08-14 02:19:08 +00:00
mycroft 88b8e43a80 Rearrange #includes. 1995-08-14 01:27:43 +00:00
mycroft eba2f2e81a Move signal types into signal.h. 1995-08-14 01:11:52 +00:00
mycroft fef558efaa Convert SA_NOMASK and SA_ONESHOT.
Clean up this code a bit.
1995-08-13 22:55:28 +00:00
mycroft ad35618e1e Linux doesn't allow select(2) to be restarted. 1995-08-13 17:51:40 +00:00
fvdl 83ed983d47 mkdir() has 2 arguments.. fixes PR 1248 (from Brad Spencer) 1995-07-24 06:35:28 +00:00
fvdl 059661a991 Fix totally bogus implementation of a few fcntl() calls. I think I'll go
live on a deserted island now..
1995-07-03 21:33:59 +00:00
christos 6b95b513b0 Use compat_util.[ch]. 1995-06-24 20:20:04 +00:00
fvdl c4aaa6000c * Changed to use generic ELF code from kern/exec_elf.c (which was taken
from the svr4 exec code plus the linux compat mods)
* Include file change
* Add multicast sockopts (from John Brezak)
1995-06-22 21:34:27 +00:00
fvdl 769310e81d Linux select() returns the amount of time left before a timeout would have
occured in the timeval structure. Emulate this behavior. Reported by
Theo de Raadt.
1995-06-11 21:51:38 +00:00
fvdl fb777788b1 Don't forget to acknowledge that all the ELF stuff was taken from
Christos' svr4 code.
1995-06-11 15:15:09 +00:00
fvdl fc7cfb5f0b * Make Linux ELF binaries work. Lots of code duplication, but it will have to do
for now.
* Add a sanity check in linux_uselib
1995-06-11 14:56:47 +00:00
mycroft 1e1e52e395 Rename the dirent fields to match Linux. Make sure the requested buffer
is no larger than MAXBSIZE.
1995-06-10 22:19:06 +00:00
mycroft cc8da4254d Need netinet/tcp.h. 1995-05-28 10:20:46 +00:00
mycroft 32659780f6 Convert TCP socket options. 1995-05-28 10:16:32 +00:00
mycroft 00569bf574 Fill in `name' argument to getsockopt() correctly. 1995-05-28 09:39:45 +00:00
mycroft 116c7de730 Fix typo. 1995-05-28 08:52:07 +00:00
mycroft e89504670f Convert IP socket options. 1995-05-28 08:50:17 +00:00
mycroft fbc3ef234b Get rid of damned `static's. 1995-05-28 08:09:51 +00:00
mycroft bfd22ffde8 Generate the new ps_strings format. 1995-05-16 14:19:03 +00:00
christos 44eef7c28b - added struct emul to all emulations.
- removed all setup functions.
- added copyargs() functions where needed.
1995-04-22 19:48:19 +00:00
fvdl 623f1e3986 Handle Linux signal tramp code differently. Some changes because of the
now seperate Linux signal trampoline code. Add linux_sigreturn to
syscalls.master.
1995-04-07 22:23:22 +00:00
mycroft cd50457f15 Fix conversion of `type' and `whence' values in struct flock. 1995-04-04 04:21:30 +00:00
mycroft 6865b2589a Emulate the return value of times() better. 1995-03-22 05:24:47 +00:00
mycroft f75ba16b09 Update to use timer{add,sub}(). 1995-03-21 13:33:34 +00:00
fvdl faf1442285 Add the Linux pause() system call. Fix the arguments to sigsuspend(). 1995-03-10 22:55:04 +00:00
fvdl 9e7e8cd294 Add missing structure conversion for IPC_RMID. 1995-03-08 17:27:42 +00:00
fvdl ad4540a424 Fix typo in comment. 1995-03-08 15:17:49 +00:00
fvdl 182c23c8bc Added a few more system calls.
More consistent alternate root file semantics throughout.
1995-03-05 23:23:37 +00:00
fvdl 3bf459f350 Added Linux compat code. 1995-02-28 23:24:35 +00:00