hmcdrv_ftp_cmd(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… hmcdrv_ftp_cmd β€” or, how to slide a whole FTP command into the HMC drive from user-space πŸŽ€

okay so bestie, this one lives in the Kernel API Manual, section 9. It's called hmcdrv_ftp_cmd and it does a HMC drive FTP with data coming straight from user-space. iconic behavior honestly ✨


🌸 SYNOPSIS 🌸

ssize_t hmcdrv_ftp_cmd (char __kernel *cmd , loff_t offset , char __user
*buf , size_t len );

that's the whole signature, no cap. ssize_t return, four args, let's get into them πŸ‘‘


πŸ¦‹ ARGUMENTS πŸ¦‹

  • cmd β€” the FTP command string, and it's literally shaped like "<cmd> <filename>". so you put your command and your filename in there, together, as one string. periodt πŸ’–
  • offset β€” the file position to read/write. where you're at in the file, basically πŸ“
  • buf β€” a user-space buffer for the read/written directory/file. your lil data bucket πŸͺ£
  • len β€” size of buf (read/dir) or the number of bytes to write. yes, it does double duty, keep up 😌

✨ DESCRIPTION ✨

okay so the one thing you absolutely cannot skip:

this function must not be called before hmcdrv_ftp_startup was called.

like, fr fr. call it too early and you're doing it wrong. startup first, then the command. no exceptions, bestie 😭


πŸ”₯ RETURN πŸ”₯

it hands you back the number of bytes read/written β€” or a negative error code if things went sideways. so if you see a negative number, that's not a byte count, that's the universe telling you something broke πŸ’€


🌈 SEE ALSO 🌈

the kernel file ./drivers/s390/char/hmcdrv_ftp.c, plus the whole friend group:


and that's the whole page, bestie 🫢 shoutout to ./drivers/s390/char for housing this little legend, and to October 2026 for the timestamp β€” go forth and FTP responsibly πŸ§šπŸ’œ

πŸ“¦ where this page comes from