Query: srv
OS: plan9
Section: 3
Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar
SRV(3) Library Functions Manual SRV(3)NAMEsrv - server registrySYNOPSISbind #s /srv #s/service1 #s/service2 ...DESCRIPTIONThe srv device provides a one-level directory holding already-open channels to services. In effect, srv is a bulletin board on which pro- cesses may post open file descriptors to make them available to other processes. To install a channel, create a new file such as /srv/myserv and then write a text string (suitable for strtoul; see atof(2)) giving the file descriptor number of an open file. Any process may then open /srv/myserv to acquire another reference to the open file that was reg- istered. An entry in srv holds a reference to the associated file even if no process has the file open. Removing the file from /srv releases that reference. It is an error to write more than one number into a server file, or to create a file with a name that is already being used.EXAMPLETo drop one end of a pipe into /srv, that is, to create a named pipe: int fd, p[2]; char buf[32]; pipe(p); fd = create("/srv/namedpipe", 1, 0666); sprint(buf, "%d", p[0]); write(fd, buf, strlen(buf)); close(fd); close(p[0]); write(p[1], "hello", 5); At this point, any process may open and read /srv/namedpipe to receive the hello string. Data written to /srv/namedpipe will be received by executing read(p[1], buf, sizeof buf); in the above process.SOURCE/sys/src/9/port/devsrv.c SRV(3)
Related Man Pages |
---|
srv(9e) - opensolaris |
srv(3) - plan9 |
srv(4) - plan9 |
srv(9e) - debian |
srv(9e) - minix |
Similar Topics in the Unix Linux Community |
---|
File Descriptors |
Performing an open/read, open/write |
open() |
Removing text from a line in a file |
How to create domain controller in Linux for windows client? |