#include <mach/doubleagent_mig_server.h>

mach/doubleagent_mig_server.h Kernel.framework

includes: Kernel/string.h, Kernel/mach/ndr.h, Kernel/mach/boolean.h, Kernel/mach/kern_return.h, Kernel/mach/notify.h, mach/mach_types.h, mach/message.h, Kernel/mach/mig_errors.h, mach/port.h, Availability.h, Kernel/mach/std_types.h, Kernel/mach/mig.h, Kernel/mach/mig.h, mach/mach_types.h, Kernel/mach/doubleagent_types.h
6 functions · 3 macros · 1 struct · 1 variable

macro_doubleagent_server_

#define _doubleagent_server_ 

macrodoubleagent_MSG_COUNT

#define doubleagent_MSG_COUNT 4

functiondoubleagent_lookup_xattr

extern MIG_SERVER_ROUTINE kern_return_t doubleagent_lookup_xattr(
	mach_port_t server,
	mach_port_t file_port,
	/* fileport */
	int64_t file_size,
	/* AD file size */
	xattrname name,
	/* xattr name to lookup */
	int *err, /* out */
	/* error value */
	uint64_t *value_offset, /* out */
	/* returned xattr offset returned xattr length */
	uint64_t *value_length /* out */
)
MIG routine from mach/doubleagent_mig.defs
claude-fable-5, 2026-08-24 · not from Apple sources · verified against xnu osfmk/mach/doubleagent_mig.defs, bsd/vfs/vfs_xattr.c
Server-interface routine of the doubleagent MIG subsystem (subsystem id 6300), implemented by the user-space doubleagentd daemon. The kernel's default extended-attribute handler (bsd/vfs/vfs_xattr.c) calls it for filesystems that store xattrs in AppleDouble ("._") files; file_port is a fileport for the AppleDouble file and file_size its current size. Looks up the extended attribute named name and returns its location: err receives an errno value, and value_offset/value_length give the offset and length of the attribute value within the file.

functiondoubleagent_allocate_xattr

extern MIG_SERVER_ROUTINE kern_return_t doubleagent_allocate_xattr(
	mach_port_t server,
	mach_port_t file_port,
	/* fileport */
	int64_t file_size,
	/* AD file size */
	xattrname name,
	/* xattr name to allocate */
	uint64_t size,
	/* xattr size to allocate */
	uint32_t options,
	/* how to allocate */
	int *err, /* out */
	/* error value returned xattr offset */
	uint64_t *value_offset /* out */
)
MIG routine from mach/doubleagent_mig.defs
claude-fable-5, 2026-08-24 · not from Apple sources · verified against xnu osfmk/mach/doubleagent_mig.defs, bsd/vfs/vfs_xattr.c
Server-interface routine of the doubleagent MIG subsystem (subsystem id 6300), implemented by the user-space doubleagentd daemon. The kernel's default extended-attribute handler (bsd/vfs/vfs_xattr.c) calls it for filesystems that store xattrs in AppleDouble ("._") files; file_port is a fileport for the AppleDouble file and file_size its current size. Allocates space of the given size for the extended attribute named name, per options; err receives an errno value and value_offset the file offset at which the caller writes the attribute value.

functiondoubleagent_list_xattrs

extern MIG_SERVER_ROUTINE kern_return_t doubleagent_list_xattrs(
	mach_port_t server,
	mach_port_t file_port,
	/* fileport */
	int64_t file_size,
	/* AD file size */
	int *err, /* out */
	/* error value listxattr result struct */
	listxattrs_result_t *result /* out */
)
MIG routine from mach/doubleagent_mig.defs
claude-fable-5, 2026-08-24 · not from Apple sources · verified against xnu osfmk/mach/doubleagent_mig.defs, bsd/vfs/vfs_xattr.c
Server-interface routine of the doubleagent MIG subsystem (subsystem id 6300), implemented by the user-space doubleagentd daemon. The kernel's default extended-attribute handler (bsd/vfs/vfs_xattr.c) calls it for filesystems that store xattrs in AppleDouble ("._") files; file_port is a fileport for the AppleDouble file and file_size its current size. Lists the extended attributes present in the AppleDouble file; err receives an errno value and result a packed listxattrs_result_t holding the attribute names.

functiondoubleagent_remove_xattr

extern MIG_SERVER_ROUTINE kern_return_t doubleagent_remove_xattr(
	mach_port_t server,
	mach_port_t file_port,
	/* fileport */
	int64_t file_size,
	/* AD file size */
	xattrname name,
	/* xattr name to remove */
	int *err, /* out */
	/* error value true if we've removed the last xattr in file */
	boolean_t *is_empty /* out */
)
MIG routine from mach/doubleagent_mig.defs
claude-fable-5, 2026-08-24 · not from Apple sources · verified against xnu osfmk/mach/doubleagent_mig.defs, bsd/vfs/vfs_xattr.c
Server-interface routine of the doubleagent MIG subsystem (subsystem id 6300), implemented by the user-space doubleagentd daemon. The kernel's default extended-attribute handler (bsd/vfs/vfs_xattr.c) calls it for filesystems that store xattrs in AppleDouble ("._") files; file_port is a fileport for the AppleDouble file and file_size its current size. Removes the extended attribute named name; err receives an errno value and is_empty is set TRUE when the last attribute has been removed, letting the caller delete the now-empty AppleDouble file.

functiondoubleagent_server

extern boolean_t doubleagent_server(
	mach_msg_header_t *InHeadP,
	mach_msg_header_t *OutHeadP
)
claude-fable-5, 2026-08-24 · not from Apple sources · verified against xnu osfmk/mach/doubleagent_mig.defs
MIG-generated demultiplexer for the doubleagent subsystem (osfmk/mach/doubleagent_mig.defs). If the request message at InHeadP belongs to the subsystem, calls the matching handler (doubleagent_lookup_xattr, doubleagent_allocate_xattr, doubleagent_list_xattrs, doubleagent_remove_xattr), formats the reply message at OutHeadP, and returns TRUE; returns FALSE, with a MIG_BAD_ID error reply, for messages that do not belong to the subsystem.

functiondoubleagent_server_routine

extern mig_routine_t doubleagent_server_routine(mach_msg_header_t *InHeadP)
claude-fable-5, 2026-08-24 · not from Apple sources · verified against xnu osfmk/mach/doubleagent_mig.defs
Returns the MIG dispatch function for the doubleagent subsystem request whose msgh_id is found in InHeadP, or a null pointer if the message is not a request of the subsystem. Alternative to the combined demultiplexer for servers that look up and invoke the handler themselves.

structdoubleagent_subsystem

Description of this subsystem, for use in direct RPC
size 192, align 8
mig_server_routine_tserverServer routine
mach_msg_id_tstartMin routine number
mach_msg_id_tendMax routine number + 1
unsigned intmaxsizeMax msg size
vm_address_treservedReserved
struct routine_descriptor[4]routine

variabledoubleagent_subsystem

extern const struct doubleagent_subsystem { mig_server_routine_t server; /* Server routine */ mach_msg_id_t start; /* Min routine number */ mach_msg_id_t end; /* Max routine number + 1 */ unsigned int maxsize; /* Max msg size */ vm_address_t reserved; /* Reserved */ struct routine_descriptor /* Array of routine descriptors */ routine[4]; } doubleagent_subsystem

macrosubsystem_to_name_map_doubleagent

#define subsystem_to_name_map_doubleagent { "doubleagent_lookup_xattr", 6300 },
    { "doubleagent_allocate_xattr", 6301 },
    { "doubleagent_list_xattrs", 6302 },
    { "doubleagent_remove_xattr", 6303 }