]> git.ozlabs.org Git - ccan/blob - ccan/nfs/_info
talloc: fix leak in test/run-set_allocator.c
[ccan] / ccan / nfs / _info
1 #include <string.h>
2 #include <stdio.h>
3
4 /**
5  * nfs - nfs client library
6  *
7  * This code offers a POSIX-like interface directly to an NFS server.
8  *
9  * Note: various files are generated from the XDR descriptions in the rpc/
10  * directory using rpcgen.
11  *
12  * Author: Ronnie Sahlberg <ronniesahlberg@gmail.com>
13  * License: GPL
14  *
15  * Example:
16  * #include <ccan/nfs/nfs.h>
17  * #include <err.h>
18  * #include <stdio.h>
19  * #include <sys/types.h>
20  * #include <sys/stat.h>
21  * #include <unistd.h>
22  *
23  * int main(int argc, char *argv[])
24  * {
25  *      struct nfs_context *nfs;
26  *      struct stat st;
27  *
28  *      if (argc != 4)
29  *              errx(1, "Usage: %s <serveraddr> <export> <filename>", argv[0]);
30  *      nfs = nfs_init_context();
31  *      if (!nfs)
32  *              err(1, "Initializing nfs context");
33  *
34  *      if (nfs_mount_sync(nfs, argv[1], argv[2]) != 0)
35  *              errx(1, "Failed to mount nfs share: %s", nfs_get_error(nfs));
36  *
37  *      if (nfs_stat_sync(nfs, argv[3], &st) != 0)
38  *              errx(1, "Failed to stat(%s): %s", argv[3], nfs_get_error(nfs));
39  *
40  *      printf("Mode %04o\n", st.st_mode);
41  *      printf("Size %u\n", (int)st.st_size);
42  *      printf("Inode %u\n", (int)st.st_ino);
43  *
44  *      nfs_destroy_context(nfs);
45  *      printf("nfsclient finished\n");
46  *      return 0;
47  *}
48  */
49 int main(int argc, char *argv[])
50 {
51         /* Expect exactly one argument */
52         if (argc != 2)
53                 return 1;
54
55         if (strcmp(argv[1], "depends") == 0) {
56                 printf("ccan/compiler\n");
57                 return 0;
58         }
59
60         return 1;
61 }