Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

Unix domain socket

From Wikipedia, the free encyclopedia
(Redirected fromUnix domain sockets)
Communications endpoint for exchanging data between processes

AUnix domain socket (UDS),local socket, orinter-process communication (IPC)socket is acommunication endpoint forexchanging data between processes executing in the sameUnix orUnix-like operating system.

The nameUnix domain socket refers to thedomain argument valueAF_UNIX that is passed to the function that creates a socketsystem resource. The same communication domain is also selected byAF_LOCAL.[1]

Validtype argument values for a UDS are:[1]

  • SOCK_STREAM (compare toTCP) – for a stream-oriented socket
  • SOCK_DGRAM (compare toUDP) – for a datagram-oriented socket that preserves message boundaries (as on most UNIX implementations, UNIX domain datagram sockets are always reliable and don't reorder datagrams)
  • SOCK_SEQPACKET (compare toSCTP) – for a sequenced-packet socket that is connection-oriented, preserves message boundaries, and delivers messages in the order that they were sent

The UDS facility is a standard component of aPOSIXoperating system.

TheAPI for a UDS is similar to that of anInternet socket, but rather than using an underlying network protocol, all communication occurs entirely within the operating systemkernel. A UDS may use the file system as its addressnamespace. Some operating systems, likeLinux, offer additional namespaces. Processes reference a UDS as a file systeminode, so two processes can communicate by opening the same socket.

In addition to sending data, processes may sendfile descriptors across a UDS connection using thesendmsg() andrecvmsg() system calls. This allows the sending processes to grant the receiving process access to a file descriptor for which the receiving process otherwise does not have access.[2][3] This can be used to implement a rudimentary form ofcapability-based security.[4]

See also

[edit]
  • Network socket – Software-based endpoint of network communications
  • Berkeley sockets – Inter-process communication API
  • Pipeline (Unix) – Mechanism for inter-process communication using message passing
  • Netlink – Linux kernel interface for inter-process communication between processes

References

[edit]
  1. ^ab"Linux Programmer's Manual (unix - sockets for local interprocess communication)". 30 April 2018. Retrieved22 February 2019.
  2. ^"Archive of the "Postfix Discussions" mailing list". 30 September 2000. Archived fromthe original on 18 May 2013. Retrieved29 September 2014.
  3. ^"Linux man page - cmsg(3): access ancillary data". Retrieved9 October 2018.
  4. ^""Secure Programming for Linux and Unix HOWTO", Section 3.4 "Sockets and Network Connections"".dwheeler.com. David A. Wheeler. 22 August 2004. Retrieved29 September 2014.

External links

[edit]
Methods
Protocols
andstandards
Software libraries
andframeworks

Retrieved from "https://en.wikipedia.org/w/index.php?title=Unix_domain_socket&oldid=1324638509"
Categories:
Hidden categories:

[8]ページ先頭

©2009-2026 Movatter.jp