1
0

mnt 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. .TH MNT 3
  2. .SH NAME
  3. mnt \- attach to 9P servers
  4. .SH SYNOPSIS
  5. .nf
  6. .B #M
  7. .fi
  8. .SH DESCRIPTION
  9. The
  10. .I mount driver
  11. is used by the
  12. .B mount
  13. system call
  14. (but not
  15. .BR bind ;
  16. see
  17. .IR bind (2))
  18. to connect the name space of a process to
  19. the service provided by a 9P server over a communications channel.
  20. After the
  21. .BR mount ,
  22. system calls involving files in that portion of the name space will
  23. be converted by the mount driver into the appropriate
  24. 9P messages to the server.
  25. .PP
  26. The
  27. .I mount
  28. system call issues
  29. .I session
  30. and
  31. .IR attach (5)
  32. messages to the server to identify and validate the user of the connection.
  33. Each distinct user of a connection must mount it separately;
  34. the mount driver multiplexes the access of the various users and their
  35. processes to the service.
  36. .PP
  37. File-oriented system calls are converted by the kernel into messages in the 9P protocol.
  38. Within the kernel, 9P is implemented by procedure calls to the
  39. various kernel device drivers.
  40. The mount driver translates these procedure calls into remote procedure calls
  41. to be transmitted as messages over the communication channel to the server.
  42. Each message is implemented by a write
  43. of the corresponding protocol message to the server channel
  44. followed by a read on the server channel to get the reply.
  45. Errors in the reply message are turned into system call error returns.
  46. .PP
  47. A
  48. .IR read (2)
  49. or
  50. .IR write
  51. system call on a file served by the mount driver
  52. may be translated
  53. into more than one
  54. message,
  55. since there is a maximum data size for a 9P message.
  56. The system call
  57. will return when the specified number of bytes have been transferred
  58. or a short reply is returned.
  59. .PP
  60. The string
  61. .L #M
  62. is an illegal file name,
  63. so this device can only be accessed directly by the kernel.
  64. .SH "SEE ALSO"
  65. .IR bind (2)
  66. .SH SOURCE
  67. .B /sys/src/9/port/devmnt.c
  68. .SH BUGS
  69. When mounting a service through the mount driver,
  70. that is, when the channel being multiplexed is itself
  71. a file being served by the mount driver,
  72. large messages may be broken in two.