# SOME DESCRIPTIVE TITLE # Copyright (C) YEAR Free Software Foundation, Inc. # This file is distributed under the same license as the PACKAGE package. # FIRST AUTHOR , YEAR. # #, fuzzy msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "POT-Creation-Date: 2024-03-01 16:56+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #. type: TH #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, no-wrap msgid "fcntl" msgstr "" #. type: TH #: archlinux fedora-40 fedora-rawhide mageia-cauldron #, no-wrap msgid "2023-10-31" msgstr "" #. type: TH #: archlinux fedora-40 fedora-rawhide mageia-cauldron #, no-wrap msgid "Linux man-pages 6.06" msgstr "" #. type: SH #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, no-wrap msgid "NAME" msgstr "" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "fcntl - manipulate file descriptor" msgstr "" #. type: SH #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, no-wrap msgid "LIBRARY" msgstr "" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "Standard C library (I, I<-lc>)" msgstr "" #. type: SH #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, no-wrap msgid "SYNOPSIS" msgstr "" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, no-wrap msgid "B<#include Efcntl.hE>\n" msgstr "" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, no-wrap msgid "BIB<, int >IB<, ... /* >IB< */ );>\n" msgstr "" #. type: SH #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, no-wrap msgid "DESCRIPTION" msgstr "" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "B() performs one of the operations described below on the open file " "descriptor I. The operation is determined by I." msgstr "" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "B() can take an optional third argument. Whether or not this " "argument is required is determined by I. The required argument type is " "indicated in parentheses after each I name (in most cases, the required " "type is I, and we identify the argument using the name I), or " "I is specified if the argument is not required." msgstr "" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "Certain of the operations below are supported only since a particular Linux " "kernel version. The preferred method of checking whether the host kernel " "supports a particular operation is to invoke B() with the desired " "I value and then test whether the call failed with B, " "indicating that the kernel does not recognize this value." msgstr "" #. type: SS #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, no-wrap msgid "Duplicating a file descriptor" msgstr "" #. type: TP #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, no-wrap msgid "B (I)" msgstr "" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "Duplicate the file descriptor I using the lowest-numbered available file " "descriptor greater than or equal to I. This is different from " "B(2), which uses exactly the file descriptor specified." msgstr "" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "On success, the new file descriptor is returned." msgstr "" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "See B(2) for further details." msgstr "" #. type: TP #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, no-wrap msgid "B (I; since Linux 2.6.24)" msgstr "" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "As for B, but additionally set the close-on-exec flag for the " "duplicate file descriptor. Specifying this flag permits a program to avoid " "an additional B() B operation to set the B " "flag. For an explanation of why this flag is useful, see the description of " "B in B(2)." msgstr "" #. type: SS #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, no-wrap msgid "File descriptor flags" msgstr "" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "The following commands manipulate the flags associated with a file " "descriptor. Currently, only one such flag is defined: B, the " "close-on-exec flag. If the B bit is set, the file descriptor " "will automatically be closed during a successful B(2). (If the " "B(2) fails, the file descriptor is left open.) If the " "B bit is not set, the file descriptor will remain open across an " "B(2)." msgstr "" #. type: TP #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, no-wrap msgid "B (I)" msgstr "" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "Return (as the function result) the file descriptor flags; I is ignored." msgstr "" #. type: TP #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, no-wrap msgid "B (I)" msgstr "" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "Set the file descriptor flags to the value specified by I." msgstr "" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "In multithreaded programs, using B() B to set the close-on-" "exec flag at the same time as another thread performs a B(2) plus " "B(2) is vulnerable to a race condition that may unintentionally " "leak the file descriptor to the program executed in the child process. See " "the discussion of the B flag in B(2) for details and a " "remedy to the problem." msgstr "" #. type: SS #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, no-wrap msgid "File status flags" msgstr "" #. or #. .BR creat (2), #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "Each open file description has certain associated status flags, initialized " "by B(2) and possibly modified by B(). Duplicated file " "descriptors (made with B(2), B(F_DUPFD), B(2), etc.) refer " "to the same open file description, and thus share the same file status flags." msgstr "" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "The file status flags and their semantics are described in B(2)." msgstr "" #. type: TP #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, no-wrap msgid "B (I)" msgstr "" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "Return (as the function result) the file access mode and the file status " "flags; I is ignored." msgstr "" #. type: TP #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, no-wrap msgid "B (I)" msgstr "" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "Set the file status flags to the value specified by I. File access " "mode (B, B, B) and file creation flags (i.e., " "B, B, B, B) in I are ignored. On " "Linux, this command can change only the B, B, " "B, B, and B flags. It is not possible to " "change the B and B flags; see BUGS, below." msgstr "" #. type: SS #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, no-wrap msgid "Advisory record locking" msgstr "" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "Linux implements traditional (\"process-associated\") UNIX record locks, as " "standardized by POSIX. For a Linux-specific alternative with better " "semantics, see the discussion of open file description locks below." msgstr "" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "B, B, and B are used to acquire, release, and " "test for the existence of record locks (also known as byte-range, file-" "segment, or file-region locks). The third argument, I, is a pointer " "to a structure that has at least the following fields (in unspecified order)." msgstr "" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, no-wrap msgid "" "struct flock {\n" " ...\n" " short l_type; /* Type of lock: F_RDLCK,\n" " F_WRLCK, F_UNLCK */\n" " short l_whence; /* How to interpret l_start:\n" " SEEK_SET, SEEK_CUR, SEEK_END */\n" " off_t l_start; /* Starting offset for lock */\n" " off_t l_len; /* Number of bytes to lock */\n" " pid_t l_pid; /* PID of process blocking our lock\n" " (set by F_GETLK and F_OFD_GETLK) */\n" " ...\n" "};\n" msgstr "" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "The I, I, and I fields of this structure specify " "the range of bytes we wish to lock. Bytes past the end of the file may be " "locked, but not bytes before the start of the file." msgstr "" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "I is the starting offset for the lock, and is interpreted relative " "to either: the start of the file (if I is B); the " "current file offset (if I is B); or the end of the file " "(if I is B). In the final two cases, I can be " "a negative number provided the offset does not lie before the start of the " "file." msgstr "" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "I specifies the number of bytes to be locked. If I is " "positive, then the range to be locked covers bytes I up to and " "including I+I-1. Specifying 0 for I has the special " "meaning: lock all bytes starting at the location specified by I " "and I through to the end of file, no matter how large the file " "grows." msgstr "" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "POSIX.1-2001 allows (but does not require) an implementation to support a " "negative I value; if I is negative, the interval described by " "I covers bytes I+I up to and including I-1. " "This is supported since Linux 2.4.21 and Linux 2.5.49." msgstr "" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "The I field can be used to place a read (B) or a write " "(B) lock on a file. Any number of processes may hold a read lock " "(shared lock) on a file region, but only one process may hold a write lock " "(exclusive lock). An exclusive lock excludes all other locks, both shared " "and exclusive. A single process can hold only one type of lock on a file " "region; if a new lock is applied to an already-locked region, then the " "existing lock is converted to the new lock type. (Such conversions may " "involve splitting, shrinking, or coalescing with an existing lock if the " "byte range specified by the new lock does not precisely coincide with the " "range of the existing lock.)" msgstr "" #. type: TP #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, no-wrap msgid "B (I)" msgstr "" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "Acquire a lock (when I is B or B) or release a " "lock (when I is B) on the bytes specified by the " "I, I, and I fields of I. If a conflicting " "lock is held by another process, this call returns -1 and sets I to " "B or B. (The error returned in this case differs across " "implementations, so POSIX requires a portable application to check for both " "errors.)" msgstr "" #. type: TP #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, no-wrap msgid "B (I)" msgstr "" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "As for B, but if a conflicting lock is held on the file, then wait " "for that lock to be released. If a signal is caught while waiting, then the " "call is interrupted and (after the signal handler has returned) returns " "immediately (with return value -1 and I set to B; see " "B(7))." msgstr "" #. type: TP #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, no-wrap msgid "B (I)" msgstr "" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "On input to this call, I describes a lock we would like to place on " "the file. If the lock could be placed, B() does not actually place " "it, but returns B in the I field of I and leaves the " "other fields of the structure unchanged." msgstr "" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "If one or more incompatible locks would prevent this lock being placed, then " "B() returns details about one of those locks in the I, " "I, I, and I fields of I. If the conflicting " "lock is a traditional (process-associated) record lock, then the I " "field is set to the PID of the process holding that lock. If the " "conflicting lock is an open file description lock, then I is set to " "-1. Note that the returned information may already be out of date by the " "time the caller inspects it." msgstr "" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "In order to place a read lock, I must be open for reading. In order to " "place a write lock, I must be open for writing. To place both types of " "lock, open a file read-write." msgstr "" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "When placing locks with B, the kernel detects I, " "whereby two or more processes have their lock requests mutually blocked by " "locks held by the other processes. For example, suppose process A holds a " "write lock on byte 100 of a file, and process B holds a write lock on byte " "200. If each process then attempts to lock the byte already locked by the " "other process using B, then, without deadlock detection, both " "processes would remain blocked indefinitely. When the kernel detects such " "deadlocks, it causes one of the blocking lock requests to immediately fail " "with the error B; an application that encounters such an error " "should release some of its locks to allow other applications to proceed " "before attempting regain the locks that it requires. Circular deadlocks " "involving more than two processes are also detected. Note, however, that " "there are limitations to the kernel's deadlock-detection algorithm; see BUGS." msgstr "" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "As well as being removed by an explicit B, record locks are " "automatically released when the process terminates." msgstr "" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "Record locks are not inherited by a child created via B(2), but are " "preserved across an B(2)." msgstr "" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "Because of the buffering performed by the B(3) library, the use of " "record locking with routines in that package should be avoided; use " "B(2) and B(2) instead." msgstr "" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "The record locks described above are associated with the process (unlike the " "open file description locks described below). This has some unfortunate " "consequences:" msgstr "" #. type: IP #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, no-wrap msgid "\\[bu]" msgstr "" #. (Additional file descriptors referring to the same file #. may have been obtained by calls to #. .BR open "(2), " dup "(2), " dup2 "(2), or " fcntl ().) #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "If a process closes I file descriptor referring to a file, then all of " "the process's locks on that file are released, regardless of the file " "descriptor(s) on which the locks were obtained. This is bad: it means that " "a process can lose its locks on a file such as I or I when for some reason a library function decides to open, read, and " "close the same file." msgstr "" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "The threads in a process share locks. In other words, a multithreaded " "program can't use record locking to ensure that threads don't simultaneously " "access the same region of a file." msgstr "" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "Open file description locks solve both of these problems." msgstr "" #. type: SS #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, no-wrap msgid "Open file description locks (non-POSIX)" msgstr "" #. FIXME . Review progress into POSIX #. http://austingroupbugs.net/view.php?id=768 #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "Open file description locks are advisory byte-range locks whose operation is " "in most respects identical to the traditional record locks described above. " "This lock type is Linux-specific, and available since Linux 3.15. (There is " "a proposal with the Austin Group to include this lock type in the next " "revision of POSIX.1.) For an explanation of open file descriptions, see " "B(2)." msgstr "" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "The principal difference between the two lock types is that whereas " "traditional record locks are associated with a process, open file " "description locks are associated with the open file description on which " "they are acquired, much like locks acquired with B(2). Consequently " "(and unlike traditional advisory record locks), open file description locks " "are inherited across B(2) (and B(2) with B), and " "are only automatically released on the last close of the open file " "description, instead of being released on any close of the file." msgstr "" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "Conflicting lock combinations (i.e., a read lock and a write lock or two " "write locks) where one lock is an open file description lock and the other " "is a traditional record lock conflict even when they are acquired by the " "same process on the same file descriptor." msgstr "" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "Open file description locks placed via the same open file description (i.e., " "via the same file descriptor, or via a duplicate of the file descriptor " "created by B(2), B(2), B() B, and so on) are " "always compatible: if a new lock is placed on an already locked region, then " "the existing lock is converted to the new lock type. (Such conversions may " "result in splitting, shrinking, or coalescing with an existing lock as " "discussed above.)" msgstr "" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "On the other hand, open file description locks may conflict with each other " "when they are acquired via different open file descriptions. Thus, the " "threads in a multithreaded program can use open file description locks to " "synchronize access to a file region by having each thread perform its own " "B(2) on the file and applying locks via the resulting file descriptor." msgstr "" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "As with traditional advisory locks, the third argument to B(), " "I, is a pointer to an I structure. By contrast with " "traditional record locks, the I field of that structure must be set " "to zero when using the commands described below." msgstr "" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "The commands for working with open file description locks are analogous to " "those used with traditional locks:" msgstr "" #. type: TP #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, no-wrap msgid "B (I)" msgstr "" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "Acquire an open file description lock (when I is B or " "B) or release an open file description lock (when I is " "B) on the bytes specified by the I, I, and " "I fields of I. If a conflicting lock is held by another " "process, this call returns -1 and sets I to B." msgstr "" #. type: TP #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, no-wrap msgid "B (I)" msgstr "" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "As for B, but if a conflicting lock is held on the file, then " "wait for that lock to be released. If a signal is caught while waiting, " "then the call is interrupted and (after the signal handler has returned) " "returns immediately (with return value -1 and I set to B; see " "B(7))." msgstr "" #. type: TP #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, no-wrap msgid "B (I)" msgstr "" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "On input to this call, I describes an open file description lock we " "would like to place on the file. If the lock could be placed, B() " "does not actually place it, but returns B in the I field of " "I and leaves the other fields of the structure unchanged. If one or " "more incompatible locks would prevent this lock being placed, then details " "about one of these locks are returned via I, as described above for " "B." msgstr "" #. commit 57b65325fe34ec4c917bc4e555144b4a94d9e1f7 #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "In the current implementation, no deadlock detection is performed for open " "file description locks. (This contrasts with process-associated record " "locks, for which the kernel does perform deadlock detection.)" msgstr "" #. type: SS #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, no-wrap msgid "Mandatory locking" msgstr "" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "I: the Linux implementation of mandatory locking is unreliable. " "See BUGS below. Because of these bugs, and the fact that the feature is " "believed to be little used, since Linux 4.5, mandatory locking has been made " "an optional feature, governed by a configuration option " "(B). This feature is no longer supported at " "all in Linux 5.15 and above." msgstr "" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "By default, both traditional (process-associated) and open file description " "record locks are advisory. Advisory locks are not enforced and are useful " "only between cooperating processes." msgstr "" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "Both lock types can also be mandatory. Mandatory locks are enforced for all " "processes. If a process tries to perform an incompatible access (e.g., " "B(2) or B(2)) on a file region that has an incompatible " "mandatory lock, then the result depends upon whether the B flag " "is enabled for its open file description. If the B flag is not " "enabled, then the system call is blocked until the lock is removed or " "converted to a mode that is compatible with the access. If the " "B flag is enabled, then the system call fails with the error " "B." msgstr "" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "To make use of mandatory locks, mandatory locking must be enabled both on " "the filesystem that contains the file to be locked, and on the file itself. " "Mandatory locking is enabled on a filesystem using the \"-o mand\" option to " "B(8), or the B flag for B(2). Mandatory locking " "is enabled on a file by disabling group execute permission on the file and " "enabling the set-group-ID permission bit (see B(1) and B(2))." msgstr "" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "Mandatory locking is not specified by POSIX. Some other systems also " "support mandatory locking, although the details of how to enable it vary " "across systems." msgstr "" #. type: SS #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, no-wrap msgid "Lost locks" msgstr "" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "When an advisory lock is obtained on a networked filesystem such as NFS it " "is possible that the lock might get lost. This may happen due to " "administrative action on the server, or due to a network partition (i.e., " "loss of network connectivity with the server) which lasts long enough for " "the server to assume that the client is no longer functioning." msgstr "" #. commit ef1820f9be27b6ad158f433ab38002ab8131db4d #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "When the filesystem determines that a lock has been lost, future B(2) " "or B(2) requests may fail with the error B. This error will " "persist until the lock is removed or the file descriptor is closed. Since " "Linux 3.12, this happens at least for NFSv4 (including all minor versions)." msgstr "" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "Some versions of UNIX send a signal (B) in this circumstance. " "Linux does not define this signal, and does not provide any asynchronous " "notification of lost locks." msgstr "" #. type: SS #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, no-wrap msgid "Managing signals" msgstr "" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "B, B, B, B, B, and " "B are used to manage I/O availability signals:" msgstr "" #. type: TP #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, no-wrap msgid "B (I)" msgstr "" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "Return (as the function result) the process ID or process group ID " "currently receiving B and B signals for events on file " "descriptor I. Process IDs are returned as positive values; process " "group IDs are returned as negative values (but see BUGS below). I is " "ignored." msgstr "" #. type: TP #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, no-wrap msgid "B (I)" msgstr "" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "Set the process ID or process group ID that will receive B and " "B signals for events on the file descriptor I. The target " "process or process group ID is specified in I. A process ID is " "specified as a positive value; a process group ID is specified as a negative " "value. Most commonly, the calling process specifies itself as the owner " "(that is, I is specified as B(2))." msgstr "" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "As well as setting the file descriptor owner, one must also enable " "generation of signals on the file descriptor. This is done by using the " "B() B command to set the B file status flag on the " "file descriptor. Subsequently, a B signal is sent whenever input or " "output becomes possible on the file descriptor. The B() B " "command can be used to obtain delivery of a signal other than B." msgstr "" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "Sending a signal to the owner process (group) specified by B is " "subject to the same permissions checks as are described for B(2), " "where the sending process is the one that employs B (but see BUGS " "below). If this permission check fails, then the signal is silently " "discarded. I: The B operation records the caller's " "credentials at the time of the B() call, and it is these saved " "credentials that are used for the permission checks." msgstr "" # #. The following appears to be rubbish. It doesn't seem to #. be true according to the kernel source, and I can write #. a program that gets a terminal-generated SIGIO even though #. it is not the foreground process group of the terminal. #. -- MTK, 8 Apr 05 #. If the file descriptor #. .I fd #. refers to a terminal device, then SIGIO #. signals are sent to the foreground process group of the terminal. #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "If the file descriptor I refers to a socket, B also selects " "the recipient of B signals that are delivered when out-of-band data " "arrives on that socket. (B is sent in any situation where " "B(2), B(2), B(2) with B set etc.) to " "determine which file descriptors are available for I/O." msgstr "" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "Note that the file descriptor provided in I is the one that was " "specified during the B operation. This can lead to an unusual " "corner case. If the file descriptor is duplicated (B(2) or similar), " "and the original file descriptor is closed, then I/O events will continue to " "be generated, but the I field will contain the number of the now " "closed file descriptor." msgstr "" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "By selecting a real time signal (value E= B), multiple I/O " "events may be queued using the same signal numbers. (Queuing is dependent " "on available memory.) Extra information is available if B is " "set for the signal handler, as above." msgstr "" #. See fs/fcntl.c::send_sigio_to_task() (2.4/2.6) sources -- MTK, Apr 05 #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "Note that Linux imposes a limit on the number of real-time signals that may " "be queued to a process (see B(2) and B(7)) and if this " "limit is reached, then the kernel reverts to delivering B, and this " "signal is delivered to the entire process rather than to a specific thread." msgstr "" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "Using these mechanisms, a program can implement fully asynchronous I/O " "without using B