On Wednesday, Apr 9, 2003, at 07:28 US/Pacific, Stiphane Sudre wrote: Does someone know what the purpose of soreserve is when it is used in the TCPLogger NKE communication sample code? For questions like these, the answer is UTSL! In xnu/bsd/kern/uipc_socket2.c, there is this comment, near the code for soreserve: * Before using a new socket structure it is first necessary to reserve * buffer space to the socket, by calling sbreserve(). This should commit * some of the available buffer space in the system buffer pool for the * socket (currently, it does nothing but enforce limits). The space * should be released by calling sbrelease() when the socket is destroyed. so the purpose is to check limits and reserve space (by calling sbreserve on each of the sockbuts') (:-}). And what is the meaning of the value used in it (the last 2)? As the comment says, each is a SWAG at the amount of space assumed to be needed in each sockbuf. Apropos of the 'limit' statement in the comment, note that the sockbuf limits don't involve allocation, and that the queue space they measure is a bit funky. The meaning of sockbuf limits is discussed in Stevens's TCP/IP Illustrated, V.2, and has been discussed on the darwin-development list a while back. There seems to be a bug in the NKE Documentation as the documentation is stating that the soreserve prototype is: soreserve(struct socket *, struct sockbut *); (yes, there's a typo too in the doc) when in the real world, it's not the case. Oops... The url of the buggy doc being: developer.apple.com/techpubs/macosx/Darwin/ IOKit/DeviceDrivers/Network/NKE.pdf Strangely enough, there's no man page for soreserve. How odd. I'm sure I had one when I got here. :-}. Cheers, Justin -- Justin C. Walker, Curmudgeon-At-Large * Institute for General Semantics | Some people have a mental | horizon of radius zero, and | call it their point of view. | -- David Hilbert *--------------------------------------*-------------------------------* _______________________________________________ darwin-kernel mailing list | darwin-kernel@lists.apple.com Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/darwin-kernel Do not post admin requests to the list. They will be ignored.