.\" -*- coding: UTF-8 -*- .\" Copyright (c) 1983, 1991 The Regents of the University of California. .\" All rights reserved. .\" .\" SPDX-License-Identifier: BSD-4-Clause-UC .\" .\" $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 "3 Abril 2023" "Páginas de manual de Linux 6.05.01" .SH NOMBRE getsockopt, setsockopt \- obtiene y pone opciones en conectores (\fIsockets\fP) .SH BIBLIOTECA Biblioteca Estándar C (\fIlibc\fP, \fI\-lc\fP) .SH SINOPSIS .nf \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[restrict *.\fP\fIoptlen\fP\fB],\fP \fB socklen_t *restrict \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[.\fP\fIoptlen\fP\fB],\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" En caso de éxito, se devuelve cero en las operaciones estándar. En caso de error, \-1, y se define \fIerrno\fP al valor correspondiente. .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 ESTÁNDARES POSIX.1\-2008. .SH HISTORIAL .\" 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, SVr4, 4.4BSD (first appeared in 4.2BSD). .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) .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 .