summaryrefslogtreecommitdiff
path: root/sys/kern/uipc_syscalls.c
AgeCommit message (Collapse)Author
2013-09-14Correct the handling of I/O of >=2^32 bytes and the ktracing there ofPhilip Guenther
by using size_t/ssize_t instead of int/u_int to handle I/O lengths in uiomove(), vn_fsizechk(), and ktrgenio(). Eliminate the always-zero 'error' argument to ktrgenio() at the same time.
2013-04-05remove some obsolete castsTed Unangst
2012-10-17In sys_accept(), don't sleep between pulling the new socket from thePhilip Guenthe
queue and calling soaccept(), so that the socket can't get torn down by a TCP RST in the middle and trigger "panic: soaccept: !NOFDREF", as seen by halex@ Analysis, original diff, and ok bluhm@
2012-05-06Change accept(), recvfrom(), recvmsg(), getsockname(), andMatthew Dempsky
getpeername() to return the untruncated address length in *addrlen instead of the number of bytes copied out. This matches POSIX's requirements and allows userland applications to detect when the returned address was truncated. ok guenther
2012-04-22Add struct proc * argument to FRELE() and FILE_SET_MATURE() inPhilip Guenthe
anticipation of further changes to closef(). No binary change. ok krw@ miod@ deraadt@
2011-12-03add support for MSG_NOSIGNAL.Federico G. Schwindt
linux bits compiled on i386 by sebastia@, mikeb@ ok
2011-10-23shorten periods of fdplock() in accept() and socket(), so that greaterTheo de Raadt
concurrency is possible in the future. discussed with guenther and matthew. ok tedu
2011-07-08Remove COMPAT_OLDSOCK since no nothing sets MSG_COMPAT anymore.Theo de Raadt
The song and dance for handling 16-bit af_family on big-endian machines remains untouched. ok claudio miod tedu guenther
2011-07-08Support sending struct info to kdump. So far for struct stat andOtto Moerbeek
struct sockaddress; mostly from freebsd. ok deraadt@ tedu@ nicm@
2011-07-08Remove the sys_opipe() kernel entry point. sys_pipe() is the future.Matthew Dempsky
While here, switch compat_linux to just use sys_pipe() rather than incorrectly wrapping sys_opipe(). ok tedu@, miod@
2011-04-04COMPAT_O47 (kernel getpeereid, which was replaced by libc getpeereid)Theo de Raadt
can go away ok guenther
2010-09-22Fix a locking bug in accept(2) caught by sthen@ using my strictMatthew Dempsky
locking diff. ok guenther@
2010-09-20Move getpeereid(2) into COMPAT_O47. In 4.8 and onwards it is libraryTheo de Raadt
code using socket options. ok matthew
2010-07-03Fix the naming of interfaces and variables for rdomains and rtablesPhilip Guenthe
and make it possible to bind sockets (including listening sockets!) to rtables and not just rdomains. This changes the name of the system calls, socket option, and ioctl. After building with this you should remove the files /usr/share/man/cat2/[gs]etrdomain.0. Since this removes the existing [gs]etrdomain() system calls, the libc major is bumped. Written by claudio@, criticized^Wcritiqued by me
2010-06-30Add getsockopt SOL_SOCKET SO_PEERCRED support. This behaves similar toTheo de Raadt
getpeereid(2), but also supplies the remote pid. This is supplied in a 'struct sockpeercred' (unlike Linux -- they showed how little they know about real unix by calling theirs 'struct ucred'). ok guenther ajacoutot
2009-12-23The process's rdomain should be, well, per-process and not per-rthread,Philip Guenthe
so put it in struct process instead of struct proc. While at it, move the p_emul member inside struct proc so that it gets copied automatically instead of requiring manual assignment. ok deraadt@
2009-11-27Add setrdomain() and getrdomain() system calls. Committing now toPhilip Guenthe
catch the libc major bump per request from deraadt@ Diff by reyk. ok guenther@
2009-11-23Replace in-line implementation of soqinsque with a call to soqinsque.Jacek Masiulaniec
"looks right" deraadt@
2009-08-10Don't use char arrays for sleep wchans and reuse them.Thordur I. Bjornsson
just use strings and make things unique. ok claudio@
2009-02-22fix PR 6082: do not create more fd's than will fit in the message onOtto Moerbeek
the receiving side when passing fd's. ok deraadt@ kettenis@
2008-12-16Move the functionality of psignal() to a new function ptsignal()Philip Guenthe
that takes an additional argument "type" that indicates whether the signal is for the process, just a particular thread, or propagated to a thread because it's not caught or blocked. psignal() becomes a wrapper that does the first of those. So that sys_kill() can tell apart signals for the process and signals for the process's original thread, the tid of the original thread is defined as its pid + THREAD_PID_OFFSET. ok tedu@ art@ andreas@ kurt@ "better early than late" deraadt@
2008-05-23Deal with the situation when TCP nfs mounts timeout and processesThordur I. Bjornsson
get hung in nfs_reconnect() because they do not have the proper privilages to bind to a socket, by adding a struct proc * argument to sobind() (and the *_usrreq() routines, and finally in{6}_pcbbind) and do the sobind() with proc0 in nfs_connect. OK markus@, blambert@. "go ahead" deraadt@. Fixes an issue reported by bernd@ (Tested by bernd@). Fixes PR5135 too.
2008-04-06In sendit(), len should be size_t, not int. Could cause it to returnStefan Kempf
wrong values on 64-bit machines otherwise. ok millert@, deraadt@
2006-10-23fix control message length check, needs CMSG_ALIGN()Henning Brauer
reported by ryo@nerv.org to netbsd, noticed by miod, ok millert
2006-10-21tbert sent me a diff to change some 0 to NULLTed Unangst
i got carried away and deleted a whole bunch of useless casts this is C, not C++. ok md5
2006-10-18Return ECONNABORTED when a non-blocking socket has been shutdown() forKurt Miller
receives. Previously a non-blocking socket would mask this error by returning EWOULDBLOCK and mislead applications to think accept() may eventually succeed. Corrects a pthreads deadlock reported by Tero Koskinen <tero.koskinen at iki.fi> okay kettenis@, theo@, markus@
2006-03-26do per file io accounting and show that in fstat as well; pedro@ marco@ okMichael Shalayeff
2006-01-05ansi/deregisterJonathan Gray
2005-07-06Eliminate a couple of 'msg.msg_iovlen < 0' tests. msg_iovlen isKenneth R Westerback
unsigned. ok millert@ deraadt@
2004-07-22remove p arg from fdplockTed Unangst
2004-04-12make sockargs take void *, combine a len check.Ted Unangst
from pedro martelletto, ok markus@
2004-04-01use NULL for ptrs. parts from Joris VinkTed Unangst
2004-01-06lock filedesc before manipulating. avoids some rare races.Ted Unangst
testing for quite some time by brad + otto
2003-09-01match syscallargs comments with realityHenning Brauer
from Patrick Latifi <patrick.l@hermes.usherb.ca> ok jason@ tedu@
2003-07-21remove caddr_t casts. it's just silly to cast something when the functionTed Unangst
takes a void *. convert uiomove to take a void * as well. ok deraadt@
2003-06-02Remove the advertising clause in the UCB license which BerkeleyTodd C. Miller
rescinded 22 July 1999. Proofed by myself and Theo.
2002-08-23Just like getvnode, make getsock FREF the file so that we can't get awayArtur Grabowski
with not refing it. Eyeballed by lurene@daemonkitty.net, fries@, nordin@ and fries@ Some additional cleanups by nordin@
2002-05-23In sys_accept don't FILE_SET_MATURE the file if we got an error and we've ↵Artur Grabowski
freed it. Noticed by enami@netbsd in a recent discussion on tech-kern@netbsd. Thanks to miod@ for helping me understand my code and realize that what the discussion was originally about (a diff by itojun@) didn't apply to us because I tweaked the semantics of closef() to solve the problem automagically for us (and I forgot about it). miod@ ok.
2002-02-12Fix my total blackout of the brain.Artur Grabowski
I rearrange half of this function to properly handle unlocking in one error case, then I forget to handle that error case. I even had a regression test written for this! In other words: fix accept(2) to unlock when it runs out of fds.
2002-02-12Fix all users of getsock to use FREF/FRELE properly.Artur Grabowski
2002-02-11In {send,recv}msg allow zero sized message. We can have control data.Artur Grabowski
2002-02-08- Rename FILE_{,UN}USE to FREF and FRELE. USE is a bad verb and we don't haveArtur Grabowski
the same semantics as NetBSD anyway, so it's good to avoid name collissions. - Always fdremove before freeing the file, not the other way around. - falloc FREFs the file. - have FILE_SET_MATURE FRELE the file (It feels like a good ortogonality to falloc FREFing the file). - Use closef as much as possible instead of ffree in error paths of falloc:ing functions. closef is much more careful with the fd and can deal with the fd being forcibly closed by dup2. Also try to avoid manually calling *fo_close when closef can do that for us (this makes some error paths mroe complicated (sys_socketpair and sys_pipe), but others become simpler (sys_open)).
2001-12-27makes a new accept() socket have the nonblock behavior.Federico G. Schwindt
slightly modified version from the original diff by theo, based on comments by niels@ and deraadt@; both ok'ed.
2001-12-02release the right descriptors when pipe fails; bug report fromNiels Provos
marcodsl@swbell.net
2001-11-28avoid "thundering herd" problem in accept by waking just one process.Niels Provos
based on freebsd. okay art@ markus@
2001-11-27change socket connection queues to use TAILQ_Niels Provos
from NetBSD: Wed Jan 7 23:47:08 1998 UTC by thorpej Make insertion and removal of sockets from the partial and incoming connections queues O(C) rather than O(N).
2001-10-26 - every new fd created by falloc() is marked as larval and should not be usedArtur Grabowski
any anyone. Every caller of falloc matures the fd when it's usable. - Since every lookup in the fd table must now check this flag and all of them do the same thing, move all the necessary checks into a function - fd_getfile.
2001-09-20occured->occurredMike Pechkin
idea from deraadt@ via NetBSD millert@ ok
2001-09-17Don't treated return length of recvfrom() as a size_t... it's a socklen_t.Jason Wright
2001-06-26implement djb's getpeereid(2), to allow local-domain servers to determine ↵Dug Song
client credentials. mostly from superscript.com. deraadt@ ok