.\" -*- coding: UTF-8 -*- .\" Copyright 1997 Nicolás Lichtmaier .\" Created Thu Aug 7 00:44:00 ART 1997 .\" .\" %%%LICENSE_START(GPLv2+_DOC_FULL) .\" This is free documentation; you can redistribute it and/or .\" modify it under the terms of the GNU General Public License as .\" published by the Free Software Foundation; either version 2 of .\" the License, or (at your option) any later version. .\" .\" The GNU General Public License's references to "object code" .\" and "executables" are to be interpreted as the output of any .\" document formatting or typesetting system, including .\" intermediate and printed output. .\" .\" This manual is distributed in the hope that it will be useful, .\" but WITHOUT ANY WARRANTY; without even the implied warranty of .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the .\" GNU General Public License for more details. .\" .\" You should have received a copy of the GNU General Public .\" License along with this manual; if not, see .\" . .\" %%%LICENSE_END .\" .\" Added section stuff, aeb, 2002-04-22. .\" Corrected include file, drepper, 2003-06-15. .\" .\"******************************************************************* .\" .\" This file was generated with po4a. Translate the source file. .\" .\"******************************************************************* .TH LOCKF 3 "6 Marzo 2019" GNU "Manual del Programador de Linux" .SH NOMBRE lockf \- aplica, comprueba o elimina un bloqueo POSIX sobre un fichero abierto .SH SINOPSIS \fB#include \fP .PP \fBint lockf(int \fP\fIfd\fP\fB, int \fP\fIcmd\fP\fB, off_t \fP\fIlen\fP\fB);\fP .PP .RS -4 Requisitos de Macros de Prueba de Características para glibc (véase \fBfeature_test_macros\fP(7)): .RE .PP \fBlockf\fP(): .ad l .RS 4 .\" || _XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED _XOPEN_SOURCE\ >=\ 500 || /* Glibc since 2.19: */ _DEFAULT_SOURCE || /* Glibc versions <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE .RE .ad .SH DESCRIPCIÓN Aplica, comprueba o elimina un bloqueo POSIX sobre una sección de un fichero abierto. El fichero está especificado por \fIfd\fP, un descriptor de fichero abierto para escritura, la acción por \fIcmd\fP, y la sección consiste en las posiciones de byte \fIpos\fP..\fIpos\fP+\fIlen\fP\-1, si \fIlen\fP es positivo, y \fIpos\fP\-\fIlen\fP..\fIpos\fP\-1, si \fIlen\fP es negativo, donde \fIpos\fP es la posición actual del fichero. Si \fIlen\fP es cero, la sección se extiende desde la posición actual del fichero al infinito, abarcando las posiciones actual y futura de «fin de fichero». En todos los casos, la sección se puede extender más alla del «fin de fichero» actual. .PP On Linux, \fBlockf\fP() is just an interface on top of \fBfcntl\fP(2) locking. Many other systems implement \fBlockf\fP() in this way, but note that POSIX.1 leaves the relationship between \fBlockf\fP() and \fBfcntl\fP(2) locks unspecified. A portable application should probably avoid mixing calls to these interfaces. .PP Las operaciones válidas son: .TP \fBF_LOCK\fP Establece un bloqueo exclusivo en la sección especificada del fichero. Si (parte de) esta sección ya está bloqueada, la llamada se bloquea hasta que el bloqueo anterior sea liberado. Si esta sección se solapa con una sección previamente bloqueada, ambas se fusionan. Los bloqueos sobre el fichero son liberados tan pronto como el proceso que mantiene los bloqueos cierre algunos descriptores de fichero para el fichero. Un proceso hijo no hereda estos bloqueos. .TP \fBF_TLOCK\fP Igual que \fBF_LOCK\fP pero la llamada nunca se bloquea y devuelve un error en su lugar si el fichero ya está bloqueado. .TP \fBF_ULOCK\fP Desbloquea la sección indicada del fichero. Ésto puede provocar que una sección bloqueada se divida en dos secciones bloqueadas. .TP \fBF_TEST\fP Test the lock: return 0 if the specified section is unlocked or locked by this process; return \-1, set \fIerrno\fP to \fBEAGAIN\fP (\fBEACCES\fP on some other systems), if another process holds a lock. .SH "VALOR DEVUELTO" En caso de éxito se devuelve cero. En caso de error se devuelve \-1, y \fIerrno\fP se configura adecuadamente. .SH ERRORES .TP \fBEACCES\fP o \fBEAGAIN\fP El fichero está bloqueado y se especificó \fBF_TLOCK\fP o \fBF_TEST\fP, o se prohibe la operación porque el fichero ha sido ubicado en memoria por otro proceso. .TP \fBEBADF\fP \fIfd\fP is not an open file descriptor; or \fIcmd\fP is \fBF_LOCK\fP or \fBF_TLOCK\fP and \fIfd\fP is not a writable file descriptor. .TP \fBEDEADLK\fP La orden fue \fBF_LOCK\fP y esta operación de bloqueo causaría una situación de interbloqueo. .TP \fBEINTR\fP While waiting to acquire a lock, the call was interrupted by delivery of a signal caught by a handler; see \fBsignal\fP(7). .TP \fBEINVAL\fP Se especificó una operación inválida en \fIcmd\fP. .TP \fBENOLCK\fP Demasiados bloqueos de segmento abiertos, la tabla de bloqueos está llena. .SH ATRIBUTOS Para obtener una explicación de los términos usados en esta sección, véase \fBattributes\fP(7). .TS allbox; lb lb lb l l l. Interfaz Atributo Valor T{ \fBlockf\fP() T} Seguridad del hilo Multi\-hilo seguro .TE .SH "CONFORME A" POSIX.1\-2001, POSIX.1\-2008, SVr4. .SH "VÉASE TAMBIÉN" \fBfcntl\fP(2), \fBflock\fP(2) .PP \fIlocks.txt\fP and \fImandatory\-locking.txt\fP in the Linux kernel source directory \fIDocumentation/filesystems\fP (on older kernels, these files are directly under the \fIDocumentation\fP directory, and \fImandatory\-locking.txt\fP is called \fImandatory.txt\fP) .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 Miguel Pérez Ibars . .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 .