blob: dd11a93284790cb48e5979bc167dd52cf61ac0c7 [file] [log] [blame]
Elliott Hughes180edef2023-11-02 00:08:05 +00001/*
2 * This file is auto-generated. Modifications will be lost.
3 *
4 * See https://android.googlesource.com/platform/bionic/+/master/libc/kernel/
5 * for more information.
6 */
Ben Cheng655a7c02013-10-16 16:09:24 -07007#ifndef _UAPI_LINUX_AUTO_FS_H
8#define _UAPI_LINUX_AUTO_FS_H
9#include <linux/types.h>
Christopher Ferris6a9755d2017-01-13 14:09:31 -080010#include <linux/limits.h>
Christopher Ferris6a9755d2017-01-13 14:09:31 -080011#include <sys/ioctl.h>
Christopher Ferris9ce28842018-10-25 12:11:39 -070012#define AUTOFS_PROTO_VERSION 5
13#define AUTOFS_MIN_PROTO_VERSION 3
14#define AUTOFS_MAX_PROTO_VERSION 5
Christopher Ferris24f97eb2019-05-20 12:58:13 -070015#define AUTOFS_PROTO_SUBVERSION 5
Christopher Ferris6a9755d2017-01-13 14:09:31 -080016#if defined(__ia64__) || defined(__alpha__)
Ben Cheng655a7c02013-10-16 16:09:24 -070017typedef unsigned long autofs_wqt_t;
18#else
19typedef unsigned int autofs_wqt_t;
Christopher Ferris6a9755d2017-01-13 14:09:31 -080020#endif
Ben Cheng655a7c02013-10-16 16:09:24 -070021#define autofs_ptype_missing 0
22#define autofs_ptype_expire 1
23struct autofs_packet_hdr {
Christopher Ferris6a9755d2017-01-13 14:09:31 -080024 int proto_version;
Tao Baod7db5942015-01-28 10:07:51 -080025 int type;
Ben Cheng655a7c02013-10-16 16:09:24 -070026};
27struct autofs_packet_missing {
Christopher Ferris6a9755d2017-01-13 14:09:31 -080028 struct autofs_packet_hdr hdr;
Tao Baod7db5942015-01-28 10:07:51 -080029 autofs_wqt_t wait_queue_token;
30 int len;
31 char name[NAME_MAX + 1];
Christopher Ferris6a9755d2017-01-13 14:09:31 -080032};
Ben Cheng655a7c02013-10-16 16:09:24 -070033struct autofs_packet_expire {
Tao Baod7db5942015-01-28 10:07:51 -080034 struct autofs_packet_hdr hdr;
35 int len;
Christopher Ferris6a9755d2017-01-13 14:09:31 -080036 char name[NAME_MAX + 1];
Ben Cheng655a7c02013-10-16 16:09:24 -070037};
Christopher Ferris525ce912017-07-26 13:12:53 -070038#define AUTOFS_IOCTL 0x93
39enum {
40 AUTOFS_IOC_READY_CMD = 0x60,
41 AUTOFS_IOC_FAIL_CMD,
42 AUTOFS_IOC_CATATONIC_CMD,
43 AUTOFS_IOC_PROTOVER_CMD,
44 AUTOFS_IOC_SETTIMEOUT_CMD,
45 AUTOFS_IOC_EXPIRE_CMD,
46};
47#define AUTOFS_IOC_READY _IO(AUTOFS_IOCTL, AUTOFS_IOC_READY_CMD)
48#define AUTOFS_IOC_FAIL _IO(AUTOFS_IOCTL, AUTOFS_IOC_FAIL_CMD)
49#define AUTOFS_IOC_CATATONIC _IO(AUTOFS_IOCTL, AUTOFS_IOC_CATATONIC_CMD)
50#define AUTOFS_IOC_PROTOVER _IOR(AUTOFS_IOCTL, AUTOFS_IOC_PROTOVER_CMD, int)
51#define AUTOFS_IOC_SETTIMEOUT32 _IOWR(AUTOFS_IOCTL, AUTOFS_IOC_SETTIMEOUT_CMD, compat_ulong_t)
52#define AUTOFS_IOC_SETTIMEOUT _IOWR(AUTOFS_IOCTL, AUTOFS_IOC_SETTIMEOUT_CMD, unsigned long)
53#define AUTOFS_IOC_EXPIRE _IOR(AUTOFS_IOCTL, AUTOFS_IOC_EXPIRE_CMD, struct autofs_packet_expire)
Christopher Ferris9ce28842018-10-25 12:11:39 -070054#define AUTOFS_EXP_NORMAL 0x00
55#define AUTOFS_EXP_IMMEDIATE 0x01
56#define AUTOFS_EXP_LEAVES 0x02
57#define AUTOFS_EXP_FORCED 0x04
58#define AUTOFS_TYPE_ANY 0U
59#define AUTOFS_TYPE_INDIRECT 1U
60#define AUTOFS_TYPE_DIRECT 2U
61#define AUTOFS_TYPE_OFFSET 4U
62enum autofs_notify {
63 NFY_NONE,
64 NFY_MOUNT,
65 NFY_EXPIRE
66};
67#define autofs_ptype_expire_multi 2
68#define autofs_ptype_missing_indirect 3
69#define autofs_ptype_expire_indirect 4
70#define autofs_ptype_missing_direct 5
71#define autofs_ptype_expire_direct 6
72struct autofs_packet_expire_multi {
73 struct autofs_packet_hdr hdr;
74 autofs_wqt_t wait_queue_token;
75 int len;
76 char name[NAME_MAX + 1];
77};
78union autofs_packet_union {
79 struct autofs_packet_hdr hdr;
80 struct autofs_packet_missing missing;
81 struct autofs_packet_expire expire;
82 struct autofs_packet_expire_multi expire_multi;
83};
84struct autofs_v5_packet {
85 struct autofs_packet_hdr hdr;
86 autofs_wqt_t wait_queue_token;
87 __u32 dev;
88 __u64 ino;
89 __u32 uid;
90 __u32 gid;
91 __u32 pid;
92 __u32 tgid;
93 __u32 len;
94 char name[NAME_MAX + 1];
95};
96typedef struct autofs_v5_packet autofs_packet_missing_indirect_t;
97typedef struct autofs_v5_packet autofs_packet_expire_indirect_t;
98typedef struct autofs_v5_packet autofs_packet_missing_direct_t;
99typedef struct autofs_v5_packet autofs_packet_expire_direct_t;
100union autofs_v5_packet_union {
101 struct autofs_packet_hdr hdr;
102 struct autofs_v5_packet v5_packet;
103 autofs_packet_missing_indirect_t missing_indirect;
104 autofs_packet_expire_indirect_t expire_indirect;
105 autofs_packet_missing_direct_t missing_direct;
106 autofs_packet_expire_direct_t expire_direct;
107};
108enum {
109 AUTOFS_IOC_EXPIRE_MULTI_CMD = 0x66,
110 AUTOFS_IOC_PROTOSUBVER_CMD,
111 AUTOFS_IOC_ASKUMOUNT_CMD = 0x70,
112};
113#define AUTOFS_IOC_EXPIRE_MULTI _IOW(AUTOFS_IOCTL, AUTOFS_IOC_EXPIRE_MULTI_CMD, int)
114#define AUTOFS_IOC_PROTOSUBVER _IOR(AUTOFS_IOCTL, AUTOFS_IOC_PROTOSUBVER_CMD, int)
115#define AUTOFS_IOC_ASKUMOUNT _IOR(AUTOFS_IOCTL, AUTOFS_IOC_ASKUMOUNT_CMD, int)
Ben Cheng655a7c02013-10-16 16:09:24 -0700116#endif