Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Register
  • Sign in
  • G GLib
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 851
    • Issues 851
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 47
    • Merge requests 47
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • GNOMEGNOME
  • GLib
  • Merge requests
  • !2445

gio: Add some AF_UNIX support on Windows

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Marc-André Lureau requested to merge malureau/glib:win32-afunix into main Jan 19, 2022
  • Overview 33
  • Commits 11
  • Pipelines 11
  • Changes 16

Teach GIO to handle AF_UNIX sockets on Windows.

AF_UNIX are available in Windows 10 since Build 17063. The have a number of limitations compared to other POSIX/BSD socket implementations (in particular, no SCM_RIGHTS, and very limited credential passing). However, they are quite attractive as an alternative to opening a local TCP port for local socket communications (and DBus), as they should be more secure and not directly reachable from a web browser! Looking up peer process id is also simpler and a bit safer than with TCP sockets.

There are also interesting use cases that possibles, since they can communicate with WSL2 systems.

For testing purposes, I implemented a _g_win32_socketpair() (similar to the ocaml implementation from https://github.com/ocaml-multicore/ocaml-multicore/blob/5.00/otherlibs/win32unix/socketpair.c). I wish this function could be provided publicly by glib, since it's fairly common to want it in various projects for inter-thread communications, or testing. What do you think? There is no WSAError to errno conversion at this point. Perhaps the function could use GError instead.

Fixes: #2487 (closed)

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: win32-afunix