6 * nfs - nfs client library
8 * This code offers a POSIX-like interface directly to an NFS server.
10 * Note: various files are generated from the XDR descriptions in the rpc/
11 * directory using rpcgen.
13 * Author: Ronnie Sahlberg <ronniesahlberg@gmail.com>
17 * #include <ccan/nfs/nfs.h>
20 * #include <sys/types.h>
21 * #include <sys/stat.h>
24 * int main(int argc, char *argv[])
26 * struct nfs_context *nfs;
30 * errx(1, "Usage: %s <serveraddr> <export> <filename>", argv[0]);
31 * nfs = nfs_init_context();
33 * err(1, "Initializing nfs context");
35 * if (nfs_mount_sync(nfs, argv[1], argv[2]) != 0)
36 * errx(1, "Failed to mount nfs share: %s", nfs_get_error(nfs));
38 * if (nfs_stat_sync(nfs, argv[3], &st) != 0)
39 * errx(1, "Failed to stat(%s): %s", argv[3], nfs_get_error(nfs));
41 * printf("Mode %04o\n", st.st_mode);
42 * printf("Size %u\n", (int)st.st_size);
43 * printf("Inode %u\n", (int)st.st_ino);
45 * nfs_destroy_context(nfs);
46 * printf("nfsclient finished\n");
50 int main(int argc, char *argv[])
52 /* Expect exactly one argument */
56 if (strcmp(argv[1], "depends") == 0) {
57 printf("ccan/compiler\n");