iscsi_tcp_segment_recv(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… iscsi_tcp_segment_recv(9) β€” the Kernel API Manual, bestie edition ✨

Okay so this is a page from the Kernel API Manual (yes, that manual, the kernel one, we're fancy now πŸŽ€) and it's about one little function that copies data into a segment. Baby function. Big job. Let's get into it πŸ¦‹


✨ NAME ✨

iscsi_tcp_segment_recv β€” copy data to segment πŸ’–

🌸 SYNOPSIS 🌸

int iscsi_tcp_segment_recv (struct iscsi_tcp_conn *tcp_conn , struct
iscsi_segment *segment , const void *ptr , unsigned int len );

Like, that's the whole signature, character for character, no notes πŸ’…

🫢 ARGUMENTS 🫢

  • tcp_conn β€” the iSCSI TCP connection, the main character of this whole vibe 🌈
  • segment β€” the buffer to copy to, aka where the data's gonna live
  • ptr β€” data pointer, literally just a pointer to the data πŸ‘‘
  • len β€” amount of data available, so you know how much we're working with

πŸ¦‹ DESCRIPTION πŸ¦‹

So what this function does is copy up to len bytes into the given buffer, and then it returns the number of bytes actually consumed β€” and yeah, lowkey that number can genuinely be less than len. Not a bug, just how it is πŸ’€

If CRC is enabled, the function will update the CRC while copying. Like, doing both things at once 🧚

And the manpage is very honest about this part: combining these two operations doesn't buy us a lot (yet), but in the future we could implement combined copy+crc, just the way we do for network layer checksums. So it's giving "we left room for a glow-up" ✨

Real talk though: the "returns less than len" thing is for real, so bestie, don't assume you got everything you asked for β€” check what it actually handed back πŸ™ˆ

πŸ’œ SEE ALSO πŸ’œ

Kernel file ./drivers/scsi/libiscsi_tcp.c β€” and while you're there, go peek at all these siblings, they're iconic:


That's the whole page, no skips, no cuts, we ate and left no crumbs πŸ“ Coming to you from ./drivers/scsi, dated October 2026 β€” mwah, periodt πŸ’‹πŸŒ·

πŸ“¦ where this page comes from