5 * nfs - nfs client library
7 * This code offers a POSIX-like interface directly to an NFS server.
9 * Note: various files are generated from the XDR descriptions in the rpc/
10 * directory using rpcgen.
12 * Author: Ronnie Sahlberg <ronniesahlberg@gmail.com>
16 * #include <ccan/nfs/nfs.h>
19 * #include <sys/types.h>
20 * #include <sys/stat.h>
23 * int main(int argc, char *argv[])
25 * struct nfs_context *nfs;
29 * errx(1, "Usage: %s <serveraddr> <export> <filename>", argv[0]);
30 * nfs = nfs_init_context();
32 * err(1, "Initializing nfs context");
34 * if (nfs_mount_sync(nfs, argv[1], argv[2]) != 0)
35 * errx(1, "Failed to mount nfs share: %s", nfs_get_error(nfs));
37 * if (nfs_stat_sync(nfs, argv[3], &st) != 0)
38 * errx(1, "Failed to stat(%s): %s", argv[3], nfs_get_error(nfs));
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);
44 * nfs_destroy_context(nfs);
45 * printf("nfsclient finished\n");
49 int main(int argc, char *argv[])
51 /* Expect exactly one argument */
55 if (strcmp(argv[1], "depends") == 0) {
56 printf("ccan/compiler\n");