.\" -*- coding: UTF-8 -*- .\" Copyright (c) 1983, 1991 The Regents of the University of California. .\" All rights reserved. .\" .\" %%%LICENSE_START(BSD_4_CLAUSE_UCB) .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" 3. All advertising materials mentioning features or use of this software .\" must display the following acknowledgement: .\" This product includes software developed by the University of .\" California, Berkeley and its contributors. .\" 4. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" %%%LICENSE_END .\" .\" $Id: getsockopt.2,v 1.1 1999/05/24 14:57:04 freitag Exp $ .\" .\" Modified Sat Jul 24 16:19:32 1993 by Rik Faith (faith@cs.unc.edu) .\" Modified Mon Apr 22 02:29:06 1996 by Martin Schulze (joey@infodrom.north.de) .\" Modified Tue Aug 27 10:52:51 1996 by Andries Brouwer (aeb@cwi.nl) .\" Modified Thu Jan 23 13:29:34 1997 by Andries Brouwer (aeb@cwi.nl) .\" Modified Sun Mar 28 21:26:46 1999 by Andries Brouwer (aeb@cwi.nl) .\" Modified 1999 by Andi Kleen . .\" Removed most stuff because it is in socket.7 now. .\" .\"******************************************************************* .\" .\" This file was generated with po4a. Translate the source file. .\" .\"******************************************************************* .TH GETSOCKOPT 2 "11 Abril 2020" Linux "Manual del Programador de Linux" .SH NOMBRE getsockopt, setsockopt \- obtiene y pone opciones en conectores (\fIsockets\fP) .SH SINOPSIS .nf \fB#include \fP /* Vea NOTAS */ \fB#include \fP .PP \fBint getsockopt(int \fP\fIsockfd\fP\fB, int \fP\fIlevel\fP\fB, int \fP\fIoptname\fP\fB,\fP \fB void *\fP\fIoptval\fP\fB, socklen_t *\fP\fIoptlen\fP\fB);\fP \fBint setsockopt(int \fP\fIsockfd\fP\fB, int \fP\fIlevel\fP\fB, int \fP\fIoptname\fP\fB,\fP \fB const void *\fP\fIoptval\fP\fB, socklen_t \fP\fIoptlen\fP\fB);\fP .fi .SH DESCRIPCIÓN \fBgetsockopt\fP() and \fBsetsockopt\fP() manipulate options for the socket referred to by the file descriptor \fIsockfd\fP. Options may exist at multiple protocol levels; they are always present at the uppermost socket level. .PP When manipulating socket options, the level at which the option resides and the name of the option must be specified. To manipulate options at the sockets API level, \fIlevel\fP is specified as \fBSOL_SOCKET\fP. To manipulate options at any other level the protocol number of the appropriate protocol controlling the option is supplied. For example, to indicate that an option is to be interpreted by the \fBTCP\fP protocol, \fIlevel\fP should be set to the protocol number of \fBTCP\fP; see \fBgetprotoent\fP(3). .PP The arguments \fIoptval\fP and \fIoptlen\fP are used to access option values for \fBsetsockopt\fP(). For \fBgetsockopt\fP() they identify a buffer in which the value for the requested option(s) are to be returned. For \fBgetsockopt\fP(), \fIoptlen\fP is a value\-result argument, initially containing the size of the buffer pointed to by \fIoptval\fP, and modified on return to indicate the actual size of the value returned. If no option value is to be supplied or returned, \fIoptval\fP may be NULL. .PP \fIOptname\fP y cualesquiera opciones especificadas se pasan sin interpretar al módulo de protocolo apropiado para su interpretación. El fichero de cabecera \fI\fP contiene definiciones para opciones de nivel de conector, descritas más abajo. Las opciones a otros niveles de protocolo varían en formato y nombre; consulte las páginas apropiadas de la sección 4 del Manual. .PP La mayoría de las opciones de nivel\-conector utilizan un parámetro \fIint\fP para \fIoptval\fP. Para \fBsetsockopt\fP(), el parámetro debe ser distinto de cero para permitir una opción booleana, o cero si la opción va a ser deshabilitada. .PP Para una descripción de las opciones disponibles para conectores vea \fBsocket\fP(7) y las páginas de manual del protocolo apropiado. .SH "VALOR DEVUELTO" On success, zero is returned for the standard options. On error, \-1 is returned, and \fIerrno\fP is set appropriately. .PP Netfilter allows the programmer to define custom socket options with associated handlers; for such options, the return value on success is the value returned by the handler. .SH ERRORES .TP \fBEBADF\fP El argumento \fIsockfd\fP no es un descriptor de archivo válido. .TP \fBEFAULT\fP La dirección apuntada por \fIoptval\fP no está en un sitio válido del espacio de direcciones del proceso. Para \fBgetsockopt\fP(), este error puede también ser devuelto si \fIoptlen\fP no está en un sitio válido del espacio de direcciones del proceso. .TP \fBEINVAL\fP \fIoptlen\fP invalid in \fBsetsockopt\fP(). In some cases this error can also occur for an invalid value in \fIoptval\fP (e.g., for the \fBIP_ADD_MEMBERSHIP\fP option described in \fBip\fP(7)). .TP \fBENOPROTOOPT\fP La opción es desconocida al nivel indicado. .TP \fBENOTSOCK\fP El descriptor de archivo \fIsockfd\fP no se refiere a un conector. .SH "CONFORME A" .\" SVr4 documents additional ENOMEM and ENOSR error codes, but does .\" not document the .\" .BR SO_SNDLOWAT ", " SO_RCVLOWAT ", " SO_SNDTIMEO ", " SO_RCVTIMEO .\" options POSIX.1\-2001, POSIX.1\-2008, SVr4, 4.4BSD (estas llamadas de sistema se implementaron por primera vez en 4.2BSD). .SH NOTAS POSIX.1 does not require the inclusion of \fI\fP, 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. .PP For background on the \fIsocklen_t\fP type, see \fBaccept\fP(2). .SH ERRORES Algunas de las opciones de conector deberían ser manejadas a niveles más bajos del sistema. .SH "VÉASE TAMBIÉN" \fBioctl\fP(2), \fBsocket\fP(2), \fBgetprotoent\fP(3), \fBprotocols\fP(5), \fBip\fP(7), \fBpacket\fP(7), \fBsocket\fP(7), \fBtcp\fP(7), \fBudp\fP(7), \fBunix\fP(7) .SH COLOFÓN Esta página es parte de la versión 5.10 del proyecto Linux \fIman\-pages\fP. Puede encontrar una descripción del proyecto, información sobre cómo informar errores y la última versión de esta página en \%https://www.kernel.org/doc/man\-pages/. .PP .SH TRADUCCIÓN La traducción al español de esta página del manual fue creada por Juan Piernas , Miguel Pérez Ibars y Marcos Fouces . .PP Esta traducción es documentación libre; lea la .UR https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3 .UE o posterior con respecto a las condiciones de copyright. No existe NINGUNA RESPONSABILIDAD. .PP Si encuentra algún error en la traducción de esta página del manual, envíe un correo electrónico a .MT debian-l10n-spanish@lists.debian.org .ME .