.\" -*- coding: UTF-8 -*- '\" t .\" Copyright 1997 Nicolás Lichtmaier .\" Created Thu Aug 7 00:44:00 ART 1997 .\" .\" SPDX-License-Identifier: GPL-2.0-or-later .\" .\" 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 "20 ​​Julio 2023" "Páginas de manual de Linux 6.05.01" .SH NOMBRE lockf \- aplica, comprueba o elimina un bloqueo POSIX sobre un fichero abierto .SH BIBLIOTECA Biblioteca Estándar C (\fIlibc\fP, \fI\-lc\fP) .SH SINOPSIS .nf \fB#include \fP .PP \fBint lockf(int \fP\fIfd\fP\fB, int \fP\fIcmd\fP\fB, off_t \fP\fIlen\fP\fB);\fP .fi .PP .RS -4 Requisitos de Macros de Prueba de Características para glibc (véase \fBfeature_test_macros\fP(7)): .RE .PP \fBlockf\fP(): .nf .\" || _XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED _XOPEN_SOURCE >= 500 || /* glibc >= 2.19: */ _DEFAULT_SOURCE || /* glibc <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE .fi .SH DESCRIPCIÓN Apply, test, or remove a POSIX lock on a section of an open file. The file is specified by \fIfd\fP, a file descriptor open for writing, the action by \fIcmd\fP, and the section consists of byte positions \fIpos\fP..\fIpos\fP+\fIlen\fP\-1 if \fIlen\fP is positive, and \fIpos\fP\-\fIlen\fP..\fIpos\fP\-1 if \fIlen\fP is negative, where \fIpos\fP is the current file position, and if \fIlen\fP is zero, the section extends from the current file position to infinity, encompassing the present and future end\-of\-file positions. In all cases, the section may extend past current end\-of\-file. .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 para indicar el error. .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; lbx lb lb l l l. Interfaz Atributo Valor T{ .na .nh \fBlockf\fP() T} Seguridad del hilo Multi\-hilo seguro .TE .sp 1 .SH ESTÁNDARES POSIX.1\-2008. .SH HISTORIAL POSIX.1\-2001, 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) .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 .