hmcdrv_ftp_cmd(9)
π 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 ofbuf(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:
struct hmcdrv_ftp_ops(9)hmcdrv_ftp_cmd_getid(9)hmcdrv_ftp_parse(9)hmcdrv_ftp_do(9)hmcdrv_ftp_probe(9)hmcdrv_ftp_startup(9)hmcdrv_ftp_shutdown(9)
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
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms