#, fuzzy msgid "" msgstr "" "Project-Id-Version: man-pages-l10n VERSION\n" "POT-Creation-Date: 2014-07-17 17:53+0900\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #. type: TH #: man-pages/man2/bind.2:68 #, no-wrap msgid "BIND" msgstr "" #. type: TH #: man-pages/man2/bind.2:68 #, no-wrap msgid "2014-05-10" msgstr "" #. type: TH #: man-pages/man2/bind.2:68 #, no-wrap msgid "Linux" msgstr "" #. type: TH #: man-pages/man2/bind.2:68 #, no-wrap msgid "Linux Programmer's Manual" msgstr "" #. type: SH #: man-pages/man2/bind.2:69 #, no-wrap msgid "NAME" msgstr "" #. type: Plain text #: man-pages/man2/bind.2:71 msgid "bind - bind a name to a socket" msgstr "" #. type: SH #: man-pages/man2/bind.2:71 #, no-wrap msgid "SYNOPSIS" msgstr "" #. type: Plain text #: man-pages/man2/bind.2:75 #, no-wrap msgid "" "B<#include Esys/types.hE> /* See NOTES */\n" "B<#include Esys/socket.hE>\n" msgstr "" #. type: Plain text #: man-pages/man2/bind.2:78 #, no-wrap msgid "" "BIB<, const struct sockaddr *>IB<,>\n" "B< socklen_t >IB<);>\n" msgstr "" #. type: SH #: man-pages/man2/bind.2:79 #, no-wrap msgid "DESCRIPTION" msgstr "" #. type: Plain text #: man-pages/man2/bind.2:92 msgid "" "When a socket is created with B(2), it exists in a name space " "(address family) but has no address assigned to it. B() assigns the " "address specified by I to the socket referred to by the file " "descriptor I. I specifies the size, in bytes, of the " "address structure pointed to by I. Traditionally, this operation is " "called \\(lqassigning a name to a socket\\(rq." msgstr "" #. type: Plain text #: man-pages/man2/bind.2:99 msgid "" "It is normally necessary to assign a local address using B() before a " "B socket may receive connections (see B(2))." msgstr "" #. type: Plain text #: man-pages/man2/bind.2:130 msgid "" "The rules used in name binding vary between address families. Consult the " "manual entries in Section 7 for detailed information. For B see " "B(7), for B see B(7), for B see B(7), for " "B see B(7), for B see B(7), for " "B see B(7) and for B see B(7)." msgstr "" #. type: Plain text #: man-pages/man2/bind.2:137 msgid "" "The actual structure passed for the I argument will depend on the " "address family. The I structure is defined as something like:" msgstr "" #. type: Plain text #: man-pages/man2/bind.2:144 #, no-wrap msgid "" "struct sockaddr {\n" " sa_family_t sa_family;\n" " char sa_data[14];\n" "}\n" msgstr "" #. type: Plain text #: man-pages/man2/bind.2:152 msgid "" "The only purpose of this structure is to cast the structure pointer passed " "in I in order to avoid compiler warnings. See EXAMPLE below." msgstr "" #. type: SH #: man-pages/man2/bind.2:152 #, no-wrap msgid "RETURN VALUE" msgstr "" #. type: Plain text #: man-pages/man2/bind.2:157 msgid "" "On success, zero is returned. On error, -1 is returned, and I is set " "appropriately." msgstr "" #. type: SH #: man-pages/man2/bind.2:157 #, no-wrap msgid "ERRORS" msgstr "" #. type: TP #: man-pages/man2/bind.2:158 man-pages/man2/bind.2:193 #, no-wrap msgid "B" msgstr "" #. e.g., privileged port in AF_INET domain #. type: Plain text #: man-pages/man2/bind.2:162 msgid "The address is protected, and the user is not the superuser." msgstr "" #. type: TP #: man-pages/man2/bind.2:162 man-pages/man2/bind.2:165 #, no-wrap msgid "B" msgstr "" #. type: Plain text #: man-pages/man2/bind.2:165 msgid "The given address is already in use." msgstr "" #. type: Plain text #: man-pages/man2/bind.2:175 msgid "" "(Internet domain sockets) The port number was specified as zero in the " "socket address structure, but, upon attempting to bind to an ephemeral port, " "it was determined that all port numbers in the ephemeral port range are " "currently in use. See the discussion of I B(7)." msgstr "" #. type: TP #: man-pages/man2/bind.2:176 #, no-wrap msgid "B" msgstr "" #. type: Plain text #: man-pages/man2/bind.2:180 msgid "I is not a valid descriptor." msgstr "" #. type: TP #: man-pages/man2/bind.2:180 man-pages/man2/bind.2:206 #, no-wrap msgid "B" msgstr "" #. This may change in the future: see #. .I linux/unix/sock.c for details. #. type: Plain text #: man-pages/man2/bind.2:185 msgid "The socket is already bound to an address." msgstr "" #. type: TP #: man-pages/man2/bind.2:185 #, no-wrap msgid "B" msgstr "" #. type: Plain text #: man-pages/man2/bind.2:189 msgid "I is a descriptor for a file, not a socket." msgstr "" #. type: Plain text #: man-pages/man2/bind.2:193 msgid "" "The following errors are specific to UNIX domain (B) sockets:" msgstr "" #. type: Plain text #: man-pages/man2/bind.2:198 msgid "" "Search permission is denied on a component of the path prefix. (See also " "B(7).)" msgstr "" #. type: TP #: man-pages/man2/bind.2:198 #, no-wrap msgid "B" msgstr "" #. type: Plain text #: man-pages/man2/bind.2:202 msgid "" "A nonexistent interface was requested or the requested address was not local." "" msgstr "" #. type: TP #: man-pages/man2/bind.2:202 #, no-wrap msgid "B" msgstr "" #. type: Plain text #: man-pages/man2/bind.2:206 msgid "I points outside the user's accessible address space." msgstr "" #. type: Plain text #: man-pages/man2/bind.2:213 msgid "" "The I is wrong, or the socket was not in the B family." msgstr "" #. type: TP #: man-pages/man2/bind.2:213 #, no-wrap msgid "B" msgstr "" #. type: Plain text #: man-pages/man2/bind.2:217 msgid "Too many symbolic links were encountered in resolving I." msgstr "" #. type: TP #: man-pages/man2/bind.2:217 #, no-wrap msgid "B" msgstr "" #. type: Plain text #: man-pages/man2/bind.2:221 msgid "I is too long." msgstr "" #. type: TP #: man-pages/man2/bind.2:221 #, no-wrap msgid "B" msgstr "" #. type: Plain text #: man-pages/man2/bind.2:224 msgid "The file does not exist." msgstr "" #. type: TP #: man-pages/man2/bind.2:224 #, no-wrap msgid "B" msgstr "" #. type: Plain text #: man-pages/man2/bind.2:227 msgid "Insufficient kernel memory was available." msgstr "" #. type: TP #: man-pages/man2/bind.2:227 #, no-wrap msgid "B" msgstr "" #. type: Plain text #: man-pages/man2/bind.2:230 msgid "A component of the path prefix is not a directory." msgstr "" #. type: TP #: man-pages/man2/bind.2:230 #, no-wrap msgid "B" msgstr "" #. type: Plain text #: man-pages/man2/bind.2:233 msgid "The socket inode would reside on a read-only filesystem." msgstr "" #. type: SH #: man-pages/man2/bind.2:233 #, no-wrap msgid "CONFORMING TO" msgstr "" #. SVr4 documents an additional #. .B ENOSR #. general error condition, and #. additional #. .B EIO #. and #. .B EISDIR #. UNIX-domain error conditions. #. type: Plain text #: man-pages/man2/bind.2:245 msgid "SVr4, 4.4BSD, POSIX.1-2001 (B() first appeared in 4.2BSD)." msgstr "" #. type: SH #: man-pages/man2/bind.2:245 #, no-wrap msgid "NOTES" msgstr "" #. type: Plain text #: man-pages/man2/bind.2:251 msgid "" "POSIX.1-2001 does not require the inclusion of Isys/types.hE>, and " "this header file is not required on Linux. However, some historical (BSD) " "implementations required this header file, and portable applications are " "probably wise to include it." msgstr "" #. type: Plain text #: man-pages/man2/bind.2:262 msgid "" "The third argument of B() is in reality an I (and this is what 4." "x BSD and libc4 and libc5 have). Some POSIX confusion resulted in the " "present I, also used by glibc. See also B(2)." msgstr "" #. type: SH #: man-pages/man2/bind.2:262 #, no-wrap msgid "BUGS" msgstr "" #. FIXME What *are* transparent proxy options? #. type: Plain text #: man-pages/man2/bind.2:265 msgid "The transparent proxy options are not described." msgstr "" #. type: SH #: man-pages/man2/bind.2:265 #, no-wrap msgid "EXAMPLE" msgstr "" #. type: Plain text #: man-pages/man2/bind.2:270 msgid "" "An example of the use of B() with Internet domain sockets can be " "found in B(3)." msgstr "" #. listen.7 refers to this example. #. accept.7 refers to this example. #. unix.7 refers to this example. #. type: Plain text #: man-pages/man2/bind.2:277 msgid "" "The following example shows how to bind a stream socket in the UNIX " "(B) domain, and accept connections:" msgstr "" #. type: Plain text #: man-pages/man2/bind.2:284 #, no-wrap msgid "" "#include Esys/socket.hE\n" "#include Esys/un.hE\n" "#include Estdlib.hE\n" "#include Estdio.hE\n" "#include Estring.hE\n" msgstr "" #. type: Plain text #: man-pages/man2/bind.2:287 #, no-wrap msgid "#define MY_SOCK_PATH \"/somepath\"\n" "#define LISTEN_BACKLOG 50\n" msgstr "" #. type: Plain text #: man-pages/man2/bind.2:290 #, no-wrap msgid "" "#define handle_error(msg) \\e\n" " do { perror(msg); exit(EXIT_FAILURE); } while (0)\n" msgstr "" #. type: Plain text #: man-pages/man2/bind.2:297 #, no-wrap msgid "" "int\n" "main(int argc, char *argv[])\n" "{\n" " int sfd, cfd;\n" " struct sockaddr_un my_addr, peer_addr;\n" " socklen_t peer_addr_size;\n" msgstr "" #. type: Plain text #: man-pages/man2/bind.2:301 #, no-wrap msgid "" " sfd = socket(AF_UNIX, SOCK_STREAM, 0);\n" " if (sfd == -1)\n" " handle_error(\"socket\");\n" msgstr "" #. type: Plain text #: man-pages/man2/bind.2:307 #, no-wrap msgid "" " memset(&my_addr, 0, sizeof(struct sockaddr_un));\n" " /* Clear structure */\n" " my_addr.sun_family = AF_UNIX;\n" " strncpy(my_addr.sun_path, MY_SOCK_PATH,\n" " sizeof(my_addr.sun_path) - 1);\n" msgstr "" #. type: Plain text #: man-pages/man2/bind.2:311 #, no-wrap msgid "" " if (bind(sfd, (struct sockaddr *) &my_addr,\n" " sizeof(struct sockaddr_un)) == -1)\n" " handle_error(\"bind\");\n" msgstr "" #. type: Plain text #: man-pages/man2/bind.2:314 #, no-wrap msgid "" " if (listen(sfd, LISTEN_BACKLOG) == -1)\n" " handle_error(\"listen\");\n" msgstr "" #. type: Plain text #: man-pages/man2/bind.2:317 #, no-wrap msgid "" " /* Now we can accept incoming connections one\n" " at a time using accept(2) */\n" msgstr "" #. type: Plain text #: man-pages/man2/bind.2:323 #, no-wrap msgid "" " peer_addr_size = sizeof(struct sockaddr_un);\n" " cfd = accept(sfd, (struct sockaddr *) &peer_addr,\n" " &peer_addr_size);\n" " if (cfd == -1)\n" " handle_error(\"accept\");\n" msgstr "" #. type: Plain text #: man-pages/man2/bind.2:325 #, no-wrap msgid " /* Code to deal with incoming connection(s)... */\n" msgstr "" #. type: Plain text #: man-pages/man2/bind.2:329 #, no-wrap msgid "" " /* When no longer required, the socket pathname, MY_SOCK_PATH\n" " should be deleted using unlink(2) or remove(3) */\n" "}\n" msgstr "" #. type: SH #: man-pages/man2/bind.2:330 #, no-wrap msgid "SEE ALSO" msgstr "" #. type: Plain text #: man-pages/man2/bind.2:343 msgid "" "B(2), B(2), B(2), B(2), B(2), " "B(3), B(3), B(7), B(7), " "B(7), B(7), B(7)" msgstr "" #. type: SH #: man-pages/man2/bind.2:343 #, no-wrap msgid "COLOPHON" msgstr "" #. type: Plain text #: man-pages/man2/bind.2:351 msgid "" "This page is part of release 3.70 of the Linux I project. A " "description of the project, information about reporting bugs, and the latest " "version of this page, can be found at \\%http://www.kernel.org/doc/man-pages/" "." msgstr ""