Home / Function/ prepReadFd() — netty Function Reference

prepReadFd() — netty Function Reference

Architecture documentation for the prepReadFd() function in MsgHdr.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  a0f2cc56_8b05_2ba4_5adc_c5923f65761a["prepReadFd()"]
  4a81f547_d99c_c526_30f9_847735bb8edf["MsgHdr"]
  a0f2cc56_8b05_2ba4_5adc_c5923f65761a -->|defined in| 4a81f547_d99c_c526_30f9_847735bb8edf
  style a0f2cc56_8b05_2ba4_5adc_c5923f65761a fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

transport-classes-io_uring/src/main/java/io/netty/channel/uring/MsgHdr.java lines 111–127

    static void prepReadFd(ByteBuffer memory, ByteBuffer msgControl, int cmsgHdrDataOffset,
                           ByteBuffer iovMemory, int iovLength) {
        int memoryPosition = memory.position();
        long msgControlAddr = Buffer.memoryAddress(msgControl);
        if (Native.SIZEOF_SIZE_T == 4) {
            memory.putInt(memoryPosition + Native.MSGHDR_OFFSETOF_MSG_CONTROL, (int) msgControlAddr);
            memory.putInt(memoryPosition + Native.MSGHDR_OFFSETOF_MSG_CONTROLLEN, Native.MSG_CONTROL_LEN_FOR_FD);
            memory.putInt(memoryPosition + Native.MSGHDR_OFFSETOF_MSG_IOV, (int) Buffer.memoryAddress(iovMemory));
            memory.putInt(memoryPosition + Native.MSGHDR_OFFSETOF_MSG_IOVLEN, iovLength);
        } else {
            assert Native.SIZEOF_SIZE_T == 8;
            memory.putLong(memoryPosition + Native.MSGHDR_OFFSETOF_MSG_CONTROL, msgControlAddr);
            memory.putLong(memoryPosition + Native.MSGHDR_OFFSETOF_MSG_CONTROLLEN, Native.MSG_CONTROL_LEN_FOR_FD);
            memory.putLong(memoryPosition + Native.MSGHDR_OFFSETOF_MSG_IOV, Buffer.memoryAddress(iovMemory));
            memory.putLong(memoryPosition + Native.MSGHDR_OFFSETOF_MSG_IOVLEN, iovLength);
        }
    }

Domain

Subdomains

Frequently Asked Questions

What does prepReadFd() do?
prepReadFd() is a function in the netty codebase, defined in transport-classes-io_uring/src/main/java/io/netty/channel/uring/MsgHdr.java.
Where is prepReadFd() defined?
prepReadFd() is defined in transport-classes-io_uring/src/main/java/io/netty/channel/uring/MsgHdr.java at line 111.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free