GFS_PIO_SENDFILE(3)
π GFS_PIO_SENDFILE(3) π
okay bestie, gather round, because this one is a Gfarm manual page and it is lowkey serving β¨file transfer realnessβ¨. It's gfs_pio_sendfile, and yes, the name is giving "send a file" β but plot twist, it's actually about receiving a Gfarm file onto your local machine. The way that naming is chaotic but we move π
β¨ NAME β¨
gfs_pio_sendfile β receive a Gfarm file to local machine π«Ά
πΈ SYNOPSIS πΈ
#include <gfarm/gfarm.h>
gfarm_error_t gfs_pio_sendfile(GFS_File w_gf, gfarm_off_t w_off,
int r_fd, gfarm_off_t r_off,
gfarm_off_t len, gfarm_off_t * sentp);
π¦ DESCRIPTION π¦
okay so here's the tea β. This function sends len bytes of data, and it's moving them from here to there:
- from the position specified by the offset
r_offin a local file, which is pointed to by a file descriptorr_fdπ that's the read side - to the position specified by the offset
w_offof a Gfarm filew_gfπ that's the write side
and if len is -1? iconic behavior honestly, because then this function just transfers until the end of the file. no byte left behind, periodt π
The transferred bytes get stored into the memory pointed to by sentp β but ONLY when sentp is not NULL. (if you passed NULL, no receipts, that's on you π)
and here's the detail you need for the vibe check: if len is a positive value, and the value pointed to by sentp is less than len, that means the transfer reached EOF. so like, fewer bytes than you asked for = you hit the end of the file. fr fr, that's the signal π
π RETURN VALUES π
GFARM_ERR_NO_ERRORβ slay, the function terminated successfully π β¨GFARM_ERR_OPERATION_NOT_PERMITTEDβgfdoes not specify a regular file. not every file gets to be a regular file, and that's just the rules π«GFARM_ERR_BAD_FILE_DESCRIPTORβ the file descriptor specified bygfis not a valid one, or is not open for reading π like bestie, that fd is not okayGFARM_ERR_NO_FILE_SYSTEM_NODEβ there is no available file system node π nowhere to put this, sorryGFARM_ERR_NO_MEMORYβ insufficient memory was available π«- Others β an error except the above occurred. The reason is shown by
gfarm_error_string(3). go check that one for the full story π§
π SEE ALSO π
gfs_pio_create(3), gfs_pio_open(3), gfs_pio_write(3), gfs_pio_recvfile(3)
and that's the whole page, bestie π«Ά this was Gfarm, dated 12 Aug 2015, and honestly it ate. go forth and transfer your bytes responsibly πβ¨π
π¦ where this page comes from
- debian bookworm: libgfarm-dev 2.7.20+dfsg-1+b2 Β· BSD-like
- debian trixie: libgfarm-dev 2.7.20+dfsg-1.2+b1 Β· BSD-like
- ubuntu jammy: libgfarm-dev 2.7.17+dfsg-1build2 Β· BSD-like
- ubuntu noble: libgfarm-dev 2.7.20+dfsg-1.1ubuntu1 Β· BSD-like
- ubuntu questing: libgfarm-dev 2.7.20+dfsg-1.2
- ubuntu resolute: libgfarm-dev 2.7.20+dfsg-1.3 Β· BSD-like
- ubuntu stonking: libgfarm-dev 2.7.20+dfsg-1.3build1 Β· BSD-like
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms