freebsd-nq/lib/libc
Diomidis Spinellis 55e24f6e77 Document an additional error return value. The connect(2) call can also
return EACCES on non-Unix domain sockets as demonstrated by the
following program:

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>

int
main(int argc, char *argv[])
{
	struct sockaddr_in rem_addr;
	int sock;

	if ((sock = socket(AF_INET, SOCK_STREAM, 0)) < 0) {
		perror("socket");
		exit(1);
	}

	bzero((char *)&rem_addr, sizeof(rem_addr));
	rem_addr.sin_family = AF_INET;
	rem_addr.sin_addr.s_addr = INADDR_NONE;
	rem_addr.sin_port = htons(10000);

	if (connect(sock, (struct sockaddr *)&rem_addr,
sizeof(rem_addr)) < 0) {
		perror("connect");
		exit(1);
	}
}

The call chain returning this value is probably:

kern/uipc_syscalls.c:connect
kern/uipc_socket.c:soconnect
netinet/tcp_usrreq.c:tcp_usr_connect
netinet/tcp_output.c:tcp_output
netinet/ip_output.c:ip_output

Reviewed by:	schweikh (mentor)
MFC after:	2 weeks
2003-07-23 22:00:08 +00:00
..
alpha Add a comment describing why it's important for the values in this 2003-05-08 13:50:44 +00:00
amd64 Instantiate explicit callable versions of the machine/ieeefp.h inlines 2003-07-22 06:46:17 +00:00
compat-43 Explain the relationship to POSIX. 2003-06-20 22:41:00 +00:00
db Fix a sizeof error in __bt_put: when writing they key and data sizes 2003-05-30 11:05:08 +00:00
gdtoa Userland spinlocks bad. Sleep locks good. 2003-06-21 08:20:14 +00:00
gen Make raise and _raise as weak symbols, so they can be overriden by 2003-07-19 05:22:56 +00:00
gmon Use C99 compatible ASM statements. 2003-06-02 02:32:22 +00:00
i386 Push the alloca #error warning farther down to play nicer with some out of 2003-06-25 19:06:40 +00:00
ia64 Implement signalcontext(). Needed by libpthread (aka libkse). 2003-06-24 05:06:42 +00:00
include Back out the `hiding' of strlcpy and strlcat. Several people 2003-05-01 19:03:14 +00:00
locale Add const to __setrunelocale prototype 2003-07-06 04:01:09 +00:00
net Remove bogus non-reentrant "temporary" implementation of gethostbyaddr_r() 2003-06-19 07:57:11 +00:00
nls Back out the `hiding' of strlcpy and strlcat. Several people 2003-05-01 19:03:14 +00:00
posix1e mdoc(7) fixes. 2003-05-24 19:53:08 +00:00
powerpc Add a comment describing why it's important for the values in this 2003-05-08 13:50:44 +00:00
quad libc_r wasn't so tied to libc for 22 months. 2002-11-18 09:50:57 +00:00
regex Eliminate 61 warnings emitted at WARNS=2 (leaving 53 to go). 2003-02-16 17:29:11 +00:00
rpc Kill prototype for __msgwrite too. It is not needed anymore. 2003-06-15 10:55:39 +00:00
sparc64 Add a comment describing why it's important for the values in this 2003-05-08 13:50:44 +00:00
stdio Add more useful cross-references to the SEE ALSO section. 2003-07-05 07:55:34 +00:00
stdlib mdoc(7) fix: Use the normal AT&T macro (.At) rather than its 2003-06-28 22:12:30 +00:00
stdtime Fixes to locale code to properly use indirect pointers in order to prevent 2003-06-13 00:14:07 +00:00
string o strmode(3) returns void not 0. 2003-07-01 15:28:05 +00:00
sys Document an additional error return value. The connect(2) call can also 2003-07-23 22:00:08 +00:00
uuid mdoc(7) police: "The .Fa argument.". 2002-12-19 09:40:28 +00:00
xdr Fix amd(8) clients, if a FreeBSD mountd(8) server is used. 2003-05-28 09:13:09 +00:00
yp Back out the `hiding' of strlcpy and strlcat. Several people 2003-05-01 19:03:14 +00:00
Makefile Axe AINC. 2003-07-01 15:07:01 +00:00