Meta tags:
Headings (most frequently used words):
edit, file, operations, descriptors, on, descriptor, navigation, tools, contents, overview, upcoming, as, capabilities, see, also, references, menu, creating, deriving, single, multiple, the, table, that, modify, process, state, locking, sockets, miscellaneous, personal, namespaces, views, search, contribute, print, export, languages,
Text of the page (most frequently used words):
file (85), the (69), descriptors (28), #descriptor (26), linux (25), and (21), edit (18), unix (17), #operations (17), process (15), table (15), open (12), that (12), for (12), system (11), systems (11), with (9), can (9), wikipedia (8), also (8), this (7), from (7), retrieved (7), group (7), other (7), capability (6), proc (6), are (6), sockets (6), multiple (6), standard (6), page (5), operating (5), has (5), access (5), like (5), single (5), refer (5), pid (5), inode (5), non (4), not (4), description (4), posix (4), based (4), 2017 (4), set (4), output (4), stdio (4), state (4), capabilities (4), been (4), function (4), fcntl (4), into (4), files (4), have (4), about (3), additional (3), use (3), what (3), current (3), navigation (3), talk (3), org (3), object (3), blocking (3), api (3), base (3), specifications (3), issue (3), ieee (3), std (3), 1003 (3), 2008 (3), edition (3), does (3), see (3), many (3), passed (3), processes (3), call (3), same (3), any (3), associated (3), domain (3), new (3), these (3), directory (3), miscellaneous (3), socket (3), handle (3), called (3), identifier (3), kernel (3), opened (3), resource (3), input (3), view (2), contact (2), privacy (2), policy (2), available (2), under (2), terms (2), using (2), october (2), 2022 (2), links (2), languages (2), version (2), wikidata (2), special (2), upload (2), changes (2), tools (2), article (2), contents (2), search (2), read (2), categories (2), short (2), index (2), 432 (2), cap (2), security (2), list (2), mode (2), library (2), isbn (2), part (2), 2021 (2), close_range (2), creat (2), devices (2), self (2), dev (2), 2016 (2), references (2), block (2), example (2), they (2), note (2), mutable (2), offset (2), each (2), its (2), there (2), sendmsg (2), fdopendir (2), modern (2), well (2), suffix (2), takes (2), argument (2), which (2), corresponding (2), working (2), upcoming (2), connection (2), accept (2), locking (2), modify (2), close (2), fd1 (2), number (2), dup (2), bsd (2), all (2), used (2), perform (2), type (2), deriving (2), pipe (2), creating (2), header (2), instead (2), unistd (2), data (2), structure (2), includes (2), named (2), such (2), network (2), pipes (2), through (2), stderr (2), stdout (2), stdin (2), turn (2), indexes (2), names (2), overview (2), error (2), integer (2), value (2), three (2), negative (2), values (2), jump (2), http (2), web (2), cookie, statement, statistics, developers, mobile, disclaimers, text, may, apply, site, you, agree, registered, trademark, profit, organization, wikimedia, foundation, inc, creative, commons, attribution, sharealike, license, was, last, edited, utc, tiếng, việt, українська, svenska, slovenčina, русский, português, polski, oʻzbekcha, ўзбекча, 日本語, italiano, 한국어, galego, français, فارسی, español, deutsch, čeština, printable, download, pdf, print, export, item, cite, information, permanent, link, pages, related, here, recent, community, portal, learn, help, contribute, donate, random, events, main, more, history, views, english, namespaces, log, create, account, contributions, logged, personal, menu, hidden, different, articles, technology, https, php, title, file_descriptor, oldid, 1115665100, plessey, 250, intel, iapx, ibm, flex, cambridge, biin, specialised, hardware, tahoe, lafs, joule, joe, cajita, programming, sel4, nltss, midori, imax, hydra, capros, eros, keykos, gnosis, genode, fuchsia, capsicum, kernels, petnames, zooko, triangle, addressing, model, ambient, authority, confused, deputy, problem, polp, principle, least, privilege, concepts, boyne, pollard, jonathan, 2007, don, shared, brinkmann, marcus, 2009, archived, 2012, original, building, bridge, 2006, 1931624674, extended, stephen, kitt, michael, kerrisk, manual, 2019, 2018, mean, bach, maurice, 1986, 9780132017992, prentice, hall, design, fcb, alternative, scheme, early, versions, dos, control, lsof, fuser, behave, ways, between, across, however, actually, reference, status, flags, complicates, secure, since, when, programs, share, interfere, changing, whether, specifically, designed, very, rarely, itself, mkfifoat, unlinkat, symlinkat, renameat, readlinkat, mknodat, mkdirat, linkat, futimesat, fstatat, fchownat, fchmodat, faccessat, openat, series, added, numerous, libraries, standardized, future, signifies, first, supplying, resolved, forms, lacking, thus, becoming, equivalent, passing, purpose, defend, against, certain, class, attacks, toctou, relative, paths, large, collection, often, device, ioctl, shuts, down, one, both, halves, full, duplex, shutdown, setsockopt, getsockopt, getpeername, getsockname, creates, incoming, listen, bind, connect, berkeley, lockf, f_setlkw, f_getlk, f_setlk, flock, maps, ranges, address, space, mmap, sets, fchdir, f_dupfd, necessary, make, point, fd2, dup3, dup2, duplicates, existing, guaranteeing, lowest, solaris, only, deletes, greater, than, equal, specified, closefrom, various, depending, command, commands, get, attributes, including, f_setfl, f_getfd, f_setfd, f_getfl, copy_file_range, tee, splice, sendfile, kqueue, epoll_ctl, epoll, filedescriptor, wait, epoll_pwait2, epoll_pwait, epoll_wait, ppoll, poll, pselect, select, prints, dprintf, converts, fdopen, p_pidfd, waitid, pidfd_send_signal, vmsplice, setns, statx, fremovexattr, flistxattr, fsetxattr, fgetxattr, fdatasync, fsync, ftruncate, fchown, fchmod, fstatvfs, fstat, llseek, lseek, sendmmsg, recvmmsg, sending, fds, over, recvmsg, sendto, recvfrom, send, recv, pwrite, pread, writev, readv, write, fileno, dirfd, open_by_handle_at, pidfd_open, flag, clone_pidfd, clone, inotify_init, fanotify_init, userfaultfd, memfd_create, timerfd_create, eventfd, signalfd, epoll_create, socketpair, following, lists, typical, most, functions, declared, but, some, usually, low, level, question, overall, provides, abstraction, known, regular, objects, normally, exist, anonymous, character, directories, accessed, path, where, shortcut, running, folders, own, traditional, implementation, per, maintained, wide, records, reading, writing, appending, possibly, modes, third, describes, actual, underlying, passes, will, behalf, direct, tables, entry, result, entries, times, still, simplified, because, represents, inodes, even, though, anything, signifying, closed, 104, stderr_fileno, stdout_fileno, stdin_fileno, stream, symbolic, constant, name, except, perhaps, should, streams, daemons, typically, being, reserved, indicate, conditions, computer, less, frequently, unique, fildes, redirected, free, encyclopedia, wayback, machine, archive, 20221031102615, wiki, file_handle, timestamps, capture, fail, success, 2023, nov, oct, sep, dec, 2005, aug, 2026, captures,
Text of the page (random words):
file descriptor wikipedia 67 captures 15 dec 2005 29 aug 2026 sep oct nov 31 2021 2022 2023 success fail about this capture timestamps the wayback machine http web archive org web 20221031102615 http en wikipedia org wiki file_handle file descriptor from wikipedia the free encyclopedia redirected from file handle jump to navigation jump to search system resource identifier in operating systems in unix and unix like computer operating systems a file descriptor fd less frequently fildes is a process unique identifier handle for a file or other input output resource such as a pipe or network socket file descriptors typically have non negative integer values with negative values being reserved to indicate no value or error conditions file descriptors are a part of the posix api each unix process except perhaps daemons should have three standard posix file descriptors corresponding to the three standard streams integer value name unistd h symbolic constant 1 stdio h file stream 2 0 standard input stdin_fileno stdin 1 standard output stdout_fileno stdout 2 standard error stderr_fileno stderr contents 1 overview 2 operations on file descriptors 2 1 creating file descriptors 2 2 deriving file descriptors 2 3 operations on a single file descriptor 2 4 operations on multiple file descriptors 2 5 operations on the file descriptor table 2 6 operations that modify process state 2 7 file locking 2 8 sockets 2 9 miscellaneous 3 upcoming operations 4 file descriptors as capabilities 5 see also 6 references overview edit file descriptors for a single process file table and inode table note that multiple file descriptors can refer to the same file table entry e g as a result of the dup system call 3 104 and that multiple file table entries can in turn refer to the same inode if it has been opened multiple times the table is still simplified because it represents inodes by file names even though an inode can have multiple names file descriptor 3 does not refer to anything in the file table signifying that it has been closed in the traditional implementation of unix file descriptors index into a per process file descriptor table maintained by the kernel that in turn indexes into a system wide table of files opened by all processes called the file table this table records the mode with which the file or other resource has been opened for reading writing appending and possibly other modes it also indexes into a third table called the inode table that describes the actual underlying files 3 to perform input or output the process passes the file descriptor to the kernel through a system call and the kernel will access the file on behalf of the process the process does not have direct access to the file or inode tables on linux the set of file descriptors open in a process can be accessed under the path proc pid fd where pid is the process identifier file descriptor proc pid fd 0 is stdin proc pid fd 1 is stdout and proc pid fd 2 is stderr as a shortcut to these any running process can also access its own file descriptors through the folders proc self fd and dev fd 4 in unix like systems file descriptors can refer to any unix file type named in a file system as well as regular files this includes directories block and character devices also called special files unix domain sockets and named pipes file descriptors can also refer to other objects that do not normally exist in the file system such as anonymous pipes and network sockets the file data structure in the c standard i o library usually includes a low level file descriptor for the object in question on unix like systems the overall data structure provides additional abstraction and is instead known as a file handle operations on file descriptors edit the following lists typical operations on file descriptors on modern unix like systems most of these functions are declared in the unistd h header but some are in the fcntl h header instead creating file descriptors edit open creat 5 socket accept socketpair pipe epoll_create linux signalfd linux eventfd linux timerfd_create linux memfd_create linux userfaultfd linux fanotify_init linux inotify_init linux clone with flag clone_pidfd linux pidfd_open linux open_by_handle_at linux deriving file descriptors edit dirfd fileno operations on a single file descriptor edit read write readv writev pread pwrite recv send recvfrom sendto recvmsg sendmsg also used for sending fds to other processes over a unix domain socket recvmmsg sendmmsg lseek llseek fstat fstatvfs fchmod fchown ftruncate fsync fdatasync fdopendir fgetxattr fsetxattr linux flistxattr fremovexattr linux statx linux setns linux vmsplice linux pidfd_send_signal linux waitid with p_pidfd id type linux fdopen stdio function converts file descriptor to file dprintf stdio function prints to file descriptor operations on multiple file descriptors edit select pselect poll ppoll epoll_wait epoll_pwait epoll_pwait2 linux takes a single epoll filedescriptor to wait on many other file descriptors epoll_ctl for linux kqueue for bsd based systems sendfile splice tee for linux copy_file_range for linux close_range for linux 6 operations on the file descriptor table edit the fcntl function is used to perform various operations on a file descriptor depending on the command argument passed to it there are commands to get and set attributes associated with a file descriptor including f_getfd f_setfd f_getfl and f_setfl close closefrom bsd and solaris only deletes all file descriptors greater than or equal to specified number dup duplicates an existing file descriptor guaranteeing to be the lowest number available file descriptor dup2 dup3 close fd1 if necessary and make file descriptor fd1 point to the open file of fd2 fcntl f_dupfd operations that modify process state edit fchdir sets the process s current working directory based on a directory file descriptor mmap maps ranges of a file into the process s address space file locking edit flock fcntl f_getlk f_setlk and f_setlkw lockf sockets edit see also berkeley sockets connect bind listen accept creates a new file descriptor for an incoming connection getsockname getpeername getsockopt setsockopt shutdown shuts down one or both halves of a full duplex connection miscellaneous edit ioctl a large collection of miscellaneous operations on a single file descriptor often associated with a device upcoming operations edit a series of new operations on file descriptors has been added to many modern unix like systems as well as numerous c libraries to be standardized in a future version of posix 7 the at suffix signifies that the function takes an additional first argument supplying a file descriptor from which relative paths are resolved the forms lacking the at suffix thus becoming equivalent to passing a file descriptor corresponding to the current working directory the purpose of these new operations is to defend against a certain class of toctou attacks openat faccessat fchmodat fchownat fstatat futimesat linkat mkdirat mknodat readlinkat renameat symlinkat unlinkat mkfifoat fdopendir file descriptors as capabilities edit unix file descriptors behave in many ways as capabilities they can be passed between processes across unix domain sockets using the sendmsg system call note however that what is actually passed is a reference to an open file description that has mutable state the file offset and the file status and access flags this complicates the secure use of file descriptors as capabilities since when programs share access to the same open file description they can interfere with each other s use of it by changing its offset or whether it is blocking or non blocking for example 8 9 in operating systems that are specifically designed as capability systems there is very rarely any mutable state associated with a capability itself a unix process file descriptor table is an example of a c list see also edit fuser unix lsof file control block fcb an alternative scheme in cp m and early versions of dos references edit the open group the open group base specifications issue 7 ieee std 1003 1 2008 2016 edition retrieved 2017 09 21 the open group the open group base specifications issue 7 ieee std 1003 1 2008 2016 edition stdio h retrieved 2017 09 21 a b bach maurice j 1986 the design of the unix operating system 8 ed prentice hall pp 92 96 isbn 9780132017992 devices what does the output of ll proc self fd from ll dev fd mean the open group the open group base specifications issue 7 ieee std 1003 1 2008 2018 edition creat retrieved 2019 04 11 stephen kitt michael kerrisk close_range 2 linux manual page retrieved 2021 03 22 extended api set part 2 the open group october 2006 isbn 1931624674 brinkmann marcus 2009 02 04 building a bridge library api s and file descriptors cap talk archived from the original on 2012 07 30 retrieved 2017 09 21 de boyne pollard jonathan 2007 don t set shared file descriptors to non blocking i o mode retrieved 2017 09 21 v t e object capability security concepts principle of least privilege polp confused deputy problem ambient authority file descriptor c list object capability model capability based security capability based addressing zooko s triangle petnames operating systems kernels capsicum fuchsia genode gnosis keykos eros capros hydra imax 432 midori nltss sel4 programming languages cajita e joe e joule file systems tahoe lafs specialised hardware biin cambridge cap flex ibm system 38 intel iapx 432 plessey system 250 retrieved from https en wikipedia org w index php title file_descriptor oldid 1115665100 categories posix unix file system technology hidden categories articles with short description short description is different from wikidata navigation menu personal tools not logged in talk contributions create account log in namespaces article talk english views read edit view history more search navigation main page contents current events random article about wikipedia contact us donate contribute help learn to edit community portal recent changes upload file tools what links here related changes upload file special pages permanent link page information cite this page wikidata item print export download as pdf printable version languages čeština deutsch español فارسی français galego 한국어 italiano 日本語 oʻzbekcha ўзбекча polski português русский slovenčina svenska українська tiếng việt 中文 edit links this page was last edited on 12 october 2022 at 15 43 utc text is available under the creative commons attribution sharealike license 3 0 additional terms may apply by using this site you agree to the terms of use and privacy policy wikipedia is a registered trademark of the wikimedia foundation inc a non profit organization privacy policy about wikipedia disclaimers contact wikipedia mobile view developers statistics cookie statement
|