summaryrefslogtreecommitdiff
path: root/lib9p/idl/2010-9P2000.L.9p
diff options
context:
space:
mode:
Diffstat (limited to 'lib9p/idl/2010-9P2000.L.9p')
-rw-r--r--lib9p/idl/2010-9P2000.L.9p165
1 files changed, 160 insertions, 5 deletions
diff --git a/lib9p/idl/2010-9P2000.L.9p b/lib9p/idl/2010-9P2000.L.9p
index d81a15b..5eb7d5c 100644
--- a/lib9p/idl/2010-9P2000.L.9p
+++ b/lib9p/idl/2010-9P2000.L.9p
@@ -1,3 +1,6 @@
+# lib9p/idl/2010-9P2000.L.9p - Generated by `lib9p/idl/2010-9P2000.L.9p.gen 3rd-party/linux-errno.txt`. DO NOT EDIT!
+# 3rd-party/linux-errno.txt - Generated from lib9p/linux-errno.txt.gen and linux.git v6.14. DO NOT EDIT!
+
# lib9p/idl/2010-9P2000.L.9p - Definitions of 9P2000.L messages
#
# Copyright (C) 2024-2025 Luke T. Shumaker <lukeshu@lukeshu.com>
@@ -8,12 +11,149 @@
# https://github.com/chaos/diod/blob/master/src/libnpfs/protocol.h
version "9P2000.L"
+# low-level types ##############################################################
+
from ./2002-9P2000.9p import tag, fid, s, qt, qid
-from ./2002-9P2000.9p import Rerror
-from ./2002-9P2000.9p import Tversion, Rversion, Tflush, Rflush, Twalk, Rwalk, Tread, Rread, Twrite, Rwrite, Tclunk, Rclunk, Tremove, Rremove
-from ./2005-9P2000.u.9p import nuid, errno, Tauth, Rauth, Tattach, Rattach
+from ./2005-9P2000.u.9p import nuid, errno
-#num errno += # TODO
+# BUG: The definitions of errno are not defined in the 9P2000.L
+# protocol spec, and Linux kernel errno values vary by architecture.
+# Most architectures share a "generic" list, but a handful (as of
+# Linux v6.14, Alpha, MIPS, PA-RISC, PowerPC, and SPARC) have their
+# own numbers. This IDL file lists the generic numbers.
+#
+# https://github.com/chaos/diod/issues/35
+num errno += "L_EPERM = 1" # Operation not permitted
+ "L_ENOENT = 2" # No such file or directory
+ "L_ESRCH = 3" # No such process
+ "L_EINTR = 4" # Interrupted system call
+ "L_EIO = 5" # I/O error
+ "L_ENXIO = 6" # No such device or address
+ "L_E2BIG = 7" # Argument list too long
+ "L_ENOEXEC = 8" # Exec format error
+ "L_EBADF = 9" # Bad file number
+ "L_ECHILD = 10" # No child processes
+ "L_EAGAIN = 11" # Try again
+ "L_ENOMEM = 12" # Out of memory
+ "L_EACCES = 13" # Permission denied
+ "L_EFAULT = 14" # Bad address
+ "L_ENOTBLK = 15" # Block device required
+ "L_EBUSY = 16" # Device or resource busy
+ "L_EEXIST = 17" # File exists
+ "L_EXDEV = 18" # Cross-device link
+ "L_ENODEV = 19" # No such device
+ "L_ENOTDIR = 20" # Not a directory
+ "L_EISDIR = 21" # Is a directory
+ "L_EINVAL = 22" # Invalid argument
+ "L_ENFILE = 23" # File table overflow
+ "L_EMFILE = 24" # Too many open files
+ "L_ENOTTY = 25" # Not a typewriter
+ "L_ETXTBSY = 26" # Text file busy
+ "L_EFBIG = 27" # File too large
+ "L_ENOSPC = 28" # No space left on device
+ "L_ESPIPE = 29" # Illegal seek
+ "L_EROFS = 30" # Read-only file system
+ "L_EMLINK = 31" # Too many links
+ "L_EPIPE = 32" # Broken pipe
+ "L_EDOM = 33" # Math argument out of domain of func
+ "L_ERANGE = 34" # Math result not representable
+ "L_EDEADLK = 35" # Resource deadlock would occur
+ "L_ENAMETOOLONG = 36" # File name too long
+ "L_ENOLCK = 37" # No record locks available
+ "L_ENOSYS = 38" # Invalid system call number
+ "L_ENOTEMPTY = 39" # Directory not empty
+ "L_ELOOP = 40" # Too many symbolic links encountered
+ "L_ENOMSG = 42" # No message of desired type
+ "L_EIDRM = 43" # Identifier removed
+ "L_ECHRNG = 44" # Channel number out of range
+ "L_EL2NSYNC = 45" # Level 2 not synchronized
+ "L_EL3HLT = 46" # Level 3 halted
+ "L_EL3RST = 47" # Level 3 reset
+ "L_ELNRNG = 48" # Link number out of range
+ "L_EUNATCH = 49" # Protocol driver not attached
+ "L_ENOCSI = 50" # No CSI structure available
+ "L_EL2HLT = 51" # Level 2 halted
+ "L_EBADE = 52" # Invalid exchange
+ "L_EBADR = 53" # Invalid request descriptor
+ "L_EXFULL = 54" # Exchange full
+ "L_ENOANO = 55" # No anode
+ "L_EBADRQC = 56" # Invalid request code
+ "L_EBADSLT = 57" # Invalid slot
+ "L_EBFONT = 59" # Bad font file format
+ "L_ENOSTR = 60" # Device not a stream
+ "L_ENODATA = 61" # No data available
+ "L_ETIME = 62" # Timer expired
+ "L_ENOSR = 63" # Out of streams resources
+ "L_ENONET = 64" # Machine is not on the network
+ "L_ENOPKG = 65" # Package not installed
+ "L_EREMOTE = 66" # Object is remote
+ "L_ENOLINK = 67" # Link has been severed
+ "L_EADV = 68" # Advertise error
+ "L_ESRMNT = 69" # Srmount error
+ "L_ECOMM = 70" # Communication error on send
+ "L_EPROTO = 71" # Protocol error
+ "L_EMULTIHOP = 72" # Multihop attempted
+ "L_EDOTDOT = 73" # RFS specific error
+ "L_EBADMSG = 74" # Not a data message
+ "L_EOVERFLOW = 75" # Value too large for defined data type
+ "L_ENOTUNIQ = 76" # Name not unique on network
+ "L_EBADFD = 77" # File descriptor in bad state
+ "L_EREMCHG = 78" # Remote address changed
+ "L_ELIBACC = 79" # Can not access a needed shared library
+ "L_ELIBBAD = 80" # Accessing a corrupted shared library
+ "L_ELIBSCN = 81" # .lib section in a.out corrupted
+ "L_ELIBMAX = 82" # Attempting to link in too many shared libraries
+ "L_ELIBEXEC = 83" # Cannot exec a shared library directly
+ "L_EILSEQ = 84" # Illegal byte sequence
+ "L_ERESTART = 85" # Interrupted system call should be restarted
+ "L_ESTRPIPE = 86" # Streams pipe error
+ "L_EUSERS = 87" # Too many users
+ "L_ENOTSOCK = 88" # Socket operation on non-socket
+ "L_EDESTADDRREQ = 89" # Destination address required
+ "L_EMSGSIZE = 90" # Message too long
+ "L_EPROTOTYPE = 91" # Protocol wrong type for socket
+ "L_ENOPROTOOPT = 92" # Protocol not available
+ "L_EPROTONOSUPPORT = 93" # Protocol not supported
+ "L_ESOCKTNOSUPPORT = 94" # Socket type not supported
+ "L_EOPNOTSUPP = 95" # Operation not supported on transport endpoint
+ "L_EPFNOSUPPORT = 96" # Protocol family not supported
+ "L_EAFNOSUPPORT = 97" # Address family not supported by protocol
+ "L_EADDRINUSE = 98" # Address already in use
+ "L_EADDRNOTAVAIL = 99" # Cannot assign requested address
+ "L_ENETDOWN = 100" # Network is down
+ "L_ENETUNREACH = 101" # Network is unreachable
+ "L_ENETRESET = 102" # Network dropped connection because of reset
+ "L_ECONNABORTED = 103" # Software caused connection abort
+ "L_ECONNRESET = 104" # Connection reset by peer
+ "L_ENOBUFS = 105" # No buffer space available
+ "L_EISCONN = 106" # Transport endpoint is already connected
+ "L_ENOTCONN = 107" # Transport endpoint is not connected
+ "L_ESHUTDOWN = 108" # Cannot send after transport endpoint shutdown
+ "L_ETOOMANYREFS = 109" # Too many references: cannot splice
+ "L_ETIMEDOUT = 110" # Connection timed out
+ "L_ECONNREFUSED = 111" # Connection refused
+ "L_EHOSTDOWN = 112" # Host is down
+ "L_EHOSTUNREACH = 113" # No route to host
+ "L_EALREADY = 114" # Operation already in progress
+ "L_EINPROGRESS = 115" # Operation now in progress
+ "L_ESTALE = 116" # Stale file handle
+ "L_EUCLEAN = 117" # Structure needs cleaning
+ "L_ENOTNAM = 118" # Not a XENIX named type file
+ "L_ENAVAIL = 119" # No XENIX semaphores available
+ "L_EISNAM = 120" # Is a named type file
+ "L_EREMOTEIO = 121" # Remote I/O error
+ "L_EDQUOT = 122" # Quota exceeded
+ "L_ENOMEDIUM = 123" # No medium found
+ "L_EMEDIUMTYPE = 124" # Wrong medium type
+ "L_ECANCELED = 125" # Operation Canceled
+ "L_ENOKEY = 126" # Required key not available
+ "L_EKEYEXPIRED = 127" # Key has expired
+ "L_EKEYREVOKED = 128" # Key has been revoked
+ "L_EKEYREJECTED = 129" # Key was rejected by service
+ "L_EOWNERDEAD = 130" # Owner died
+ "L_ENOTRECOVERABLE = 131" # State not recoverable
+ "L_ERFKILL = 132" # Operation not possible due to RF-kill
+ "L_EHWPOISON = 133" # Memory page has hardware error
num super_magic = 4
# See <linux/magic.h> (linux.git include/uapi/linux/magic.h).
@@ -168,8 +308,23 @@ num lock_status = 1
"ERROR=2"
"GRACE=3"
+# 9P2000 Operations (.L subset) ################################################
+
+from ./2002-9P2000.9p import Tversion, Rversion
+from ./2002-9P2000.9p import Tflush, Rflush
+from ./2002-9P2000.9p import Twalk, Rwalk
+from ./2002-9P2000.9p import Tread, Rread, Twrite, Rwrite
+from ./2002-9P2000.9p import Tclunk, Rclunk
+from ./2002-9P2000.9p import Tremove, Rremove
+
+# 9P2000.u Operations (.L subset) ##############################################
+
+from ./2005-9P2000.u.9p import Tattach, Rattach, Tauth, Rauth
+
+# 9P2000.L Operations ##########################################################
+
#msg Tlerror = "size[4,val=end-&size] typ[1,val=6] tag[tag] illegal" # analogous to 106/Terror
-msg Rlerror = "size[4,val=end-&size] typ[1,val=7] tag[tag] ecode[errno]" # analogous to 107/Rerror
+msg Rlerror = "size[4,val=end-&size] typ[1,val=7] tag[tag] errnum[errno]" # analogous to 107/Rerror
msg Tstatfs = "size[4,val=end-&size] typ[1,val=8] tag[tag] fid[fid]"
msg Rstatfs = "size[4,val=end-&size] typ[1,val=9] tag[tag]" # Description | statfs | statvfs
"type[super_magic]" # Type of filesystem | f_type | -