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.
systemd currently uses an argument convention for all Varlink services that pass file descriptors:
xxxFileDescriptor: intmeans "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
fdtype 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.