Skip to content

varlink: document file descriptor passing naming convention #235

Description

@Skyb0rg007

systemd currently uses an argument convention for all Varlink services that pass file descriptors: xxxFileDescriptor: int means "send a file descriptor along with the message, where the integer represents the index in the SCM_RIGHTS list".

Documenting a convention allows programs such as code generators to automatically create safe interfaces for programming languages that distinguish file descriptors from raw integers.

Alternatives like adding a fd type wouldn't work, since there's nothing distinguishing a file descriptor index from a normal JSON integer on the wire. Thus this feature can really only be enforced by convention.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions