ENUM P9_MSG_T(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ enum p9_msg_t β€” 9P message types ✨

Hey bestie πŸ’– so this page is a kernel API manual entry for enum p9_msg_t, and it's lowkey the master list of every 9P message type. Think of it as the group chat roster for the 9P protocol, where every op shows up as a matched pair: a request and its response. Iconic, honestly.


🌸 SYNOPSIS 🌸

Okay so the enum itself is long, and not me exaggerating β€” here's the whole thing, character for character, no edits, no cuts 🫢:

enum p9_msg_t {
    P9_TLERROR ,
    P9_RLERROR ,
    P9_TSTATFS ,
    P9_RSTATFS ,
    P9_TLOPEN ,
    P9_RLOPEN ,
    P9_TLCREATE ,
    P9_RLCREATE ,
    P9_TSYMLINK ,
    P9_RSYMLINK ,
    P9_TMKNOD ,
    P9_RMKNOD ,
    P9_TRENAME ,
    P9_RRENAME ,
    P9_TREADLINK ,
    P9_RREADLINK ,
    P9_TGETATTR ,
    P9_RGETATTR ,
    P9_TSETATTR ,
    P9_RSETATTR ,
    P9_TXATTRWALK ,
    P9_RXATTRWALK ,
    P9_TXATTRCREATE ,
    P9_RXATTRCREATE ,
    P9_TREADDIR ,
    P9_RREADDIR ,
    P9_TFSYNC ,
    P9_RFSYNC ,
    P9_TLOCK ,
    P9_RLOCK ,
    P9_TGETLOCK ,
    P9_RGETLOCK ,
    P9_TLINK ,
    P9_RLINK ,
    P9_TMKDIR ,
    P9_RMKDIR ,
    P9_TRENAMEAT ,
    P9_RRENAMEAT ,
    P9_TUNLINKAT ,
    P9_RUNLINKAT ,
    P9_TVERSION ,
    P9_RVERSION ,
    P9_TAUTH ,
    P9_RAUTH ,
    P9_TATTACH ,
    P9_RATTACH ,
    P9_TERROR ,
    P9_RERROR ,
    P9_TFLUSH ,
    P9_RFLUSH ,
    P9_TWALK ,
    P9_RWALK ,
    P9_TOPEN ,
    P9_ROPEN ,
    P9_TCREATE ,
    P9_RCREATE ,
    P9_TREAD ,
    P9_RREAD ,
    P9_TWRITE ,
    P9_RWRITE ,
    P9_TCLUNK ,
    P9_RCLUNK ,
    P9_TREMOVE ,
    P9_RREMOVE ,
    P9_TSTAT ,
    P9_RSTAT ,
    P9_TWSTAT ,
    P9_RWSTAT

};

πŸŽ€ Constants πŸŽ€

Grab a snack, bestie, because we're going through every single one. πŸ’… The T ones are the request side, the R ones are the response side β€” iykyk.

  • P9_TLERROR β€” not used 🚫
  • P9_RLERROR β€” the response for any failed request for 9P2000.L
  • P9_TSTATFS β€” file system status request
  • P9_RSTATFS β€” file system status response
  • P9_TLOPEN β€” open a file for I/O (9P2000.L)
  • P9_RLOPEN β€” response with qid and iounit (9P2000.L)
  • P9_TLCREATE β€” prepare a handle for I/O on a new file, for 9P2000.L
  • P9_RLCREATE β€” response with file access information for 9P2000.L
  • P9_TSYMLINK β€” make symlink request
  • P9_RSYMLINK β€” make symlink response
  • P9_TMKNOD β€” create a special file object request
  • P9_RMKNOD β€” create a special file object response
  • P9_TRENAME β€” rename request
  • P9_RRENAME β€” rename response
  • P9_TREADLINK β€” read the symbolic link target (9P2000.L)
  • P9_RREADLINK β€” response with the symbolic link target (9P2000.L)
  • P9_TGETATTR β€” get file attributes request (9P2000.L)
  • P9_RGETATTR β€” get file attributes response (9P2000.L)
  • P9_TSETATTR β€” set file attributes request (9P2000.L)
  • P9_RSETATTR β€” set file attributes response (9P2000.L)
  • P9_TXATTRWALK β€” prepare to read/list extended attributes (9P2000.L)
  • P9_RXATTRWALK β€” response with extended attribute size (9P2000.L)
  • P9_TXATTRCREATE β€” prepare to set an extended attribute (9P2000.L)
  • P9_RXATTRCREATE β€” set extended attribute response (9P2000.L)
  • P9_TREADDIR β€” read directory entries request (9P2000.L)
  • P9_RREADDIR β€” read directory entries response (9P2000.L)
  • P9_TFSYNC β€” flush cached file data to storage request (9P2000.L)
  • P9_RFSYNC β€” flush cached file data to storage response (9P2000.L)
  • P9_TLOCK β€” acquire or release a POSIX record lock (9P2000.L)
  • P9_RLOCK β€” POSIX record lock response (9P2000.L)
  • P9_TGETLOCK β€” test for existence of a POSIX record lock (9P2000.L)
  • P9_RGETLOCK β€” POSIX record lock test response (9P2000.L)
  • P9_TLINK β€” create a hard link (9P2000.L)
  • P9_RLINK β€” hard link response (9P2000.L)
  • P9_TMKDIR β€” create a directory request (9P2000.L)
  • P9_RMKDIR β€” create a directory response (9P2000.L)
  • P9_TRENAMEAT β€” safely rename across directories (9P2000.L)
  • P9_RRENAMEAT β€” rename response (9P2000.L)
  • P9_TUNLINKAT β€” unlink a file or directory (9P2000.L)
  • P9_RUNLINKAT β€” unlink response (9P2000.L)
  • P9_TVERSION β€” negotiate the protocol version and message size
  • P9_RVERSION β€” version handshake response
  • P9_TAUTH β€” request to establish the authentication channel
  • P9_RAUTH β€” response with authentication information
  • P9_TATTACH β€” establish user access to the file service
  • P9_RATTACH β€” response with the top level handle to the file hierarchy
  • P9_TERROR β€” not used 🚫
  • P9_RERROR β€” response for any failed request
  • P9_TFLUSH β€” request to abort a previous request
  • P9_RFLUSH β€” response when the previous request has been cancelled
  • P9_TWALK β€” descend a directory hierarchy
  • P9_RWALK β€” response with a new handle for the position within the hierarchy
  • P9_TOPEN β€” prepare a handle for I/O on an existing file
  • P9_ROPEN β€” response with file access information
  • P9_TCREATE β€” prepare a handle for I/O on a new file
  • P9_RCREATE β€” response with file access information
  • P9_TREAD β€” request to transfer data from a file or directory
  • P9_RREAD β€” response with the data requested
  • P9_TWRITE β€” request to transfer data to a file
  • P9_RWRITE β€” response with how much data was transferred to the file
  • P9_TCLUNK β€” forget about a handle to an entity within the file system
  • P9_RCLUNK β€” response when the server has forgotten about the handle
  • P9_TREMOVE β€” request to remove an entity from the hierarchy
  • P9_RREMOVE β€” response when the server has removed the entity
  • P9_TSTAT β€” request file entity attributes
  • P9_RSTAT β€” response with file entity attributes
  • P9_TWSTAT β€” request to update file entity attributes
  • P9_RWSTAT β€” response when file entity attributes are updated

πŸ¦‹ Description πŸ¦‹

So the tea β˜•: there are 14 basic operations in 9P2000, and they're all paired up as requests and responses. Cute, right? Matched set energy.

The one special case is ERROR β€” because there is no P9_TERROR request for clients to transmit to the server, but the server may respond to any other request with an P9_RERROR. So ERROR is out here with main character energy, showing up uninvited to every conversation. 😭

See Also: http://plan9.bell-labs.com/sys/man/5/INDEX.html

🌈 SEE ALSO 🌈

Kernel file ./include/net/9p/9p.h, plus the whole friend group: enum p9_debug_flags(9), enum p9_open_mode_t(9), enum p9_perm_t(9), enum p9_qid_t(9), struct p9_qid(9), struct p9_wstat(9), struct p9_iattr_dotl(9), struct p9_fcall(9). Go read them, they're all slay. πŸ’œ


Okay that's the whole page, bestie β€” no cap, nothing skipped 🫢 This lil manual lives in the kernel source file ./include/net/9p, and it's stamped October 2026, so go off and read some 9P headers. Periodt. πŸ’…βœ¨πŸŽ€

πŸ“¦ where this page comes from