summaryrefslogtreecommitdiff
path: root/sys/kern/uipc_usrreq.c
AgeCommit message (Collapse)Author
2006-02-27Do not stupidly panic but return ENOTCONN when trying to pass fds on anMiod Vallat
unconnected socket; reported by Christian Biere <christianbiere at gmx dot de> ok claudio@ deraadt@
2006-01-05ansi/deregisterJonathan Gray
2005-05-17under some circunstances, unp_scan() can call unp_mark() with a null pointer,Federico G. Schwindt
so check fp before dereferencing it; fixes a crash found by hshoexer@ with input from art@, art@ millert@ deraadt@ ok.
2004-07-22remove p arg from fdplockTed Unangst
2004-06-24This moves access to wall and uptime variables in MI code,Thorsten Lockert
encapsulating all such access into wall-defined functions that makes sure locking is done as needed. It also cleans up some uses of wall time vs. uptime some places, but there is sure to be more of these needed as well, particularily in MD code. Also, many current calls to microtime() should probably be changed to getmicrotime(), or to the {,get}microuptime() versions. ok art@ deraadt@ aaron@ matthieu@ beck@ sturm@ millert@ others "Oh, that is not your problem!" from miod@
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-08-17unused varTed Unangst
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-23Use LIST_ macros for the list of all struct file.Artur Grabowski
2002-03-14First round of __P removal in sysTodd C. Miller
2002-02-19Heh. Don't assume that sizeof(void *) > sizeof(int).Artur Grabowski
2002-02-11Big fixup of fd passing. It now works, even on sparc64.Artur Grabowski
Some parts from NetBSD, but with big modifications.
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)).
2002-02-05Add counting of temporary references to a struct file (as opposed to referencesArtur Grabowski
from fd tables and other long-lived objects). This is to avoid races between using a file descriptor and having another process (with shared fd table) close it. We use a separate refence count so that error values from close(2) will be correctly returned to the caller of close(2). The macros for those reference counts are FILE_USE(fp) and FILE_UNUSE(fp). Make sure that the cases where closef can be called "incorrectly" (most notably dup2(2)) are handled. Right now only callers of closef (and {,p}read) use FILE_{,UN}USE correctly, more fixes incoming soon.
2002-02-02Be more consistent about using fd_getfile where it matters.Artur Grabowski
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-10-26 - split fdalloc into two functions. fdalloc now returns ENOSPC if itArtur Grabowski
would have to grow the table and fdexpand that grows the table. Since fdexpand can sleep we have to restart all operations if we have to call it. - dup2 changed so that finishdup frees the destination descriptor. - unp_externalize is a completly rewritten version from NetBSD. Changes mostly inspired by NetBSD.
2001-06-26implement djb's getpeereid(2), to allow local-domain servers to determine ↵Dug Song
client credentials. mostly from superscript.com. deraadt@ ok
2001-04-06Move offsetof define into sys/param.hConstantine Sapuntzakis
1999-10-11for AF_UNIX, do not follow symlinks when creating sockets, terminateTheo de Raadt
names more carefully; art
1999-02-05Check that a socket we're closing is really a socket. dillon@freebsdAngelos D. Keromytis
1998-03-01crank f_count/f_msgcount to long; when incrementing try to leave 2 slotsTheo de Raadt
empty for unp_gc() in case of cross referenced sockets. part by millert
1997-11-17kleink: When fstat(2)ing a file descriptor of a local communications domainTheo de Raadt
socket, fill the socket's creation time into the stat structure's st_[acm]time fields: POSIX requires this behavior for pipe(2). N.B.: updating the st_[am]time fields when reading/writing the pipe is neither required nor implemented, though.
1997-11-06Updates for VFS Lite 2 + soft update.Constantine Sapuntzakis
1997-10-06back out vfs lite2 till after 2.2Theo de Raadt
1997-10-06VFS Lite2 ChangesConstantine Sapuntzakis
1997-06-05fix sendmsg() credential passing on 64 bit machines, i hope. (this was hellish)Theo de Raadt
1996-06-25consider umask for AF_UNIX bind()Theo de Raadt
1996-03-03From NetBSD: 960217 mergeNiklas Hallqvist
1995-10-18initial import of NetBSD treeTheo de Raadt