1 // Generated by jextract
   2 
   3 package jdk.internal.ffi.generated.iouring;
   4 
   5 import java.lang.invoke.*;
   6 import java.lang.foreign.*;
   7 import java.nio.ByteOrder;
   8 import java.util.*;
   9 import java.util.function.*;
  10 import java.util.stream.*;
  11 
  12 import static java.lang.foreign.ValueLayout.*;
  13 import static java.lang.foreign.MemoryLayout.PathElement.*;
  14 
  15 /**
  16  * {@snippet lang=c :
  17  * struct io_uring_sqe {
  18  *     __u8 opcode;
  19  *     __u8 flags;
  20  *     __u16 ioprio;
  21  *     __s32 fd;
  22  *     union {
  23  *         __u64 off;
  24  *         __u64 addr2;
  25  *         struct {
  26  *             __u32 cmd_op;
  27  *             __u32 __pad1;
  28  *         };
  29  *     };
  30  *     union {
  31  *         __u64 addr;
  32  *         __u64 splice_off_in;
  33  *     };
  34  *     __u32 len;
  35  *     union {
  36  *         __kernel_rwf_t rw_flags;
  37  *         __u32 fsync_flags;
  38  *         __u16 poll_events;
  39  *         __u32 poll32_events;
  40  *         __u32 sync_range_flags;
  41  *         __u32 msg_flags;
  42  *         __u32 timeout_flags;
  43  *         __u32 accept_flags;
  44  *         __u32 cancel_flags;
  45  *         __u32 open_flags;
  46  *         __u32 statx_flags;
  47  *         __u32 fadvise_advice;
  48  *         __u32 splice_flags;
  49  *         __u32 rename_flags;
  50  *         __u32 unlink_flags;
  51  *         __u32 hardlink_flags;
  52  *         __u32 xattr_flags;
  53  *         __u32 msg_ring_flags;
  54  *         __u32 uring_cmd_flags;
  55  *     };
  56  *     __u64 user_data;
  57  *     union {
  58  *         __u16 buf_index;
  59  *         __u16 buf_group;
  60  *     };
  61  *     __u16 personality;
  62  *     union {
  63  *         __s32 splice_fd_in;
  64  *         __u32 file_index;
  65  *         struct {
  66  *             __u16 addr_len;
  67  *             __u16 __pad3[1];
  68  *         };
  69  *     };
  70  *     union {
  71  *         struct {
  72  *             __u64 addr3;
  73  *             __u64 __pad2[1];
  74  *         };
  75  *         __u8 cmd[0];
  76  *     };
  77  * }
  78  * }
  79  */
  80 @SuppressWarnings("restricted") public class io_uring_sqe {
  81 
  82     io_uring_sqe() {
  83         // Suppresses public default constructor, ensuring non-instantiability,
  84         // but allows generated subclasses in same package.
  85     }
  86 
  87     private static final GroupLayout $LAYOUT = MemoryLayout.structLayout(
  88         iouring_h.C_CHAR.withName("opcode"),
  89         iouring_h.C_CHAR.withName("flags"),
  90         iouring_h.C_SHORT.withName("ioprio"),
  91         iouring_h.C_INT.withName("fd"),
  92         MemoryLayout.unionLayout(
  93             iouring_h.C_LONG_LONG.withName("off"),
  94             iouring_h.C_LONG_LONG.withName("addr2"),
  95             MemoryLayout.structLayout(
  96                 iouring_h.C_INT.withName("cmd_op"),
  97                 iouring_h.C_INT.withName("__pad1")
  98             ).withName("$anon$39:3")
  99         ).withName("$anon$36:2"),
 100         MemoryLayout.unionLayout(
 101             iouring_h.C_LONG_LONG.withName("addr"),
 102             iouring_h.C_LONG_LONG.withName("splice_off_in")
 103         ).withName("$anon$44:2"),
 104         iouring_h.C_INT.withName("len"),
 105         MemoryLayout.unionLayout(
 106             iouring_h.C_INT.withName("rw_flags"),
 107             iouring_h.C_INT.withName("fsync_flags"),
 108             iouring_h.C_SHORT.withName("poll_events"),
 109             iouring_h.C_INT.withName("poll32_events"),
 110             iouring_h.C_INT.withName("sync_range_flags"),
 111             iouring_h.C_INT.withName("msg_flags"),
 112             iouring_h.C_INT.withName("timeout_flags"),
 113             iouring_h.C_INT.withName("accept_flags"),
 114             iouring_h.C_INT.withName("cancel_flags"),
 115             iouring_h.C_INT.withName("open_flags"),
 116             iouring_h.C_INT.withName("statx_flags"),
 117             iouring_h.C_INT.withName("fadvise_advice"),
 118             iouring_h.C_INT.withName("splice_flags"),
 119             iouring_h.C_INT.withName("rename_flags"),
 120             iouring_h.C_INT.withName("unlink_flags"),
 121             iouring_h.C_INT.withName("hardlink_flags"),
 122             iouring_h.C_INT.withName("xattr_flags"),
 123             iouring_h.C_INT.withName("msg_ring_flags"),
 124             iouring_h.C_INT.withName("uring_cmd_flags")
 125         ).withName("$anon$49:2"),
 126         iouring_h.C_LONG_LONG.withName("user_data"),
 127         MemoryLayout.unionLayout(
 128             iouring_h.C_SHORT.withByteAlignment(1).withName("buf_index"),
 129             iouring_h.C_SHORT.withByteAlignment(1).withName("buf_group")
 130         ).withName("$anon$72:2"),
 131         iouring_h.C_SHORT.withName("personality"),
 132         MemoryLayout.unionLayout(
 133             iouring_h.C_INT.withName("splice_fd_in"),
 134             iouring_h.C_INT.withName("file_index"),
 135             MemoryLayout.structLayout(
 136                 iouring_h.C_SHORT.withName("addr_len"),
 137                 MemoryLayout.sequenceLayout(1, iouring_h.C_SHORT).withName("__pad3")
 138             ).withName("$anon$83:3")
 139         ).withName("$anon$80:2"),
 140         MemoryLayout.unionLayout(
 141             MemoryLayout.structLayout(
 142                 iouring_h.C_LONG_LONG.withName("addr3"),
 143                 MemoryLayout.sequenceLayout(1, iouring_h.C_LONG_LONG).withName("__pad2")
 144             ).withName("$anon$89:3"),
 145             MemoryLayout.sequenceLayout(0, iouring_h.C_CHAR).withName("cmd")
 146         ).withName("$anon$88:2")
 147     ).withName("io_uring_sqe");
 148 
 149     public static final GroupLayout $LAYOUT() {
 150         return $LAYOUT;
 151     }
 152 
 153     private static final long opcode$OFFSET = 0;
 154     private static final OfByte opcode$LAYOUT = (OfByte)$LAYOUT.select(groupElement("opcode"));
 155 
 156     /**
 157      * Getter for field:
 158      * {@snippet lang=c :
 159      * __u8 opcode
 160      * }
 161      */
 162     public static byte opcode(MemorySegment struct) {
 163         return struct.get(opcode$LAYOUT, opcode$OFFSET);
 164     }
 165 
 166     /**
 167      * Setter for field:
 168      * {@snippet lang=c :
 169      * __u8 opcode
 170      * }
 171      */
 172     public static void opcode(MemorySegment struct, byte fieldValue) {
 173         struct.set(opcode$LAYOUT, opcode$OFFSET, fieldValue);
 174     }
 175 
 176     private static final long flags$OFFSET = 1;
 177     private static final OfByte flags$LAYOUT = (OfByte)$LAYOUT.select(groupElement("flags"));
 178 
 179     /**
 180      * Getter for field:
 181      * {@snippet lang=c :
 182      * __u8 flags
 183      * }
 184      */
 185     public static byte flags(MemorySegment struct) {
 186         return struct.get(flags$LAYOUT, flags$OFFSET);
 187     }
 188 
 189     /**
 190      * Setter for field:
 191      * {@snippet lang=c :
 192      * __u8 flags
 193      * }
 194      */
 195     public static void flags(MemorySegment struct, byte fieldValue) {
 196         struct.set(flags$LAYOUT, flags$OFFSET, fieldValue);
 197     }
 198 
 199     private static final long ioprio$OFFSET = 2;
 200     private static final OfShort ioprio$LAYOUT = (OfShort)$LAYOUT.select(groupElement("ioprio"));
 201 
 202     /**
 203      * Getter for field:
 204      * {@snippet lang=c :
 205      * __u16 ioprio
 206      * }
 207      */
 208     public static short ioprio(MemorySegment struct) {
 209         return struct.get(ioprio$LAYOUT, ioprio$OFFSET);
 210     }
 211 
 212     /**
 213      * Setter for field:
 214      * {@snippet lang=c :
 215      * __u16 ioprio
 216      * }
 217      */
 218     public static void ioprio(MemorySegment struct, short fieldValue) {
 219         struct.set(ioprio$LAYOUT, ioprio$OFFSET, fieldValue);
 220     }
 221 
 222     private static final long fd$OFFSET = 4;
 223     private static final OfInt fd$LAYOUT = (OfInt)$LAYOUT.select(groupElement("fd"));
 224 
 225     /**
 226      * Getter for field:
 227      * {@snippet lang=c :
 228      * __s32 fd
 229      * }
 230      */
 231     public static int fd(MemorySegment struct) {
 232         return struct.get(fd$LAYOUT, fd$OFFSET);
 233     }
 234 
 235     /**
 236      * Setter for field:
 237      * {@snippet lang=c :
 238      * __s32 fd
 239      * }
 240      */
 241     public static void fd(MemorySegment struct, int fieldValue) {
 242         struct.set(fd$LAYOUT, fd$OFFSET, fieldValue);
 243     }
 244 
 245     private static final long off$OFFSET = 8;
 246     private static final OfLong off$LAYOUT = (OfLong)$LAYOUT.select(groupElement("$anon$36:2"), groupElement("off"));
 247 
 248     /**
 249      * Getter for field:
 250      * {@snippet lang=c :
 251      * __u64 off
 252      * }
 253      */
 254     public static long off(MemorySegment struct) {
 255         return struct.get(off$LAYOUT, off$OFFSET);
 256     }
 257 
 258     /**
 259      * Setter for field:
 260      * {@snippet lang=c :
 261      * __u64 off
 262      * }
 263      */
 264     public static void off(MemorySegment struct, long fieldValue) {
 265         struct.set(off$LAYOUT, off$OFFSET, fieldValue);
 266     }
 267 
 268     private static final long addr2$OFFSET = 8;
 269     private static final OfLong addr2$LAYOUT = (OfLong)$LAYOUT.select(groupElement("$anon$36:2"), groupElement("addr2"));
 270 
 271     /**
 272      * Getter for field:
 273      * {@snippet lang=c :
 274      * __u64 addr2
 275      * }
 276      */
 277     public static long addr2(MemorySegment struct) {
 278         return struct.get(addr2$LAYOUT, addr2$OFFSET);
 279     }
 280 
 281     /**
 282      * Setter for field:
 283      * {@snippet lang=c :
 284      * __u64 addr2
 285      * }
 286      */
 287     public static void addr2(MemorySegment struct, long fieldValue) {
 288         struct.set(addr2$LAYOUT, addr2$OFFSET, fieldValue);
 289     }
 290 
 291     private static final long cmd_op$OFFSET = 8;
 292     private static final OfInt cmd_op$LAYOUT = (OfInt)$LAYOUT.select(groupElement("$anon$36:2"), groupElement("$anon$39:3"), groupElement("cmd_op"));
 293 
 294     /**
 295      * Getter for field:
 296      * {@snippet lang=c :
 297      * __u32 cmd_op
 298      * }
 299      */
 300     public static int cmd_op(MemorySegment struct) {
 301         return struct.get(cmd_op$LAYOUT, cmd_op$OFFSET);
 302     }
 303 
 304     /**
 305      * Setter for field:
 306      * {@snippet lang=c :
 307      * __u32 cmd_op
 308      * }
 309      */
 310     public static void cmd_op(MemorySegment struct, int fieldValue) {
 311         struct.set(cmd_op$LAYOUT, cmd_op$OFFSET, fieldValue);
 312     }
 313 
 314     private static final long __pad1$OFFSET = 12;
 315     private static final OfInt __pad1$LAYOUT = (OfInt)$LAYOUT.select(groupElement("$anon$36:2"), groupElement("$anon$39:3"), groupElement("__pad1"));
 316 
 317     /**
 318      * Getter for field:
 319      * {@snippet lang=c :
 320      * __u32 __pad1
 321      * }
 322      */
 323     public static int __pad1(MemorySegment struct) {
 324         return struct.get(__pad1$LAYOUT, __pad1$OFFSET);
 325     }
 326 
 327     /**
 328      * Setter for field:
 329      * {@snippet lang=c :
 330      * __u32 __pad1
 331      * }
 332      */
 333     public static void __pad1(MemorySegment struct, int fieldValue) {
 334         struct.set(__pad1$LAYOUT, __pad1$OFFSET, fieldValue);
 335     }
 336 
 337     private static final long addr$OFFSET = 16;
 338     private static final OfLong addr$LAYOUT = (OfLong)$LAYOUT.select(groupElement("$anon$44:2"), groupElement("addr"));
 339 
 340     /**
 341      * Getter for field:
 342      * {@snippet lang=c :
 343      * __u64 addr
 344      * }
 345      */
 346     public static long addr(MemorySegment struct) {
 347         return struct.get(addr$LAYOUT, addr$OFFSET);
 348     }
 349 
 350     /**
 351      * Setter for field:
 352      * {@snippet lang=c :
 353      * __u64 addr
 354      * }
 355      */
 356     public static void addr(MemorySegment struct, long fieldValue) {
 357         struct.set(addr$LAYOUT, addr$OFFSET, fieldValue);
 358     }
 359 
 360     private static final long splice_off_in$OFFSET = 16;
 361     private static final OfLong splice_off_in$LAYOUT = (OfLong)$LAYOUT.select(groupElement("$anon$44:2"), groupElement("splice_off_in"));
 362 
 363     /**
 364      * Getter for field:
 365      * {@snippet lang=c :
 366      * __u64 splice_off_in
 367      * }
 368      */
 369     public static long splice_off_in(MemorySegment struct) {
 370         return struct.get(splice_off_in$LAYOUT, splice_off_in$OFFSET);
 371     }
 372 
 373     /**
 374      * Setter for field:
 375      * {@snippet lang=c :
 376      * __u64 splice_off_in
 377      * }
 378      */
 379     public static void splice_off_in(MemorySegment struct, long fieldValue) {
 380         struct.set(splice_off_in$LAYOUT, splice_off_in$OFFSET, fieldValue);
 381     }
 382 
 383     private static final long len$OFFSET = 24;
 384     private static final OfInt len$LAYOUT = (OfInt)$LAYOUT.select(groupElement("len"));
 385 
 386     /**
 387      * Getter for field:
 388      * {@snippet lang=c :
 389      * __u32 len
 390      * }
 391      */
 392     public static int len(MemorySegment struct) {
 393         return struct.get(len$LAYOUT, len$OFFSET);
 394     }
 395 
 396     /**
 397      * Setter for field:
 398      * {@snippet lang=c :
 399      * __u32 len
 400      * }
 401      */
 402     public static void len(MemorySegment struct, int fieldValue) {
 403         struct.set(len$LAYOUT, len$OFFSET, fieldValue);
 404     }
 405 
 406     private static final long rw_flags$OFFSET = 28;
 407     private static final OfInt rw_flags$LAYOUT = (OfInt)$LAYOUT.select(groupElement("$anon$49:2"), groupElement("rw_flags"));
 408 
 409     /**
 410      * Getter for field:
 411      * {@snippet lang=c :
 412      * __kernel_rwf_t rw_flags
 413      * }
 414      */
 415     public static int rw_flags(MemorySegment struct) {
 416         return struct.get(rw_flags$LAYOUT, rw_flags$OFFSET);
 417     }
 418 
 419     /**
 420      * Setter for field:
 421      * {@snippet lang=c :
 422      * __kernel_rwf_t rw_flags
 423      * }
 424      */
 425     public static void rw_flags(MemorySegment struct, int fieldValue) {
 426         struct.set(rw_flags$LAYOUT, rw_flags$OFFSET, fieldValue);
 427     }
 428 
 429     private static final long fsync_flags$OFFSET = 28;
 430     private static final OfInt fsync_flags$LAYOUT = (OfInt)$LAYOUT.select(groupElement("$anon$49:2"), groupElement("fsync_flags"));
 431 
 432     /**
 433      * Getter for field:
 434      * {@snippet lang=c :
 435      * __u32 fsync_flags
 436      * }
 437      */
 438     public static int fsync_flags(MemorySegment struct) {
 439         return struct.get(fsync_flags$LAYOUT, fsync_flags$OFFSET);
 440     }
 441 
 442     /**
 443      * Setter for field:
 444      * {@snippet lang=c :
 445      * __u32 fsync_flags
 446      * }
 447      */
 448     public static void fsync_flags(MemorySegment struct, int fieldValue) {
 449         struct.set(fsync_flags$LAYOUT, fsync_flags$OFFSET, fieldValue);
 450     }
 451 
 452     private static final long poll_events$OFFSET = 28;
 453     private static final OfShort poll_events$LAYOUT = (OfShort)$LAYOUT.select(groupElement("$anon$49:2"), groupElement("poll_events"));
 454 
 455     /**
 456      * Getter for field:
 457      * {@snippet lang=c :
 458      * __u16 poll_events
 459      * }
 460      */
 461     public static short poll_events(MemorySegment struct) {
 462         return struct.get(poll_events$LAYOUT, poll_events$OFFSET);
 463     }
 464 
 465     /**
 466      * Setter for field:
 467      * {@snippet lang=c :
 468      * __u16 poll_events
 469      * }
 470      */
 471     public static void poll_events(MemorySegment struct, short fieldValue) {
 472         struct.set(poll_events$LAYOUT, poll_events$OFFSET, fieldValue);
 473     }
 474 
 475     private static final long poll32_events$OFFSET = 28;
 476     private static final OfInt poll32_events$LAYOUT = (OfInt)$LAYOUT.select(groupElement("$anon$49:2"), groupElement("poll32_events"));
 477 
 478     /**
 479      * Getter for field:
 480      * {@snippet lang=c :
 481      * __u32 poll32_events
 482      * }
 483      */
 484     public static int poll32_events(MemorySegment struct) {
 485         return struct.get(poll32_events$LAYOUT, poll32_events$OFFSET);
 486     }
 487 
 488     /**
 489      * Setter for field:
 490      * {@snippet lang=c :
 491      * __u32 poll32_events
 492      * }
 493      */
 494     public static void poll32_events(MemorySegment struct, int fieldValue) {
 495         struct.set(poll32_events$LAYOUT, poll32_events$OFFSET, fieldValue);
 496     }
 497 
 498     private static final long sync_range_flags$OFFSET = 28;
 499     private static final OfInt sync_range_flags$LAYOUT = (OfInt)$LAYOUT.select(groupElement("$anon$49:2"), groupElement("sync_range_flags"));
 500 
 501     /**
 502      * Getter for field:
 503      * {@snippet lang=c :
 504      * __u32 sync_range_flags
 505      * }
 506      */
 507     public static int sync_range_flags(MemorySegment struct) {
 508         return struct.get(sync_range_flags$LAYOUT, sync_range_flags$OFFSET);
 509     }
 510 
 511     /**
 512      * Setter for field:
 513      * {@snippet lang=c :
 514      * __u32 sync_range_flags
 515      * }
 516      */
 517     public static void sync_range_flags(MemorySegment struct, int fieldValue) {
 518         struct.set(sync_range_flags$LAYOUT, sync_range_flags$OFFSET, fieldValue);
 519     }
 520 
 521     private static final long msg_flags$OFFSET = 28;
 522     private static final OfInt msg_flags$LAYOUT = (OfInt)$LAYOUT.select(groupElement("$anon$49:2"), groupElement("msg_flags"));
 523 
 524     /**
 525      * Getter for field:
 526      * {@snippet lang=c :
 527      * __u32 msg_flags
 528      * }
 529      */
 530     public static int msg_flags(MemorySegment struct) {
 531         return struct.get(msg_flags$LAYOUT, msg_flags$OFFSET);
 532     }
 533 
 534     /**
 535      * Setter for field:
 536      * {@snippet lang=c :
 537      * __u32 msg_flags
 538      * }
 539      */
 540     public static void msg_flags(MemorySegment struct, int fieldValue) {
 541         struct.set(msg_flags$LAYOUT, msg_flags$OFFSET, fieldValue);
 542     }
 543 
 544     private static final long timeout_flags$OFFSET = 28;
 545     private static final OfInt timeout_flags$LAYOUT = (OfInt)$LAYOUT.select(groupElement("$anon$49:2"), groupElement("timeout_flags"));
 546 
 547     /**
 548      * Getter for field:
 549      * {@snippet lang=c :
 550      * __u32 timeout_flags
 551      * }
 552      */
 553     public static int timeout_flags(MemorySegment struct) {
 554         return struct.get(timeout_flags$LAYOUT, timeout_flags$OFFSET);
 555     }
 556 
 557     /**
 558      * Setter for field:
 559      * {@snippet lang=c :
 560      * __u32 timeout_flags
 561      * }
 562      */
 563     public static void timeout_flags(MemorySegment struct, int fieldValue) {
 564         struct.set(timeout_flags$LAYOUT, timeout_flags$OFFSET, fieldValue);
 565     }
 566 
 567     private static final long accept_flags$OFFSET = 28;
 568     private static final OfInt accept_flags$LAYOUT = (OfInt)$LAYOUT.select(groupElement("$anon$49:2"), groupElement("accept_flags"));
 569 
 570     /**
 571      * Getter for field:
 572      * {@snippet lang=c :
 573      * __u32 accept_flags
 574      * }
 575      */
 576     public static int accept_flags(MemorySegment struct) {
 577         return struct.get(accept_flags$LAYOUT, accept_flags$OFFSET);
 578     }
 579 
 580     /**
 581      * Setter for field:
 582      * {@snippet lang=c :
 583      * __u32 accept_flags
 584      * }
 585      */
 586     public static void accept_flags(MemorySegment struct, int fieldValue) {
 587         struct.set(accept_flags$LAYOUT, accept_flags$OFFSET, fieldValue);
 588     }
 589 
 590     private static final long cancel_flags$OFFSET = 28;
 591     private static final OfInt cancel_flags$LAYOUT = (OfInt)$LAYOUT.select(groupElement("$anon$49:2"), groupElement("cancel_flags"));
 592 
 593     /**
 594      * Getter for field:
 595      * {@snippet lang=c :
 596      * __u32 cancel_flags
 597      * }
 598      */
 599     public static int cancel_flags(MemorySegment struct) {
 600         return struct.get(cancel_flags$LAYOUT, cancel_flags$OFFSET);
 601     }
 602 
 603     /**
 604      * Setter for field:
 605      * {@snippet lang=c :
 606      * __u32 cancel_flags
 607      * }
 608      */
 609     public static void cancel_flags(MemorySegment struct, int fieldValue) {
 610         struct.set(cancel_flags$LAYOUT, cancel_flags$OFFSET, fieldValue);
 611     }
 612 
 613     private static final long open_flags$OFFSET = 28;
 614     private static final OfInt open_flags$LAYOUT = (OfInt)$LAYOUT.select(groupElement("$anon$49:2"), groupElement("open_flags"));
 615 
 616     /**
 617      * Getter for field:
 618      * {@snippet lang=c :
 619      * __u32 open_flags
 620      * }
 621      */
 622     public static int open_flags(MemorySegment struct) {
 623         return struct.get(open_flags$LAYOUT, open_flags$OFFSET);
 624     }
 625 
 626     /**
 627      * Setter for field:
 628      * {@snippet lang=c :
 629      * __u32 open_flags
 630      * }
 631      */
 632     public static void open_flags(MemorySegment struct, int fieldValue) {
 633         struct.set(open_flags$LAYOUT, open_flags$OFFSET, fieldValue);
 634     }
 635 
 636     private static final long statx_flags$OFFSET = 28;
 637     private static final OfInt statx_flags$LAYOUT = (OfInt)$LAYOUT.select(groupElement("$anon$49:2"), groupElement("statx_flags"));
 638 
 639     /**
 640      * Getter for field:
 641      * {@snippet lang=c :
 642      * __u32 statx_flags
 643      * }
 644      */
 645     public static int statx_flags(MemorySegment struct) {
 646         return struct.get(statx_flags$LAYOUT, statx_flags$OFFSET);
 647     }
 648 
 649     /**
 650      * Setter for field:
 651      * {@snippet lang=c :
 652      * __u32 statx_flags
 653      * }
 654      */
 655     public static void statx_flags(MemorySegment struct, int fieldValue) {
 656         struct.set(statx_flags$LAYOUT, statx_flags$OFFSET, fieldValue);
 657     }
 658 
 659     private static final long fadvise_advice$OFFSET = 28;
 660     private static final OfInt fadvise_advice$LAYOUT = (OfInt)$LAYOUT.select(groupElement("$anon$49:2"), groupElement("fadvise_advice"));
 661 
 662     /**
 663      * Getter for field:
 664      * {@snippet lang=c :
 665      * __u32 fadvise_advice
 666      * }
 667      */
 668     public static int fadvise_advice(MemorySegment struct) {
 669         return struct.get(fadvise_advice$LAYOUT, fadvise_advice$OFFSET);
 670     }
 671 
 672     /**
 673      * Setter for field:
 674      * {@snippet lang=c :
 675      * __u32 fadvise_advice
 676      * }
 677      */
 678     public static void fadvise_advice(MemorySegment struct, int fieldValue) {
 679         struct.set(fadvise_advice$LAYOUT, fadvise_advice$OFFSET, fieldValue);
 680     }
 681 
 682     private static final long splice_flags$OFFSET = 28;
 683     private static final OfInt splice_flags$LAYOUT = (OfInt)$LAYOUT.select(groupElement("$anon$49:2"), groupElement("splice_flags"));
 684 
 685     /**
 686      * Getter for field:
 687      * {@snippet lang=c :
 688      * __u32 splice_flags
 689      * }
 690      */
 691     public static int splice_flags(MemorySegment struct) {
 692         return struct.get(splice_flags$LAYOUT, splice_flags$OFFSET);
 693     }
 694 
 695     /**
 696      * Setter for field:
 697      * {@snippet lang=c :
 698      * __u32 splice_flags
 699      * }
 700      */
 701     public static void splice_flags(MemorySegment struct, int fieldValue) {
 702         struct.set(splice_flags$LAYOUT, splice_flags$OFFSET, fieldValue);
 703     }
 704 
 705     private static final long rename_flags$OFFSET = 28;
 706     private static final OfInt rename_flags$LAYOUT = (OfInt)$LAYOUT.select(groupElement("$anon$49:2"), groupElement("rename_flags"));
 707 
 708     /**
 709      * Getter for field:
 710      * {@snippet lang=c :
 711      * __u32 rename_flags
 712      * }
 713      */
 714     public static int rename_flags(MemorySegment struct) {
 715         return struct.get(rename_flags$LAYOUT, rename_flags$OFFSET);
 716     }
 717 
 718     /**
 719      * Setter for field:
 720      * {@snippet lang=c :
 721      * __u32 rename_flags
 722      * }
 723      */
 724     public static void rename_flags(MemorySegment struct, int fieldValue) {
 725         struct.set(rename_flags$LAYOUT, rename_flags$OFFSET, fieldValue);
 726     }
 727 
 728     private static final long unlink_flags$OFFSET = 28;
 729     private static final OfInt unlink_flags$LAYOUT = (OfInt)$LAYOUT.select(groupElement("$anon$49:2"), groupElement("unlink_flags"));
 730 
 731     /**
 732      * Getter for field:
 733      * {@snippet lang=c :
 734      * __u32 unlink_flags
 735      * }
 736      */
 737     public static int unlink_flags(MemorySegment struct) {
 738         return struct.get(unlink_flags$LAYOUT, unlink_flags$OFFSET);
 739     }
 740 
 741     /**
 742      * Setter for field:
 743      * {@snippet lang=c :
 744      * __u32 unlink_flags
 745      * }
 746      */
 747     public static void unlink_flags(MemorySegment struct, int fieldValue) {
 748         struct.set(unlink_flags$LAYOUT, unlink_flags$OFFSET, fieldValue);
 749     }
 750 
 751     private static final long hardlink_flags$OFFSET = 28;
 752     private static final OfInt hardlink_flags$LAYOUT = (OfInt)$LAYOUT.select(groupElement("$anon$49:2"), groupElement("hardlink_flags"));
 753 
 754     /**
 755      * Getter for field:
 756      * {@snippet lang=c :
 757      * __u32 hardlink_flags
 758      * }
 759      */
 760     public static int hardlink_flags(MemorySegment struct) {
 761         return struct.get(hardlink_flags$LAYOUT, hardlink_flags$OFFSET);
 762     }
 763 
 764     /**
 765      * Setter for field:
 766      * {@snippet lang=c :
 767      * __u32 hardlink_flags
 768      * }
 769      */
 770     public static void hardlink_flags(MemorySegment struct, int fieldValue) {
 771         struct.set(hardlink_flags$LAYOUT, hardlink_flags$OFFSET, fieldValue);
 772     }
 773 
 774     private static final long xattr_flags$OFFSET = 28;
 775     private static final OfInt xattr_flags$LAYOUT = (OfInt)$LAYOUT.select(groupElement("$anon$49:2"), groupElement("xattr_flags"));
 776 
 777     /**
 778      * Getter for field:
 779      * {@snippet lang=c :
 780      * __u32 xattr_flags
 781      * }
 782      */
 783     public static int xattr_flags(MemorySegment struct) {
 784         return struct.get(xattr_flags$LAYOUT, xattr_flags$OFFSET);
 785     }
 786 
 787     /**
 788      * Setter for field:
 789      * {@snippet lang=c :
 790      * __u32 xattr_flags
 791      * }
 792      */
 793     public static void xattr_flags(MemorySegment struct, int fieldValue) {
 794         struct.set(xattr_flags$LAYOUT, xattr_flags$OFFSET, fieldValue);
 795     }
 796 
 797     private static final long msg_ring_flags$OFFSET = 28;
 798     private static final OfInt msg_ring_flags$LAYOUT = (OfInt)$LAYOUT.select(groupElement("$anon$49:2"), groupElement("msg_ring_flags"));
 799 
 800     /**
 801      * Getter for field:
 802      * {@snippet lang=c :
 803      * __u32 msg_ring_flags
 804      * }
 805      */
 806     public static int msg_ring_flags(MemorySegment struct) {
 807         return struct.get(msg_ring_flags$LAYOUT, msg_ring_flags$OFFSET);
 808     }
 809 
 810     /**
 811      * Setter for field:
 812      * {@snippet lang=c :
 813      * __u32 msg_ring_flags
 814      * }
 815      */
 816     public static void msg_ring_flags(MemorySegment struct, int fieldValue) {
 817         struct.set(msg_ring_flags$LAYOUT, msg_ring_flags$OFFSET, fieldValue);
 818     }
 819 
 820     private static final long uring_cmd_flags$OFFSET = 28;
 821     private static final OfInt uring_cmd_flags$LAYOUT = (OfInt)$LAYOUT.select(groupElement("$anon$49:2"), groupElement("uring_cmd_flags"));
 822 
 823     /**
 824      * Getter for field:
 825      * {@snippet lang=c :
 826      * __u32 uring_cmd_flags
 827      * }
 828      */
 829     public static int uring_cmd_flags(MemorySegment struct) {
 830         return struct.get(uring_cmd_flags$LAYOUT, uring_cmd_flags$OFFSET);
 831     }
 832 
 833     /**
 834      * Setter for field:
 835      * {@snippet lang=c :
 836      * __u32 uring_cmd_flags
 837      * }
 838      */
 839     public static void uring_cmd_flags(MemorySegment struct, int fieldValue) {
 840         struct.set(uring_cmd_flags$LAYOUT, uring_cmd_flags$OFFSET, fieldValue);
 841     }
 842 
 843     private static final long user_data$OFFSET = 32;
 844     private static final OfLong user_data$LAYOUT = (OfLong)$LAYOUT.select(groupElement("user_data"));
 845 
 846     /**
 847      * Getter for field:
 848      * {@snippet lang=c :
 849      * __u64 user_data
 850      * }
 851      */
 852     public static long user_data(MemorySegment struct) {
 853         return struct.get(user_data$LAYOUT, user_data$OFFSET);
 854     }
 855 
 856     /**
 857      * Setter for field:
 858      * {@snippet lang=c :
 859      * __u64 user_data
 860      * }
 861      */
 862     public static void user_data(MemorySegment struct, long fieldValue) {
 863         struct.set(user_data$LAYOUT, user_data$OFFSET, fieldValue);
 864     }
 865 
 866     private static final long buf_index$OFFSET = 40;
 867     private static final OfShort buf_index$LAYOUT = (OfShort)$LAYOUT.select(groupElement("$anon$72:2"), groupElement("buf_index"));
 868 
 869     /**
 870      * Getter for field:
 871      * {@snippet lang=c :
 872      * __u16 buf_index
 873      * }
 874      */
 875     public static short buf_index(MemorySegment struct) {
 876         return struct.get(buf_index$LAYOUT, buf_index$OFFSET);
 877     }
 878 
 879     /**
 880      * Setter for field:
 881      * {@snippet lang=c :
 882      * __u16 buf_index
 883      * }
 884      */
 885     public static void buf_index(MemorySegment struct, short fieldValue) {
 886         struct.set(buf_index$LAYOUT, buf_index$OFFSET, fieldValue);
 887     }
 888 
 889     private static final long buf_group$OFFSET = 40;
 890     private static final OfShort buf_group$LAYOUT = (OfShort)$LAYOUT.select(groupElement("$anon$72:2"), groupElement("buf_group"));
 891 
 892     /**
 893      * Getter for field:
 894      * {@snippet lang=c :
 895      * __u16 buf_group
 896      * }
 897      */
 898     public static short buf_group(MemorySegment struct) {
 899         return struct.get(buf_group$LAYOUT, buf_group$OFFSET);
 900     }
 901 
 902     /**
 903      * Setter for field:
 904      * {@snippet lang=c :
 905      * __u16 buf_group
 906      * }
 907      */
 908     public static void buf_group(MemorySegment struct, short fieldValue) {
 909         struct.set(buf_group$LAYOUT, buf_group$OFFSET, fieldValue);
 910     }
 911 
 912     private static final long personality$OFFSET = 42;
 913     private static final OfShort personality$LAYOUT = (OfShort)$LAYOUT.select(groupElement("personality"));
 914 
 915     /**
 916      * Getter for field:
 917      * {@snippet lang=c :
 918      * __u16 personality
 919      * }
 920      */
 921     public static short personality(MemorySegment struct) {
 922         return struct.get(personality$LAYOUT, personality$OFFSET);
 923     }
 924 
 925     /**
 926      * Setter for field:
 927      * {@snippet lang=c :
 928      * __u16 personality
 929      * }
 930      */
 931     public static void personality(MemorySegment struct, short fieldValue) {
 932         struct.set(personality$LAYOUT, personality$OFFSET, fieldValue);
 933     }
 934 
 935     private static final long splice_fd_in$OFFSET = 44;
 936     private static final OfInt splice_fd_in$LAYOUT = (OfInt)$LAYOUT.select(groupElement("$anon$80:2"), groupElement("splice_fd_in"));
 937 
 938     /**
 939      * Getter for field:
 940      * {@snippet lang=c :
 941      * __s32 splice_fd_in
 942      * }
 943      */
 944     public static int splice_fd_in(MemorySegment struct) {
 945         return struct.get(splice_fd_in$LAYOUT, splice_fd_in$OFFSET);
 946     }
 947 
 948     /**
 949      * Setter for field:
 950      * {@snippet lang=c :
 951      * __s32 splice_fd_in
 952      * }
 953      */
 954     public static void splice_fd_in(MemorySegment struct, int fieldValue) {
 955         struct.set(splice_fd_in$LAYOUT, splice_fd_in$OFFSET, fieldValue);
 956     }
 957 
 958     private static final long file_index$OFFSET = 44;
 959     private static final OfInt file_index$LAYOUT = (OfInt)$LAYOUT.select(groupElement("$anon$80:2"), groupElement("file_index"));
 960 
 961     /**
 962      * Getter for field:
 963      * {@snippet lang=c :
 964      * __u32 file_index
 965      * }
 966      */
 967     public static int file_index(MemorySegment struct) {
 968         return struct.get(file_index$LAYOUT, file_index$OFFSET);
 969     }
 970 
 971     /**
 972      * Setter for field:
 973      * {@snippet lang=c :
 974      * __u32 file_index
 975      * }
 976      */
 977     public static void file_index(MemorySegment struct, int fieldValue) {
 978         struct.set(file_index$LAYOUT, file_index$OFFSET, fieldValue);
 979     }
 980 
 981     private static final long addr_len$OFFSET = 44;
 982     private static final OfShort addr_len$LAYOUT = (OfShort)$LAYOUT.select(groupElement("$anon$80:2"), groupElement("$anon$83:3"), groupElement("addr_len"));
 983 
 984     /**
 985      * Getter for field:
 986      * {@snippet lang=c :
 987      * __u16 addr_len
 988      * }
 989      */
 990     public static short addr_len(MemorySegment struct) {
 991         return struct.get(addr_len$LAYOUT, addr_len$OFFSET);
 992     }
 993 
 994     /**
 995      * Setter for field:
 996      * {@snippet lang=c :
 997      * __u16 addr_len
 998      * }
 999      */
1000     public static void addr_len(MemorySegment struct, short fieldValue) {
1001         struct.set(addr_len$LAYOUT, addr_len$OFFSET, fieldValue);
1002     }
1003 
1004     private static final long __pad3$OFFSET = 46;
1005     private static final long __pad3$SIZE = 2;
1006 
1007     /**
1008      * Getter for field:
1009      * {@snippet lang=c :
1010      * __u16 __pad3[1]
1011      * }
1012      */
1013     public static MemorySegment __pad3(MemorySegment struct) {
1014         return struct.asSlice(__pad3$OFFSET, __pad3$SIZE);
1015     }
1016 
1017     /**
1018      * Setter for field:
1019      * {@snippet lang=c :
1020      * __u16 __pad3[1]
1021      * }
1022      */
1023     public static void __pad3(MemorySegment struct, MemorySegment fieldValue) {
1024         MemorySegment.copy(fieldValue, 0L, struct, __pad3$OFFSET, __pad3$SIZE);
1025     }
1026 
1027     private static final long addr3$OFFSET = 48;
1028     private static final OfLong addr3$LAYOUT = (OfLong)$LAYOUT.select(groupElement("$anon$88:2"), groupElement("$anon$89:3"), groupElement("addr3"));
1029 
1030     /**
1031      * Getter for field:
1032      * {@snippet lang=c :
1033      * __u64 addr3
1034      * }
1035      */
1036     public static long addr3(MemorySegment struct) {
1037         return struct.get(addr3$LAYOUT, addr3$OFFSET);
1038     }
1039 
1040     /**
1041      * Setter for field:
1042      * {@snippet lang=c :
1043      * __u64 addr3
1044      * }
1045      */
1046     public static void addr3(MemorySegment struct, long fieldValue) {
1047         struct.set(addr3$LAYOUT, addr3$OFFSET, fieldValue);
1048     }
1049 
1050     private static final long __pad2$OFFSET = 56;
1051     private static final long __pad2$SIZE = 8;
1052 
1053     /**
1054      * Getter for field:
1055      * {@snippet lang=c :
1056      * __u64 __pad2[1]
1057      * }
1058      */
1059     public static MemorySegment __pad2(MemorySegment struct) {
1060         return struct.asSlice(__pad2$OFFSET, __pad2$SIZE);
1061     }
1062 
1063     /**
1064      * Setter for field:
1065      * {@snippet lang=c :
1066      * __u64 __pad2[1]
1067      * }
1068      */
1069     public static void __pad2(MemorySegment struct, MemorySegment fieldValue) {
1070         MemorySegment.copy(fieldValue, 0L, struct, __pad2$OFFSET, __pad2$SIZE);
1071     }
1072 
1073     private static final long cmd$OFFSET = 48;
1074     private static final long cmd$SIZE = 0;
1075 
1076     /**
1077      * Getter for field:
1078      * {@snippet lang=c :
1079      * __u8 cmd[0]
1080      * }
1081      */
1082     public static MemorySegment cmd(MemorySegment struct) {
1083         return struct.asSlice(cmd$OFFSET, cmd$SIZE);
1084     }
1085 
1086     /**
1087      * Setter for field:
1088      * {@snippet lang=c :
1089      * __u8 cmd[0]
1090      * }
1091      */
1092     public static void cmd(MemorySegment struct, MemorySegment fieldValue) {
1093         MemorySegment.copy(fieldValue, 0L, struct, cmd$OFFSET, cmd$SIZE);
1094     }
1095 
1096     public static MemorySegment asSlice(MemorySegment array, long index) {
1097         return array.asSlice($LAYOUT().byteSize() * index);
1098     }
1099 
1100     public static long sizeof() { return $LAYOUT().byteSize(); }
1101 
1102     public static MemorySegment allocate(SegmentAllocator allocator) {
1103         return allocator.allocate($LAYOUT());
1104     }
1105 
1106     public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) {
1107         return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, $LAYOUT()));
1108     }
1109 
1110     public static MemorySegment reinterpret(MemorySegment addr, Arena scope, Consumer<MemorySegment> cleanup) {
1111         return reinterpret(addr, 1, scope, cleanup);
1112     }
1113 
1114     public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena scope, Consumer<MemorySegment> cleanup) {
1115         return addr.reinterpret($LAYOUT().byteSize() * elementCount, scope, cleanup);
1116     }
1117 }
1118