End-user parameter part

Updated: May 06, 2022

The second half of the members directly concern your implementation of the connect functions:

path_len and path
The pathname (and its length) that's the operand (i.e., the pathname you're operating on).
extra_type and extra_len
Additional parameters (pathnames, for example) relevant to the connect function.

To get a sense of how the path member is used as “the pathname you're operating on,” let's examine something like the rename() function. This function takes two pathnames; the “original” pathname and the “new” pathname. The original pathname is passed in path, because it's the thing being worked on (it's the filename that's undergoing the name change). The new pathname is the argument to the operation. You'll see that the extra parameter passed to the connect functions conveniently contains a pointer to the argument of the operation—in this case, the new pathname. (Implementation-wise, the new pathname is stored just past the original pathname in the path pointer, with alignment taken into consideration, but you don't have to do anything about this—the extra parameter conveniently gives you the correct pointer.)