summaryrefslogtreecommitdiffstats
path: root/sys/compat/linux/linux_socket.c
Commit message (Collapse)AuthorAgeFilesLines
* Quick fix for LINT breakage caused by interface changes in accept(2), etc.bde2003-12-251-33/+36
| | | | | | | | | | | | | | | | | | | The log message for rev.1.160 of kern/uipc_syscalls.c and associated changes only claimed to add restrict qualifiers (which have no effect in the kernel so they probably shouldn't be added), but the following interface changes were also made: - caddr_t to `void *' and `struct sockaddr_t *' - `int *' to `socklen_t *'. These interface changes are not quite null, and this fix is quick (like the changes in uipc_syscalls 1.160) because it uses bogus casts instead of complete bounds-checked conversions. Things should be fixed better when the conversions can be done without using the stack gap. linux_check_hdrincl() already uses the stack gap and is fixed completely though the type mismatches in it were not fatal (there were only fatal type mismatches from unopaquing pointers to [o]sockaddr't's -- the difference between accept()'s args and oaccept()'s args is now non-opaque, but this is not reflected in their args structs).
* Use kern_sendit rather than sendit for the Linux send* syscalls.dwmalone2003-11-091-144/+105
| | | | | This means we can avoid using the stack gap for most send* syscalls now (it is still used in the IP_HDRINCL case).
* Fix some problems in linux_sendmsg() and linux_recvmsg().iwasaki2003-10-111-36/+38
| | | | | | | | | | | - Allocate storage for uap->msg always because it is copyin()'ed in native sendmsg(). - Convert sockopt level from Linux to FreeBSD after native recvmsg() calling. - Some cleanups. Tested with: Oracle 9i shared server connection mode. MFC after: 1 week
* Use __FBSDID().obrien2003-06-101-2/+3
|
* Deprecate machine/limits.h in favor of new sys/limits.h.kan2003-04-291-2/+1
| | | | | | | Change all in-tree consumers to include <sys/limits.h> Discussed on: standards@ Partially submitted by: Craig Rodrigues <rodrigc@attbi.com>
* Clean up whitespace and remove register keyword.des2003-03-031-2/+2
|
* More caddr_t removal, in conjunction with copy{in,out}(9) this time.des2003-03-031-4/+4
| | | | Also clean up some egregious casts and incorrect use of sizeof.
* Add M_WAITOKume2003-02-201-1/+1
|
* 1) Linux_sendto was trashing the BSD sockaddr it put in the stackgap,dwmalone2003-02-081-14/+15
| | | | | | | | | | | | | | | so be more careful about calling stackgap_init. Tested by: Fred Souza <fred@storming.org> 2) Linux_sendmsg was forgetting to fill out the bsd_args struct. Reviewed by: ume 3) The args to linux_connect have differently named types on alpha and i386, so add a cast to stop gcc complaining. Spotted by: peter
* Avoid undefined symbol error with an IPv4 only kernel.ume2003-02-051-1/+9
| | | | Reported by: "Sergey A. Osokin" <osa@freebsd.org.ru>
* Add IPv6 support for Linuxlator.ume2003-02-031-88/+372
| | | | | Reviewed by: dwmalone MFC after: 10 days
* Back out last commit. Linux uses the old 4.3BSD sockaddr format.mini2002-09-241-19/+11
|
* Don't use compatability syscall wrappers in emulation code.mini2002-09-231-11/+19
| | | | | | This is needed for the COMPAT_FREEBSD3 option split. Reviewed by: alfred, jake
* Fix typo in the BSD copyright: s/withough/without/schweikh2002-06-021-1/+1
| | | | | Spotted and suggested by: des MFC after: 3 weeks
* Fix missing holdsock()->fgetsock()dillon2001-11-171-7/+5
| | | | Submitted by: Hisashi Hiramoto <hiramoto@phys.chs.nihon-u.ac.jp>
* Force the length of the sockaddr to be correct for AF_INET and AF_INET6fenner2001-10-261-2/+23
| | | | | | in bind() and connect(). Linux doesn't care if the length of the sockaddr matches its address family; FreeBSD does. This fixes the known issues with the resolver in linux_base-7.
* KSE Milestone 2julian2001-09-121-65/+65
| | | | | | | | | | | | | | Note ALL MODULES MUST BE RECOMPILED make the kernel aware that there are smaller units of scheduling than the process. (but only allow one thread per process at this time). This is functionally equivalent to teh previousl -current except that there is a thread associated with each process. Sorry john! (your next MFC will be a doosie!) Reviewed by: peter@freebsd.org, dillon@freebsd.org X-MFC after: ha ha ha ha
* Round of cleanups and enhancements. These include (in random order):marcel2001-09-081-19/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | o Introduce private types for use in linux syscalls for two reasons: 1. establish type independence for ease in porting and, 2. provide a visual queue as to which syscalls have proper prototypes to further cleanup the i386/alpha split. Linuxulator types are prefixed by 'l_'. void and char have not been "virtualized". o Provide dummy functions for all syscalls and remove dummy functions or implementations of truely obsolete syscalls. o Sanitize the shm*, sem* and msg* syscalls. o Make a first attempt to implement the linux_sysctl syscall. At this time it only returns one MIB (KERN_VERSION), but most importantly, it tells us when we need to add additional sysctls :-) o Bump the kenel version up to 2.4.2 (this is not the same as the KERN_VERSION MIB, BTW). o Implement new syscalls, of which most are specific to i386. Our syscall table is now up to date with Linux 2.4.2. Some highlights: - Implement the 32-bit uid_t and gid_t bases syscalls. - Implement a couple of 64-bit file size/offset bases syscalls. o Fix or improve numerous syscalls and prototypes. o Reduce style(9) violations while I'm here. Especially indentation inconsistencies within the same file are addressed. Re-indenting did not obfuscate actual changes to the extend that it could not be combined. NOTE: I spend some time testing these changes and found that if there were regressions, they were not caused by these changes AFAICT. It was observed that installing a RH 7.1 runtime environment did make matters worse. Hangs and/or reboots have been observed with and without these changes, so when it failed to make life better in cases it doesn't look like it made it worse.
* Only pick up so_error the first time through with EISCONN, as advertised.jlemon2001-03-021-1/+1
| | | | | | The sense of the test was reversed, so we were returning EISCONN, then 0. Pointed out and tested by: Martin Blapp <mb@imp.ch>
* Correctly emulate linux_connect. For nonblocking sockets, the behaviorjlemon2001-03-011-51/+21
| | | | | | | | is to return EINPROGRESS, EALREADY, (so_error ONCE), EISCONN. Certain linux applications rely on the so_error (normally 0) being returned in order to operate properly. Tested by: Thomas Moestl <tmoestl@gmx.net>
* translate the flags in recvfrom and recvmsg from linux to bsd onesassar2000-12-191-2/+69
| | | | Approved by: marcel
* Don't auto-generate the syscalls.marcel2000-12-031-4/+0
|
* Use the linux_connect() on alpha rather than passing directly throughgallatin2000-11-161-1/+9
| | | | | | | | | | to our native connect(). This is required to deal with the differences in the way linux handles connects on non-blocking sockets. This gets the private beta of the Compaq Linux/alpha JDK working on FreeBSD/alpha Approved by: marcel
* Revert auto-generation. The Alpha port is broken.marcel2000-11-101-0/+4
| | | | Syncing with it is wrong.
* Sync with Alpha:marcel2000-11-091-4/+0
| | | | | Do not use sysent.c, proto.h and syscall.h in source tree; use auto-generated versions.
* The MI/MD split wasn't perfect and the MI files need hacks for theobrien2000-11-011-0/+6
| | | | | | AlphaLinux compat bits. This will be better cleaned up soon. Agreed to what ever was necessary by: marcel
* Whitespace change: (near) KNFmarcel2000-08-261-649/+679
|
* Update include directives.marcel2000-08-221-3/+3
|
* Fix accept(2) behavior in that accepted sockets don't inherit themarcel2000-02-281-1/+20
| | | | | | | | | | | | parents flags. Note on the PR: The PR contains another patch that's not being committed without further background information. The PR stays open for now. PR: 16946 (Victor A. Salaman <salaman@teknos.com>) Prompted by: msmith Indirect/implicit approval: jkh (shoot me if I'm wrong :-)
* $Id$ -> $FreeBSD$peter1999-08-281-1/+1
|
* Fix linux sendmsg() emulationmsmith1999-01-111-2/+35
| | | | Submitted by: Brian Feldman <green@unixhelp.org>
* Commit patch insos1998-12-301-1/+6
| | | | | PR: 9232 Submitted by: marcel@scc.nl <Marcel Moolenaar>
* Moved some #includes from <sys/param.h> nearer to where they are actuallybde1998-03-281-1/+2
| | | | used.
* In the words of the submitter:msmith1998-02-071-2/+62
| | | | | | | | | | | | | | | | | | | | | | | ---- 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)
* Make COMPAT_43 and COMPAT_SUNOS new-style options.eivind1997-12-161-2/+6
|
* As described by the submitter:msmith1997-12-141-2/+147
| | | | | | | | | | | | - 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)
* Move the "retval" (3rd) parameter from all syscall functions and putphk1997-11-061-47/+47
| | | | | | | | | | | | 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.
* Removed unused #includes.bde1997-07-201-3/+1
|
* Back out part 1 of the MCFH that changed $Id$ to $FreeBSD$. We are notpeter1997-02-221-1/+1
| | | | ready for it yet.
* Make the long-awaited change from $Id$ to $FreeBSD$jkh1997-01-141-1/+1
| | | | | | | | This will make a number of things easier in the future, as well as (finally!) avoiding the Id-smashing problem which has plagued developers for so long. Boy, I'm glad we're not using sup anymore. This update would have been insane otherwise.
* Add IP_OPTIONS and the multicast-related setsockopts to thefenner1996-12-031-1/+14
| | | | | | | | | | | list of IP setsockopts the Linux emulator recognizes. Explicitly disallow IP_HDRINCL since Linux's handling of raw output is different than BSD's. Closes PR#kern/2111. Submitted by: y-nakaga@ccs.mt.nec.co.jp (Yoshihisa NAKAGAWA)
* Mega-commit for Linux emulator update.. This has been stress tested underpeter1996-03-021-7/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | netscape-2.0 for Linux running all the Java stuff. The scrollbars are now working, at least on my machine. (whew! :-) I'm uncomfortable with the size of this commit, but it's too inter-dependant to easily seperate out. The main changes: COMPAT_LINUX is *GONE*. Most of the code has been moved out of the i386 machine dependent section into the linux emulator itself. The int 0x80 syscall code was almost identical to the lcall 7,0 code and a minor tweak allows them to both be used with the same C code. All kernels can now just modload the lkm and it'll DTRT without having to rebuild the kernel first. Like IBCS2, you can statically compile it in with "options LINUX". A pile of new syscalls implemented, including getdents(), llseek(), readv(), writev(), msync(), personality(). The Linux-ELF libraries want to use some of these. linux_select() now obeys Linux semantics, ie: returns the time remaining of the timeout value rather than leaving it the original value. Quite a few bugs removed, including incorrect arguments being used in syscalls.. eg: mixups between passing the sigset as an int, vs passing it as a pointer and doing a copyin(), missing return values, unhandled cases, SIOC* ioctls, etc. The build for the code has changed. i386/conf/files now knows how to build linux_genassym and generate linux_assym.h on the fly. Supporting changes elsewhere in the kernel: The user-mode signal trampoline has moved from the U area to immediately below the top of the stack (below PS_STRINGS). This allows the different binary emulations to have their own signal trampoline code (which gets rid of the hardwired syscall 103 (sigreturn on BSD, syslog on Linux)) and so that the emulator can provide the exact "struct sigcontext *" argument to the program's signal handlers. The sigstack's "ss_flags" now uses SS_DISABLE and SS_ONSTACK flags, which have the same values as the re-used SA_DISABLE and SA_ONSTACK which are intended for sigaction only. This enables the support of a SA_RESETHAND flag to sigaction to implement the gross SYSV and Linux SA_ONESHOT signal semantics where the signal handler is reset when it's triggered. makesyscalls.sh no longer appends the struct sysentvec on the end of the generated init_sysent.c code. It's a lot saner to have it in a seperate file rather than trying to update the structure inside the awk script. :-) At exec time, the dozen bytes or so of signal trampoline code are copied to the top of the user's stack, rather than obtaining the trampoline code the old way by getting a clone of the parent's user area. This allows Linux and native binaries to freely exec each other without getting trampolines mixed up.
* Clean up some warnings by using the generated structures in <sys/sysproto.h>peter1995-12-151-31/+31
| | | | | for passing to the bsd system calls, rather than inveninting our own equivalent structures.
* Completed function declarations and added prototypes.bde1995-11-221-2/+8
| | | | | | Removed some unnecessary #includes. Fixed warnings about nested externs.
* First incarnation of our Linux emulator or rather compatibility code.sos1995-06-251-0/+595
This first shot only incorporaties so much functionality that DOOM can run (the X version), signal handling is VERY weak, so is many other things. But it meets my milestone number one (you guessed it - running DOOM). Uses /compat/linux as prefix for loading shared libs, so it won't conflict with our own libs. Kernel must be compiled with "options COMPAT_LINUX" for this to work.
OpenPOWER on IntegriCloud